mirror of
https://github.com/minetest/minetest.git
synced 2024-07-15 04:09:42 +02:00
Actually set settings
This commit is contained in:
parent
ebeb998e1b
commit
a13cf23432
@ -109,5 +109,5 @@ end
|
|||||||
|
|
||||||
function core.show_settings()
|
function core.show_settings()
|
||||||
load(true, false)
|
load(true, false)
|
||||||
show_settings_client_formspec()
|
show_settings_client_formspec("MT_PAUSE_MENU_SETTINGS")
|
||||||
end
|
end
|
||||||
|
@ -756,6 +756,6 @@ function create_settings_dlg()
|
|||||||
return dlg
|
return dlg
|
||||||
end
|
end
|
||||||
|
|
||||||
function show_settings_client_formspec()
|
function show_settings_client_formspec(name)
|
||||||
minetest.show_formspec("dlg_settings", get_formspec({}))
|
minetest.show_formspec(name or "dlg_settings", get_formspec({}))
|
||||||
end
|
end
|
||||||
|
@ -189,6 +189,20 @@ struct LocalFormspecHandler : public TextDest
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_formname == "MT_PAUSE_MENU_SETTINGS")
|
||||||
|
{
|
||||||
|
// Loop through settings
|
||||||
|
for (auto i : fields)
|
||||||
|
{
|
||||||
|
if (g_settings->existsLocal(i.first) && g_settings->get(i.first) != i.second)
|
||||||
|
{
|
||||||
|
g_settings->set(i.first, i.second);
|
||||||
|
//std::cout << "Setting " << i.first << " set!" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_formname == "MT_DEATH_SCREEN") {
|
if (m_formname == "MT_DEATH_SCREEN") {
|
||||||
assert(m_client != nullptr);
|
assert(m_client != nullptr);
|
||||||
@ -1880,6 +1894,7 @@ inline bool Game::handleCallbacks()
|
|||||||
(new GUIKeyChangeMenu(guienv, guiroot, -1,
|
(new GUIKeyChangeMenu(guienv, guiroot, -1,
|
||||||
&g_menumgr, texture_src))->drop();
|
&g_menumgr, texture_src))->drop();
|
||||||
g_gamecallback->keyconfig_requested = false;
|
g_gamecallback->keyconfig_requested = false;
|
||||||
|
m_is_paused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_gamecallback->unpause_requested) {
|
if (g_gamecallback->unpause_requested) {
|
||||||
@ -1891,6 +1906,7 @@ inline bool Game::handleCallbacks()
|
|||||||
if (client->modsLoaded())
|
if (client->modsLoaded())
|
||||||
{
|
{
|
||||||
client->getScript()->show_settings();
|
client->getScript()->show_settings();
|
||||||
|
m_is_paused = false;
|
||||||
}
|
}
|
||||||
g_gamecallback->show_settings_requested = false;
|
g_gamecallback->show_settings_requested = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user