mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01: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:
@@ -5,6 +5,8 @@
|
||||
#include "renderer.h"
|
||||
#include "application.h"
|
||||
#include "Logs.h"
|
||||
#include "translation.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
ui::scenerylist_panel::scenerylist_panel(scenery_scanner &scanner)
|
||||
@@ -12,6 +14,21 @@ ui::scenerylist_panel::scenerylist_panel(scenery_scanner &scanner)
|
||||
{
|
||||
}
|
||||
|
||||
bool ui::scenerylist_panel::on_key(int key, int action)
|
||||
{
|
||||
if (!is_open)
|
||||
return false;
|
||||
|
||||
auto it = keyboard.keytonamemap.find(key);
|
||||
if (it == keyboard.keytonamemap.end())
|
||||
return false;
|
||||
|
||||
if (Global.ctrlState && it->second == "delete")
|
||||
purge_selected_trainset();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ui::scenerylist_panel::draw_scenery_list()
|
||||
{
|
||||
// Draw all the scenarios which are not assigned to any category.
|
||||
@@ -355,6 +372,11 @@ void ui::scenerylist_panel::draw_droptarget(trainset_desc &trainset, int positio
|
||||
}
|
||||
}
|
||||
|
||||
void ui::scenerylist_panel::purge_selected_trainset()
|
||||
{
|
||||
selected_trainset->vehicles.clear();
|
||||
}
|
||||
|
||||
ui::dynamic_edit_popup::dynamic_edit_popup(ui_panel &panel, dynamic_desc &dynamic)
|
||||
: popup(panel), dynamic(dynamic)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user