1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-26 05:15:27 +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

@@ -820,6 +820,8 @@ Game::Game() :
&settingChangedCallback, this);
g_settings->registerChangedCallback("pause_on_lost_focus",
&settingChangedCallback, this);
g_settings->registerChangedCallback("touch_use_crosshair",
&settingChangedCallback, this);
readSettings();
}
@@ -896,8 +898,6 @@ bool Game::startup(bool *kill,
m_first_loop_after_window_activation = true;
m_touch_use_crosshair = g_settings->getBool("touch_use_crosshair");
g_client_translations->clear();
// address can change if simple_singleplayer_mode
@@ -4111,6 +4111,10 @@ void Game::readSettings()
m_invert_hotbar_mouse_wheel = g_settings->getBool("invert_hotbar_mouse_wheel");
m_does_lost_focus_pause_game = g_settings->getBool("pause_on_lost_focus");
m_touch_use_crosshair = g_settings->getBool("touch_use_crosshair");
if (g_touchcontrols)
g_touchcontrols->setUseCrosshair(!isTouchCrosshairDisabled());
}
/****************************************************************************/