mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added a compute damage example script.
Updated compiled scripts due to main.h changes.
This commit is contained in:
+19
-5
@@ -10,21 +10,35 @@
|
||||
variable ini := "sfall-mods.ini";
|
||||
variable translationIni;
|
||||
|
||||
// Gets the integer value from ini
|
||||
// Gets the integer value from the specified ini
|
||||
procedure GetIniConfig(variable section, variable key, variable def, variable inifile) begin
|
||||
variable val := get_ini_setting(inifile + "|" + section + "|" + key);
|
||||
if val == -1 then val := def;
|
||||
return val;
|
||||
end
|
||||
|
||||
// Gets the string value from the specified ini
|
||||
procedure GetIniConfigStr(variable section, variable key, variable def, variable inifile) begin
|
||||
variable val := get_ini_string(inifile + "|" + section + "|" + key);
|
||||
if val == -1 or val == "" then val := def;
|
||||
return val;
|
||||
end
|
||||
|
||||
// Gets the integer value from sfall-mods.ini
|
||||
procedure GetConfig(variable section, variable key, variable def) begin
|
||||
variable val := get_ini_setting(ini + "|" + section + "|" + key);
|
||||
if val == -1 then val := def;
|
||||
return val;
|
||||
end
|
||||
|
||||
// Gets the string value from ini
|
||||
// Gets the string value from sfall-mods.ini
|
||||
procedure GetConfigStr(variable section, variable key, variable def) begin
|
||||
variable val := get_ini_string(ini + "|" + section + "|" + key);
|
||||
if val == -1 or val == "" then val := def;
|
||||
return val;
|
||||
end
|
||||
|
||||
// Gets the value from ini as a temp array of strings
|
||||
// Gets the value from sfall-mods.ini as a temp array of strings
|
||||
procedure GetConfigList(variable section, variable key) begin
|
||||
variable val := get_ini_string(ini + "|" + section + "|" + key);
|
||||
if val == -1 or val == "" then return [];
|
||||
@@ -32,7 +46,7 @@ procedure GetConfigList(variable section, variable key) begin
|
||||
return string_split(val, ",");
|
||||
end
|
||||
|
||||
// Gets the value from ini as a temp array of ints
|
||||
// Gets the value from sfall-mods.ini as a temp array of ints
|
||||
procedure GetConfigListInt(variable section, variable key) begin
|
||||
variable arr, i, item;
|
||||
|
||||
@@ -53,5 +67,5 @@ procedure Translate(variable id, variable def) begin
|
||||
end
|
||||
|
||||
procedure InitConfigs begin
|
||||
translationIni := GetConfigStr("Main", "TranslationsINI", "./Translations.ini");
|
||||
translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini");
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user