1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-13 05:15:28 +01: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
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());