1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add setting callbacks for Camera and TouchControls (#15700)

This commit is contained in:
grorp 2025-01-24 10:50:51 -05:00 committed by GitHub
parent b5e084c9a5
commit 41dfac96c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 71 additions and 25 deletions

View file

@ -23,10 +23,7 @@ GUITouchscreenLayout::GUITouchscreenLayout(gui::IGUIEnvironment* env,
GUIModalMenu(env, parent, id, menumgr),
m_tsrc(tsrc)
{
if (g_touchcontrols)
m_layout = g_touchcontrols->getLayout();
else
m_layout = ButtonLayout::loadFromSettings();
m_layout = ButtonLayout::loadFromSettings();
m_gui_help_text = grab_gui_element<IGUIStaticText>(Environment->addStaticText(
L"", core::recti(), false, false, this, -1));
@ -378,8 +375,6 @@ bool GUITouchscreenLayout::OnEvent(const SEvent& event)
}
if (event.GUIEvent.Caller == m_gui_done_btn.get()) {
if (g_touchcontrols)
g_touchcontrols->applyLayout(m_layout);
std::ostringstream oss;
m_layout.serializeJson(oss);
g_settings->set("touch_layout", oss.str());