2015-01-18 18:38:27 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
ADDON = false;
|
|
|
|
|
2016-11-23 19:35:25 +00:00
|
|
|
PREP_RECOMPILE_START;
|
2016-02-22 14:20:36 +00:00
|
|
|
#include "XEH_PREP.hpp"
|
2016-11-23 19:35:25 +00:00
|
|
|
PREP_RECOMPILE_END;
|
2015-05-03 04:13:35 +00:00
|
|
|
|
2023-12-07 03:20:47 +00:00
|
|
|
#include "initSettings.inc.sqf"
|
2018-04-28 22:23:44 +00:00
|
|
|
|
2019-02-01 01:25:16 +00:00
|
|
|
if (!hasInterface) exitWith { ADDON = true; };
|
|
|
|
|
2024-03-28 18:57:23 +00:00
|
|
|
["All", "init", LINKFUNC(compileMenu)] call CBA_fnc_addClassEventHandler;
|
2019-02-01 01:25:16 +00:00
|
|
|
|
2024-05-22 01:18:32 +00:00
|
|
|
GVAR(ActNamespace) = createHashMap;
|
|
|
|
GVAR(ActSelfNamespace) = createHashMap;
|
2016-03-06 05:22:38 +00:00
|
|
|
|
2019-02-23 00:54:07 +00:00
|
|
|
// Compile actions for CAManBase now and use for all mans types
|
|
|
|
["CAManBase"] call FUNC(compileMenu);
|
2024-05-22 01:18:32 +00:00
|
|
|
GVAR(cacheManActions) = +(GVAR(ActNamespace) getOrDefault ["CAManBase" call EFUNC(common,getConfigName), []]); // copy
|
2019-02-23 00:54:07 +00:00
|
|
|
|
2015-05-02 04:33:28 +00:00
|
|
|
// Event handlers for all interact menu controls
|
|
|
|
DFUNC(handleMouseMovement) = {
|
2019-12-08 01:44:04 +00:00
|
|
|
if ([GVAR(cursorKeepCentered), GVAR(cursorKeepCenteredSelfInteraction)] select GVAR(keyDownSelfAction)) then {
|
2015-05-02 04:33:28 +00:00
|
|
|
GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0];
|
|
|
|
setMousePosition [0.5, 0.5];
|
|
|
|
} else {
|
|
|
|
GVAR(cursorPos) = [_this select 1, _this select 2, 0];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
DFUNC(handleMouseButtonDown) = {
|
|
|
|
if !(GVAR(actionOnKeyRelease)) then {
|
|
|
|
[GVAR(openedMenuType),true] call FUNC(keyUp);
|
|
|
|
};
|
|
|
|
};
|
2015-05-03 04:13:35 +00:00
|
|
|
|
2015-01-18 18:38:27 +00:00
|
|
|
GVAR(keyDown) = false;
|
2015-02-18 21:58:06 +00:00
|
|
|
GVAR(keyDownSelfAction) = false;
|
2015-01-18 18:38:27 +00:00
|
|
|
GVAR(keyDownTime) = 0;
|
2015-03-24 15:27:27 +00:00
|
|
|
GVAR(openedMenuType) = -1;
|
2015-01-18 18:38:27 +00:00
|
|
|
|
2016-03-02 10:01:39 +00:00
|
|
|
GVAR(lastTime) = diag_tickTime;
|
2015-01-18 18:38:27 +00:00
|
|
|
GVAR(rotationAngle) = 0;
|
|
|
|
|
2015-03-11 03:21:05 +00:00
|
|
|
GVAR(selectedAction) = [[],[]];
|
2015-01-18 18:38:27 +00:00
|
|
|
GVAR(actionSelected) = false;
|
|
|
|
GVAR(selectedTarget) = objNull;
|
|
|
|
|
|
|
|
GVAR(menuDepthPath) = [];
|
|
|
|
GVAR(lastPos) = [0,0,0];
|
|
|
|
|
|
|
|
GVAR(currentOptions) = [];
|
|
|
|
|
|
|
|
GVAR(lastPath) = [];
|
|
|
|
|
|
|
|
GVAR(expanded) = false;
|
|
|
|
|
2016-03-02 10:01:39 +00:00
|
|
|
GVAR(startHoverTime) = diag_tickTime;
|
|
|
|
GVAR(expandedTime) = diag_tickTime;
|
2016-01-12 18:32:26 +00:00
|
|
|
|
|
|
|
// reset on mission load
|
|
|
|
addMissionEventHandler ["Loaded", {
|
|
|
|
GVAR(startHoverTime) = 0;
|
|
|
|
GVAR(expandedTime) = 0;
|
|
|
|
}];
|
|
|
|
|
2015-01-18 18:38:27 +00:00
|
|
|
GVAR(iconCtrls) = [];
|
|
|
|
GVAR(iconCount) = 0;
|
|
|
|
|
2015-05-02 17:37:58 +00:00
|
|
|
GVAR(collectedActionPoints) = [];
|
2015-04-20 04:16:51 +00:00
|
|
|
GVAR(foundActions) = [];
|
|
|
|
GVAR(lastTimeSearchedActions) = -1000;
|
|
|
|
|
2015-06-04 22:11:35 +00:00
|
|
|
// Init zeus menu
|
|
|
|
[] call FUNC(compileMenuZeus);
|
|
|
|
|
2019-08-02 01:52:20 +00:00
|
|
|
// Handle addActionToClass with Inheritance flag set (CAManBase actions are seperated for speed)
|
|
|
|
GVAR(inheritedActionsAll) = [];
|
|
|
|
GVAR(inheritedClassesAll) = [];
|
|
|
|
GVAR(inheritedActionsMan) = [];
|
|
|
|
GVAR(inheritedClassesMan) = [];
|
|
|
|
|
|
|
|
["All", "InitPost", {
|
|
|
|
BEGIN_COUNTER(InitPost);
|
|
|
|
params ["_object"];
|
|
|
|
private _type = typeOf _object;
|
|
|
|
|
|
|
|
if (GVAR(inheritedClassesAll) pushBackUnique _type == -1) exitWith { END_COUNTER(InitPost); };
|
|
|
|
|
|
|
|
{
|
|
|
|
_x params ["_objectType", "_typeNum", "_parentPath", "_action"];
|
|
|
|
if (_object isKindOf _objectType) then {
|
|
|
|
[_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass);
|
|
|
|
};
|
|
|
|
} forEach GVAR(inheritedActionsAll);
|
|
|
|
END_COUNTER(InitPost);
|
|
|
|
}] call CBA_fnc_addClassEventHandler;
|
|
|
|
["CAManBase", "InitPost", {
|
|
|
|
BEGIN_COUNTER(InitPost);
|
|
|
|
params ["_object"];
|
|
|
|
private _type = typeOf _object;
|
|
|
|
|
|
|
|
if (GVAR(inheritedClassesMan) pushBackUnique _type == -1) exitWith { END_COUNTER(InitPost); };
|
|
|
|
{
|
|
|
|
_x params ["_typeNum", "_parentPath", "_action"];
|
|
|
|
[_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass);
|
|
|
|
} forEach GVAR(inheritedActionsMan);
|
|
|
|
END_COUNTER(InitPost);
|
2019-12-07 20:58:44 +00:00
|
|
|
}, true, ["VirtualMan_F"]] call CBA_fnc_addClassEventHandler;
|
2019-08-02 01:52:20 +00:00
|
|
|
|
2015-01-29 07:38:46 +00:00
|
|
|
ADDON = true;
|