mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
51 lines
1.8 KiB
Plaintext
51 lines
1.8 KiB
Plaintext
#define DEBUG_MODE_FULL
|
|
#include "script_component.hpp"
|
|
/*
|
|
* Author: esteldunedain
|
|
* Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module.
|
|
* Must be called on all machines!!!!!!!
|
|
*
|
|
* Arguments:
|
|
* 0: Module <OBJECT>
|
|
* 1: ACE_Parameter name <STRING>
|
|
* 2: Module parameter name <STRING>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [MODULE, "Param", "paramname"] call ace_common_fnc_readSettingFromModule
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_logic", "_settingName", "_moduleVariable"];
|
|
|
|
// Check if the variable is already defined
|
|
if (isNil _settingName) exitWith {
|
|
ERROR_1("readSettingFromModule - param [%1] is not an ace_setting", _settingName);
|
|
};
|
|
|
|
// Check if the parameter is defined in the module
|
|
if (isNil {_logic getVariable _moduleVariable}) exitWith {
|
|
WARNING_2("Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.",typeOf _logic,_moduleVariable);
|
|
};
|
|
|
|
private _value = _logic getVariable _moduleVariable;
|
|
if (_value isEqualTo -1) then {
|
|
//3den missions will save modules with value = 0 as -1
|
|
//If the setting has a "values" array, we should be able to assume that -1 is not a valid number as it would not be a valid index for the array
|
|
if (isArray (configFile >> "ACE_Settings" >> _settingName >> "values")) then {
|
|
WARNING_2("Module For Setting [%1] is saved as (-1), switching to (0) - missionVersion [%2]",_settingName,missionVersion);
|
|
_value = 0;
|
|
};
|
|
};
|
|
|
|
if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then {
|
|
WARNING_1("Setting [%1] - Already Forced",_settingName);
|
|
};
|
|
|
|
// Set the setting as a mission setting and force it
|
|
TRACE_2("setSettingMission from module",_settingName,_value);
|
|
["CBA_settings_setSettingMission", [_settingName, _value, true]] call CBA_fnc_localEvent;
|