2021-07-05 03:02:30 +00:00
|
|
|
class SettingsLevel extends Object
|
2021-06-09 02:47:15 +00:00
|
|
|
dependson(Types)
|
2021-06-20 05:04:22 +00:00
|
|
|
config(YAS);
|
2021-06-09 02:47:15 +00:00
|
|
|
|
2021-06-12 20:11:37 +00:00
|
|
|
`include(Build.uci)
|
|
|
|
`include(Logger.uci)
|
|
|
|
|
2021-06-09 02:47:15 +00:00
|
|
|
var config int Normal_Low;
|
|
|
|
var config int Normal_High;
|
|
|
|
var config int Hard_Low;
|
|
|
|
var config int Hard_High;
|
|
|
|
var config int Suicide_Low;
|
|
|
|
var config int Suicide_High;
|
|
|
|
var config int HellOnEarth_Low;
|
|
|
|
var config int HellOnEarth_High;
|
|
|
|
|
2021-07-05 03:02:30 +00:00
|
|
|
public static function InitConfig(int ConfigVersion)
|
|
|
|
{
|
|
|
|
`callstack_static("InitConfig");
|
|
|
|
|
|
|
|
switch (ConfigVersion)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
WriteSettings(DefaultSettings());
|
|
|
|
|
|
|
|
case 2147483647:
|
|
|
|
StaticSaveConfig();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-20 20:09:12 +00:00
|
|
|
public static function YASSettingsLevel DefaultSettings()
|
2021-06-09 02:47:15 +00:00
|
|
|
{
|
2021-06-20 20:09:12 +00:00
|
|
|
local YASSettingsLevel Settings;
|
2021-06-12 20:11:37 +00:00
|
|
|
|
|
|
|
`callstack_static("DefaultSettings");
|
|
|
|
|
2021-06-09 02:47:15 +00:00
|
|
|
return Settings;
|
|
|
|
}
|
|
|
|
|
2021-06-20 20:09:12 +00:00
|
|
|
public static function YASSettingsLevel Settings()
|
2021-06-09 02:47:15 +00:00
|
|
|
{
|
2021-06-20 20:09:12 +00:00
|
|
|
local YASSettingsLevel Settings;
|
2021-06-09 02:47:15 +00:00
|
|
|
|
2021-06-12 20:11:37 +00:00
|
|
|
`callstack_static("Settings");
|
|
|
|
|
2021-07-05 03:02:30 +00:00
|
|
|
Settings.Low [0] = default.Normal_Low;
|
2021-06-09 02:47:15 +00:00
|
|
|
Settings.High[0] = default.Normal_High;
|
2021-07-05 03:02:30 +00:00
|
|
|
Settings.Low [1] = default.Hard_Low;
|
2021-06-09 02:47:15 +00:00
|
|
|
Settings.High[1] = default.Hard_High;
|
2021-07-05 03:02:30 +00:00
|
|
|
Settings.Low [2] = default.Suicide_Low;
|
2021-06-09 02:47:15 +00:00
|
|
|
Settings.High[2] = default.Suicide_High;
|
2021-07-05 03:02:30 +00:00
|
|
|
Settings.Low [3] = default.HellOnEarth_Low;
|
2021-06-09 02:47:15 +00:00
|
|
|
Settings.High[3] = default.HellOnEarth_High;
|
|
|
|
|
|
|
|
return Settings;
|
|
|
|
}
|
|
|
|
|
2021-06-20 20:09:12 +00:00
|
|
|
public static function WriteSettings(YASSettingsLevel Settings)
|
2021-06-09 02:47:15 +00:00
|
|
|
{
|
2021-06-12 20:11:37 +00:00
|
|
|
`callstack_static("WriteSettings");
|
|
|
|
|
2021-07-05 03:02:30 +00:00
|
|
|
default.Normal_Low = Settings.Low [0];
|
|
|
|
default.Normal_High = Settings.High[0];
|
|
|
|
default.Hard_Low = Settings.Low [1];
|
|
|
|
default.Hard_High = Settings.High[1];
|
|
|
|
default.Suicide_Low = Settings.Low [2];
|
|
|
|
default.Suicide_High = Settings.High[2];
|
|
|
|
default.HellOnEarth_Low = Settings.Low [3];
|
2021-06-09 02:47:15 +00:00
|
|
|
default.HellOnEarth_High = Settings.High[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
DefaultProperties
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|