Bandaid for #1281, until we properly solve unreliable init handlers. 1- Menus for CAManBase are precomputed on preInit 2- Class action menus for all men are supposed to be equal to those of CAManBase Note: we loose the capability of defining actions for specific classes from config (which we don't do on ACE annyway)

This commit is contained in:
esteldunedain
2015-05-18 15:37:05 -03:00
committed by KoffeinFlummi
parent 694a24c970
commit 22b83826f0
3 changed files with 43 additions and 23 deletions

View File

@ -14,10 +14,12 @@
EXPLODE_1_PVT(_this,_target);
private ["_objectType","_actionsVarName"];
private ["_objectType","_actionsVarName","_isMan"];
_objectType = _target;
_isMan = false;
if (typeName _target == "OBJECT") then {
_objectType = typeOf _target;
_isMan = _target isKindOf "CAManBase";
};
_actionsVarName = format [QGVAR(Act_%1), _objectType];
@ -94,10 +96,16 @@ _recurseFnc = {
_actions
};
private "_actionsCfg";
private ["_actionsCfg","_actions"];
_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions";
missionNamespace setVariable [_actionsVarName, [_actionsCfg] call _recurseFnc];
// If the classname inherits from CAManBase, just copy it's menu without recompiling a new one
_actions = if (_isMan) then {
+ (missionNamespace getVariable QGVAR(Act_CAManBase))
} else {
[_actionsCfg] call _recurseFnc
};
missionNamespace setVariable [_actionsVarName, _actions];
/*
[