This commit is contained in:
Glowbal 2015-03-27 16:26:18 +01:00
parent 4336cf0fc1
commit 7a091215e1

View File

@ -15,11 +15,13 @@
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 // Check if all settings should be forced
@ -28,38 +30,16 @@ if (GVAR(forceAllSettings)) then {
_x set [6, true]; _x set [6, true];
} forEach GVAR(settings); } forEach GVAR(settings);
}; };
};
// @todo // Server config
// Load settings from server userconfig only if the ACE_ServerSettings is loaded [configFile >> "ACE_ServerSettings"] call _parseConfigForSettings;
/*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
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 // Regular config
_countOptions = count (missionConfigFile >> "ACE_Settings"); [configFile >> "ACE_Settings"] call _parseConfigForSettings;
for "_index" from 0 to (_countOptions - 1) do {
_optionEntry = (missionConfigFile >> "ACE_Settings") select _index;
[_optionEntry] call FUNC(setSettingFromConfig); // mission side settings
}; [missionConfigFile >> "ACE_Settings"] call _parseConfigForSettings;
// Check if all settings should be forced
if (GVAR(forceAllSettings)) then {
{
_x set [6, true];
} forEach GVAR(settings);
};
// Publish all settings data // Publish all settings data
publicVariable QGVAR(settings); publicVariable QGVAR(settings);