16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 17:29:18 +02:00

Launcher improvements

Launcher windows are more Starter-like now:
- The scenery picker, vehicle list and keymapper buttons are now tied to the top portion of the screen.
- The current window is spanning the entire rest of the screen.
- Scenarios are now grouped into categories in the exact same way as Starter does.
- Some drawbacks include:
  - Currently you cannot edit the current trainset, as the vehicle picker window overwrites the scenario list window.
  - The GUI doesn't update when the screen resolution is changed.
This commit is contained in:
jakubg1
2025-09-09 16:40:04 +02:00
parent 22c0aed82d
commit c217081823
12 changed files with 335 additions and 334 deletions

View File

@@ -2,6 +2,7 @@
#include "uilayer.h"
#include "textures_scanner.h"
#include "translation.h"
namespace ui {
@@ -10,7 +11,7 @@ class vehiclepicker_panel : public ui_panel
public:
vehiclepicker_panel();
void render() override;
void render_contents() override;
private:
bool selectable_image(const char *desc, bool selected, const deferred_image *image, const skin_set *pickable = nullptr);
@@ -22,6 +23,24 @@ private:
bool display_by_groups = true;
deferred_image placeholder_mini;
std::array<char, 128> search_query = { 0 };
std::map<vehicle_type, std::string> type_names =
{
{ vehicle_type::electric_loco, STRN("Electric locos") },
{ vehicle_type::diesel_loco, STRN("Diesel locos") },
{ vehicle_type::steam_loco, STRN("Steam locos") },
{ vehicle_type::railcar, STRN("Railcars") },
{ vehicle_type::emu, STRN("EMU") },
{ vehicle_type::utility, STRN("Utility") },
{ vehicle_type::draisine, STRN("Draisines") },
{ vehicle_type::tram, STRN("Trams") },
{ vehicle_type::carriage, STRN("Carriages") },
{ vehicle_type::truck, STRN("Trucks") },
{ vehicle_type::bus, STRN("Buses") },
{ vehicle_type::car, STRN("Cars") },
{ vehicle_type::man, STRN("People") },
{ vehicle_type::animal, STRN("Animals") },
{ vehicle_type::unknown, STRN("Unknown") }
};
vehicles_bank bank;