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 DESCRIPTION_HIDDEN = '<hidden>';
|
||||||
|
|
||||||
const SETTING_HIDE_SETTINGS_WITH_DESCRIPTION_HIDDEN = 'Hide Settings with Description "' . self::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_LOAD_DEFAULT_SETTINGS_MAP_BEGIN = 'Load Stored GameMode-Settings on Map-Begin';
|
||||||
const SETTING_PERMISSION_CHANGE_MODE_SETTINGS = 'Change GameMode-Settings';
|
const SETTING_PERMISSION_CHANGE_MODE_SETTINGS = 'Change GameMode-Settings';
|
||||||
/** @deprecated */
|
/** @deprecated */
|
||||||
@ -77,6 +78,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_HIDE_SETTINGS_WITH_DESCRIPTION_HIDDEN, true);
|
$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_LOAD_DEFAULT_SETTINGS_MAP_BEGIN, false);
|
||||||
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_SORT_SETTINGS, true);
|
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_SORT_SETTINGS, true);
|
||||||
|
|
||||||
@ -214,7 +216,9 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
|||||||
* Handle OnInit callback
|
* Handle OnInit callback
|
||||||
*/
|
*/
|
||||||
public function onInit() {
|
public function onInit() {
|
||||||
$this->loadSettingsFromDatabase();
|
if ($this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_LOAD_DEFAULT_SETTINGS_MAP_BEGIN)) {
|
||||||
|
$this->loadSettingsFromDatabase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user