mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Implement an editor to customize the touchscreen controls (#14933)
- The editor is accessible via the pause menu and the settings menu. - Buttons can be moved via drag & drop. - Buttons can be added/removed. The grid menu added by #14918 is used to show all buttons not included in the layout. - Custom layouts are responsive and adapt to changed screen size / DPI / hud_scaling. - The layout is saved as JSON in the "touch_layout" setting.
This commit is contained in:
parent
4faa16fe0d
commit
6a1d22b2c5
18 changed files with 1122 additions and 195 deletions
|
@ -21,6 +21,7 @@ public:
|
|||
virtual void changeVolume() = 0;
|
||||
virtual void showOpenURLDialog(const std::string &url) = 0;
|
||||
virtual void signalKeyConfigChange() = 0;
|
||||
virtual void touchscreenLayout() = 0;
|
||||
};
|
||||
|
||||
extern gui::IGUIEnvironment *guienv;
|
||||
|
@ -133,6 +134,11 @@ public:
|
|||
keyconfig_changed = true;
|
||||
}
|
||||
|
||||
void touchscreenLayout() override
|
||||
{
|
||||
touchscreenlayout_requested = true;
|
||||
}
|
||||
|
||||
void showOpenURLDialog(const std::string &url) override
|
||||
{
|
||||
show_open_url_dialog = url;
|
||||
|
@ -142,6 +148,7 @@ public:
|
|||
bool changepassword_requested = false;
|
||||
bool changevolume_requested = false;
|
||||
bool keyconfig_requested = false;
|
||||
bool touchscreenlayout_requested = false;
|
||||
bool shutdown_requested = false;
|
||||
bool keyconfig_changed = false;
|
||||
std::string show_open_url_dialog = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue