1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +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

@ -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());
}
/****************************************************************************/