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

Move keybinding settings to (Lua-based) setting menu (#15791)

This commit is contained in:
y5nw 2025-04-20 20:20:49 +02:00 committed by GitHub
parent c1d2124102
commit 23bfb2db72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 591 additions and 782 deletions

View file

@ -47,6 +47,7 @@
#include "guiButton.h"
#include "guiButtonImage.h"
#include "guiButtonItemImage.h"
#include "guiButtonKey.h"
#include "guiEditBoxWithScrollbar.h"
#include "guiInventoryList.h"
#include "guiItemImage.h"
@ -1025,8 +1026,16 @@ void GUIFormSpecMenu::parseButton(parserData* data, const std::string &element)
if (data->type == "button_url" || data->type == "button_url_exit")
spec.url = url;
GUIButton *e = GUIButton::addButton(Environment, rect, m_tsrc,
data->current_parent, spec.fid, spec.flabel.c_str());
GUIButton *e;
if (data->type == "button_key") {
spec.ftype = f_Unknown;
e = GUIButtonKey::addButton(Environment, rect, m_tsrc,
data->current_parent, spec.fid, spec.flabel.c_str());
} else {
e = GUIButton::addButton(Environment, rect, m_tsrc,
data->current_parent, spec.fid, spec.flabel.c_str());
}
auto style = getStyleForElement(data->type, name, (data->type != "button") ? "button" : "");
@ -2873,6 +2882,7 @@ const std::unordered_map<std::string, std::function<void(GUIFormSpecMenu*, GUIFo
{"button_exit", &GUIFormSpecMenu::parseButton},
{"button_url", &GUIFormSpecMenu::parseButton},
{"button_url_exit", &GUIFormSpecMenu::parseButton},
{"button_key", &GUIFormSpecMenu::parseButton},
{"background", &GUIFormSpecMenu::parseBackground},
{"background9", &GUIFormSpecMenu::parseBackground},
{"tableoptions", &GUIFormSpecMenu::parseTableOptions},