1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

TouchScreenGUI: Add an exit / "ESC" button to the rare controls bar (#13574)

This commit is contained in:
Gregor Parzefall 2023-06-22 17:50:36 +02:00 committed by GitHub
parent 7c26cb1c35
commit 03ffc2618c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 123 additions and 1 deletions

View file

@ -50,6 +50,11 @@ const char **joystick_imagenames = (const char *[]) {
static irr::EKEY_CODE id2keycode(touch_gui_button_id id)
{
// ESC isn't part of the keymap.
if (id == exit_id) {
return KEY_ESCAPE;
}
std::string key = "";
switch (id) {
case inventory_id:
@ -548,9 +553,10 @@ void TouchScreenGUI::init(ISimpleTextureSource *tsrc)
+ (0.5 * button_size)),
AHBB_Dir_Left_Right, 2.0);
m_rarecontrolsbar.addButton(chat_id, L"Chat", "chat_btn.png");
m_rarecontrolsbar.addButton(chat_id, L"chat", "chat_btn.png");
m_rarecontrolsbar.addButton(inventory_id, L"inv", "inventory_btn.png");
m_rarecontrolsbar.addButton(drop_id, L"drop", "drop_btn.png");
m_rarecontrolsbar.addButton(exit_id, L"exit", "exit_btn.png");
m_initialized = true;
}