2015-02-03 00:14:16 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: esteldunedain
|
2015-02-03 03:43:23 +00:00
|
|
|
* Load the user setable settings from the user profile.
|
2015-02-03 00:14:16 +00:00
|
|
|
* Config < Server UserConfig < Mission Config < Client settings
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-02-03 03:43:23 +00:00
|
|
|
// Iterate through settings
|
|
|
|
{
|
2015-09-18 16:28:19 +00:00
|
|
|
_x params ["_name", "", "_isClientSetable", "", "", "", "_isForced"];
|
2015-02-03 00:14:16 +00:00
|
|
|
|
2015-02-03 03:43:23 +00:00
|
|
|
// If setting is user setable
|
|
|
|
if (_isClientSetable) then {
|
|
|
|
// If setting is not forced
|
|
|
|
if !(_isForced) then {
|
2015-09-18 16:28:19 +00:00
|
|
|
private "_profileValue";
|
|
|
|
_profileValue = profileNamespace getVariable _name;
|
|
|
|
|
2015-02-03 03:43:23 +00:00
|
|
|
// If the setting is stored on the profile
|
2015-02-03 19:49:40 +00:00
|
|
|
if !(isNil "_profileValue") then {
|
2015-02-03 03:43:23 +00:00
|
|
|
// If the profile variable has the correct type
|
2015-09-18 16:28:19 +00:00
|
|
|
if (typeName _profileValue == typeName (missionNamespace getVariable _name)) then {
|
2015-02-03 03:43:23 +00:00
|
|
|
// Load the setting from the profile
|
2015-09-18 16:28:19 +00:00
|
|
|
missionNamespace setVariable [_name, _profileValue];
|
2015-02-03 00:14:16 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-09-18 16:28:19 +00:00
|
|
|
false
|
|
|
|
} count GVAR(settings);
|