From 545c16eab331dd30f84bb35fc5d60e0af8c56464 Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Fri, 25 Jan 2019 09:36:19 +0100 Subject: [PATCH] Move zeus SelfActions to config --- addons/zeus/CfgVehicles.hpp | 31 +++++++++++++++++++++++++++++++ addons/zeus/XEH_postInit.sqf | 32 -------------------------------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 74095cb4a2d..77b4a6a1afb 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -317,4 +317,35 @@ class CfgVehicles { class ModuleArsenal_F: Module_F { function=QFUNC(bi_moduleArsenal); }; + + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class GVAR(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 GVAR(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"; + }; + }; + }; }; diff --git a/addons/zeus/XEH_postInit.sqf b/addons/zeus/XEH_postInit.sqf index 85527f0ab26..6de64b6d999 100644 --- a/addons/zeus/XEH_postInit.sqf +++ b/addons/zeus/XEH_postInit.sqf @@ -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); };