Add the possibility to don't load settings from database
This commit is contained in:
parent
024037c48b
commit
076c066e43
@ -50,6 +50,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
||||
const DESCRIPTION_HIDDEN = '<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,8 +216,10 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
||||
* Handle OnInit callback
|
||||
*/
|
||||
public function onInit() {
|
||||
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN)) {
|
||||
$this->loadSettingsFromDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Settings from Database
|
||||
|
Loading…
Reference in New Issue
Block a user