Skip to content

Commit

Permalink
Move zeus SelfActions to config
Browse files Browse the repository at this point in the history
  • Loading branch information
dedmen committed Jan 25, 2019
1 parent 5f4dd9d commit 11cdc5b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 32 deletions.
31 changes: 31 additions & 0 deletions addons/zeus/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,35 @@ class CfgVehicles {
class ModuleArsenal_F: Module_F {
function=QFUNC(bi_moduleArsenal);
};

class Man;
class CAManBase: Man {
class ACE_SelfActions {
class QGVAR(create) {
displayName = CSTRING(CreateZeus);
condition = QUOTE(\
isNil QQGVAR(zeus) && {\
switch (GVAR(canCreateZeus)) do {\
case CAN_CREATE_ADMIN: {isServer || {IS_ADMIN_LOGGED}};\
case CAN_CREATE_CONSOLE: {call BIS_fnc_isDebugConsoleAllowed};\
case CAN_CREATE_ALL: {true};\
default {false};\
}\
});
exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"};
//Set GVAR(zeus) to null first to disable the action through the isNil check
statement = QUOTE(GVAR(zeus) = objNull; [ARR_2(QQGVAR(createZeus), ACE_player)] call CBA_fnc_serverEvent);
showDisabled = 1;
icon = "\A3\Ui_F_Curator\Data\Logos\arma3_curator_eye_32_ca.paa";
};
class QGVAR(delete) {
displayName = CSTRING(DeleteZeus);
condition = QUOTE(!(isNil QQGVAR(zeus) || {isNull GVAR(zeus)}));
exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting", "isNotOnLadder", "isNotRefueling"};
statement = QUOTE(deleteVehicle GVAR(zeus); GVAR(zeus) = nil);
showDisabled = 1;
icon = "\A3\Ui_F_Curator\Data\Logos\arma3_curator_eye_32_ca.paa";
};
};
};
};
32 changes: 0 additions & 32 deletions addons/zeus/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -81,36 +81,4 @@ if (hasInterface) then {
GVAR(zeus) = _zeus;
[localize "str_a3_cfgvehicles_moduletasksetstate_f_arguments_state_values_created_0"] call EFUNC(common,displayTextStructured);
}] call CBA_fnc_addEventHandler;

private _action = [
QGVAR(create),
LLSTRING(CreateZeus),
"\A3\Ui_F_Curator\Data\Logos\arma3_curator_eye_32_ca.paa",
{
GVAR(zeus) = objNull; // to disable menu while zeus is being created
[QGVAR(createZeus), ACE_player] call CBA_fnc_serverEvent;
},
{
switch (GVAR(canCreateZeus)) do {
case CAN_CREATE_ADMIN: {isServer || {IS_ADMIN_LOGGED}};
case CAN_CREATE_CONSOLE: {call BIS_fnc_isDebugConsoleAllowed};
case CAN_CREATE_ALL: {true};
default {false};
}
&& {isNil QGVAR(zeus)}
}
] call EFUNC(interact_menu,createAction);
["CAManBase", 1, ["ACE_SelfActions"], _action, true] call EFUNC(interact_menu,addActionToClass);

_action = [
QGVAR(delete),
LLSTRING(DeleteZeus),
"\A3\Ui_F_Curator\Data\Logos\arma3_curator_eye_32_ca.paa",
{
deleteVehicle GVAR(zeus);
GVAR(zeus) = nil;
},
{!(isNil QGVAR(zeus) || {isNull GVAR(zeus)})}
] call EFUNC(interact_menu,createAction);
["CAManBase", 1, ["ACE_SelfActions"], _action, true] call EFUNC(interact_menu,addActionToClass);
};

0 comments on commit 11cdc5b

Please sign in to comment.