diff --git a/core/Configurator/GameModeSettings.php b/core/Configurator/GameModeSettings.php index 86f9d7a2..c12f38fc 100644 --- a/core/Configurator/GameModeSettings.php +++ b/core/Configurator/GameModeSettings.php @@ -50,6 +50,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat const DESCRIPTION_HIDDEN = ''; const SETTING_HIDE_SETTINGS_WITH_DESCRIPTION_HIDDEN = 'Hide Settings with Description "' . self::DESCRIPTION_HIDDEN . '"'; + const SETTING_LOAD_DEFAULT_SETTINGS_STARTUP = 'Load Stored GameMode-Settings on Startup'; const SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN = 'Load Stored GameMode-Settings on Map-Begin'; const SETTING_PERMISSION_CHANGE_MODE_SETTINGS = 'Change GameMode-Settings'; /** @deprecated */ @@ -77,6 +78,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat // Settings $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_HIDE_SETTINGS_WITH_DESCRIPTION_HIDDEN, true); + $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_LOAD_DEFAULT_SETTINGS_STARTUP, true); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN, false); $this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_SORT_SETTINGS, true); @@ -214,7 +216,9 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat * Handle OnInit callback */ public function onInit() { - $this->loadSettingsFromDatabase(); + if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN)) { + $this->loadSettingsFromDatabase(); + } } /**