Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interact Menu - Cache config actions for CAManBase #6818

Merged
merged 4 commits into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions addons/interact_menu/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if (!hasInterface) exitWith { ADDON = true; };
GVAR(ActNamespace) = [] call CBA_fnc_createNamespace;
GVAR(ActSelfNamespace) = [] call CBA_fnc_createNamespace;

// Compile actions for CaManBase now and use for all mans types
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
["CaManBase"] call FUNC(compileMenu);
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
GVAR(cacheManActions) = +(GVAR(ActNamespace) getVariable ["CaManBase", []]); // copy
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved

// Event handlers for all interact menu controls
DFUNC(handleMouseMovement) = {
if (GVAR(cursorKeepCentered)) then {
Expand Down
14 changes: 9 additions & 5 deletions addons/interact_menu/functions/fnc_compileMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ private _namespace = GVAR(ActNamespace);
// Exit if the action menu is already compiled for this class
if !(isNil {_namespace getVariable _objectType}) exitWith {};

if ((_objectType isKindOf "CaManBase") && {!isNil QGVAR(cacheManActions)}) exitWith {
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
_namespace setVariable [_objectType, +GVAR(cacheManActions)]; // copy
};

if ((getNumber (configFile >> "CfgVehicles" >> _objectType >> "isPlayableLogic")) == 1) exitWith {
TRACE_1("skipping playable logic",_objectType);
_namespace setVariable [_objectType, []];
};

private _recurseFnc = {
params ["_actionsCfg", "_parentDistance"];
private _actions = [];
Expand Down Expand Up @@ -106,11 +115,6 @@ private _recurseFnc = {
_actions
};

if ((getNumber (configFile >> "CfgVehicles" >> _objectType >> "isPlayableLogic")) == 1) exitWith {
TRACE_1("skipping playable logic",_objectType);
_namespace setVariable [_objectType, []];
};

private _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions";

TRACE_1("Building ACE_Actions",_objectType);
Expand Down