2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-06-04 22:11:35 +00:00
|
|
|
/*
|
2023-08-17 10:02:17 +00:00
|
|
|
* Author: kymckay
|
2015-06-04 22:11:35 +00:00
|
|
|
* Compile the zeus action menu (only to be done once)
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-06-04 22:11:35 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-06-04 22:11:35 +00:00
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* call ACE_interact_menu_fnc_compileMenuZeus
|
|
|
|
*
|
2015-06-04 22:11:35 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Exit if the action menu is already compiled for zeus
|
2020-02-11 22:43:08 +00:00
|
|
|
if (!isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {};
|
2015-06-04 22:11:35 +00:00
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _recurseFnc = {
|
2015-08-04 22:46:57 +00:00
|
|
|
params ["_actionsCfg"];
|
2016-01-08 04:43:37 +00:00
|
|
|
private _actions = [];
|
2015-06-04 22:11:35 +00:00
|
|
|
|
|
|
|
{
|
2016-01-08 04:43:37 +00:00
|
|
|
private _entryCfg = _x;
|
2020-02-11 22:43:08 +00:00
|
|
|
if (isClass _entryCfg) then {
|
2016-01-08 04:43:37 +00:00
|
|
|
private _displayName = getText (_entryCfg >> "displayName");
|
2015-06-04 22:11:35 +00:00
|
|
|
|
2018-05-31 15:57:46 +00:00
|
|
|
private _icon = if (isArray (_entryCfg >> "icon")) then {
|
|
|
|
getArray (_entryCfg >> "icon");
|
|
|
|
} else {
|
|
|
|
[getText (_entryCfg >> "icon"), "#FFFFFF"];
|
|
|
|
};
|
2016-01-08 04:43:37 +00:00
|
|
|
private _statement = compile (getText (_entryCfg >> "statement"));
|
2015-06-04 22:11:35 +00:00
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _condition = getText (_entryCfg >> "condition");
|
2020-12-17 20:28:54 +00:00
|
|
|
if (_condition == "") then {
|
|
|
|
_condition = {true};
|
|
|
|
} else {
|
|
|
|
_condition = compile _condition;
|
|
|
|
};
|
2015-06-04 22:11:35 +00:00
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _insertChildren = compile (getText (_entryCfg >> "insertChildren"));
|
|
|
|
private _modifierFunction = compile (getText (_entryCfg >> "modifierFunction"));
|
2015-06-04 22:11:35 +00:00
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
|
|
|
|
private _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
|
|
|
|
private _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
|
|
|
|
private _runOnHover = true;
|
2015-06-04 22:11:35 +00:00
|
|
|
if (isText (_entryCfg >> "runOnHover")) then {
|
|
|
|
_runOnHover = compile getText (_entryCfg >> "runOnHover");
|
|
|
|
} else {
|
|
|
|
_runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
|
|
|
|
};
|
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _children = [_entryCfg] call _recurseFnc;
|
2015-06-04 22:11:35 +00:00
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _entry = [
|
2015-06-04 22:11:35 +00:00
|
|
|
[
|
|
|
|
configName _entryCfg,
|
|
|
|
_displayName,
|
|
|
|
_icon,
|
|
|
|
_statement,
|
|
|
|
_condition,
|
|
|
|
_insertChildren,
|
|
|
|
{},
|
|
|
|
[0,0,0],
|
|
|
|
10, //distace
|
2016-01-08 04:43:37 +00:00
|
|
|
[_showDisabled,_enableInside,_canCollapse,_runOnHover,false],
|
2015-06-04 22:11:35 +00:00
|
|
|
_modifierFunction
|
|
|
|
],
|
|
|
|
_children
|
|
|
|
];
|
|
|
|
_actions pushBack _entry;
|
|
|
|
};
|
|
|
|
} forEach (configProperties [_actionsCfg, "isClass _x", true]);
|
|
|
|
_actions
|
|
|
|
};
|
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _actionsCfg = configFile >> "ACE_ZeusActions";
|
2015-06-04 22:11:35 +00:00
|
|
|
|
|
|
|
// Create a master action to base zeus actions on
|
|
|
|
GVAR(ZeusActions) = [
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"ACE_ZeusActions",
|
|
|
|
localize LSTRING(ZeusActionsRoot),
|
|
|
|
"\A3\Ui_F_Curator\Data\Logos\arma3_zeus_icon_ca.paa",
|
|
|
|
{true},
|
|
|
|
{true},
|
|
|
|
{},
|
|
|
|
{},
|
|
|
|
{[0,0,0]},
|
|
|
|
10,
|
2016-01-08 04:43:37 +00:00
|
|
|
[false,true,false,false,false]
|
2015-06-04 22:11:35 +00:00
|
|
|
],
|
|
|
|
[_actionsCfg] call _recurseFnc
|
|
|
|
]
|
|
|
|
];
|