mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Draft #188
This commit is contained in:
parent
4336cf0fc1
commit
7a091215e1
@ -15,52 +15,32 @@
|
|||||||
|
|
||||||
GVAR(settings) = [];
|
GVAR(settings) = [];
|
||||||
|
|
||||||
// Load settings from main config
|
_parseConfigForSettings = {
|
||||||
_countOptions = count (configFile >> "ACE_Settings");
|
private ["_config", "_countOptions", "_optionEntry", "_index"];
|
||||||
for "_index" from 0 to (_countOptions - 1) do {
|
|
||||||
_optionEntry = (configFile >> "ACE_Settings") select _index;
|
|
||||||
|
|
||||||
|
_config = _this select 0;
|
||||||
|
_countOptions = count _config;
|
||||||
|
for "_index" from 0 to (_countOptions - 1) do {
|
||||||
|
_optionEntry = _config select _index;
|
||||||
[_optionEntry] call FUNC(setSettingFromConfig);
|
[_optionEntry] call FUNC(setSettingFromConfig);
|
||||||
};
|
|
||||||
// Check if all settings should be forced
|
|
||||||
if (GVAR(forceAllSettings)) then {
|
|
||||||
{
|
|
||||||
_x set [6, true];
|
|
||||||
} forEach GVAR(settings);
|
|
||||||
};
|
|
||||||
|
|
||||||
// @todo
|
|
||||||
// Load settings from server userconfig only if the ACE_ServerSettings is loaded
|
|
||||||
/*if (isClass (configFile >> "CfgPatches" >> "ACE_ServerSettings")) then {
|
|
||||||
DFUNC(serverUserConfig) = compile preprocessFileLineNumbers "\userconfig\ACE\ACE_Settings.hpp";
|
|
||||||
if !(isNil DFUNC(serverUserConfig)) then {
|
|
||||||
[] call FUNC(serverUserConfig);
|
|
||||||
};
|
};
|
||||||
// Check if all settings should be forced
|
// Check if all settings should be forced
|
||||||
if (GVAR(forceAllSettings)) then {
|
if (GVAR(forceAllSettings)) then {
|
||||||
{
|
|
||||||
if !(missionNamespace getVariable format ["%1_forced", _x]) then {
|
|
||||||
missionNamespace setVariable format ["%1_forced", _x, true];
|
|
||||||
publicVariable format ["%1_forced", _name];
|
|
||||||
};
|
|
||||||
} forEach GVAR(settingsList);
|
|
||||||
};
|
|
||||||
};*/
|
|
||||||
|
|
||||||
// Load settings from mission config
|
|
||||||
_countOptions = count (missionConfigFile >> "ACE_Settings");
|
|
||||||
for "_index" from 0 to (_countOptions - 1) do {
|
|
||||||
_optionEntry = (missionConfigFile >> "ACE_Settings") select _index;
|
|
||||||
|
|
||||||
[_optionEntry] call FUNC(setSettingFromConfig);
|
|
||||||
};
|
|
||||||
// Check if all settings should be forced
|
|
||||||
if (GVAR(forceAllSettings)) then {
|
|
||||||
{
|
{
|
||||||
_x set [6, true];
|
_x set [6, true];
|
||||||
} forEach GVAR(settings);
|
} forEach GVAR(settings);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Server config
|
||||||
|
[configFile >> "ACE_ServerSettings"] call _parseConfigForSettings;
|
||||||
|
|
||||||
|
// Regular config
|
||||||
|
[configFile >> "ACE_Settings"] call _parseConfigForSettings;
|
||||||
|
|
||||||
|
// mission side settings
|
||||||
|
[missionConfigFile >> "ACE_Settings"] call _parseConfigForSettings;
|
||||||
|
|
||||||
// Publish all settings data
|
// Publish all settings data
|
||||||
publicVariable QGVAR(settings);
|
publicVariable QGVAR(settings);
|
||||||
// Publish all setting values
|
// Publish all setting values
|
||||||
|
Loading…
Reference in New Issue
Block a user