diff --git a/addons/fastroping/CfgVehicles.hpp b/addons/fastroping/CfgVehicles.hpp index ef2483e05b9..da49ff93aef 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -1,3 +1,68 @@ +#define MACRO_FRIES_SELFACTIONS \ + class ACE_SelfActions { \ + class ACE_prepareFRIES { \ + displayName = CSTRING(Interaction_prepareFRIES); \ + condition = QUOTE([_target] call FUNC(canPrepareFRIES)); \ + statement = QUOTE([_target] call FUNC(prepareFRIES)); \ + }; \ + class ACE_stowFRIES { \ + displayName = CSTRING(Interaction_stowFRIES); \ + condition = QUOTE([_target] call FUNC(canStowFRIES)); \ + statement = QUOTE([_target] call FUNC(stowFRIES)); \ + }; \ + class ACE_deployRopes3 { \ + displayName = CSTRING(Interaction_deployRopes3); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope3')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope3')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes6 { \ + displayName = CSTRING(Interaction_deployRopes6); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope6')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope6')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes12 { \ + displayName = CSTRING(Interaction_deployRopes12); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope12')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope12')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes15 { \ + displayName = CSTRING(Interaction_deployRopes15); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope15')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope15')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes18 { \ + displayName = CSTRING(Interaction_deployRopes18); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope18')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope18')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes27 { \ + displayName = CSTRING(Interaction_deployRopes27); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope27')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope27')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes36 { \ + displayName = CSTRING(Interaction_deployRopes36); \ + condition = QUOTE([ARR_4(_target,_player,'ACE_rope36',true)] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope36')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_cutRopes { \ + displayName = CSTRING(Interaction_cutRopes); \ + condition = QUOTE([_target] call FUNC(canCutRopes)); \ + statement = QUOTE(true); \ + class confirmCutRopes { \ + displayName = ECSTRING(common,confirm); \ + condition = QUOTE([_target] call FUNC(canCutRopes)); \ + statement = QUOTE([_target] call FUNC(cutRopes)); \ + }; \ + }; \ + class ACE_fastRope { \ + displayName = CSTRING(Interaction_fastRope); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canFastRope)); \ + statement = QUOTE([ARR_2(_player,_target)] call FUNC(fastRope)); \ + }; \ + } + + class CfgVehicles { class Logic; class Module_F: Logic { @@ -24,69 +89,10 @@ class CfgVehicles { class Air; class Helicopter: Air { - class ACE_SelfActions { - class ACE_prepareFRIES { - displayName = CSTRING(Interaction_prepareFRIES); - condition = QUOTE([_target] call FUNC(canPrepareFRIES)); - statement = QUOTE([_target] call FUNC(prepareFRIES)); - }; - class ACE_stowFRIES { - displayName = CSTRING(Interaction_stowFRIES); - condition = QUOTE([_target] call FUNC(canStowFRIES)); - statement = QUOTE([_target] call FUNC(stowFRIES)); - }; - class ACE_deployRopes3 { - displayName = CSTRING(Interaction_deployRopes3); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope3')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope3')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes6 { - displayName = CSTRING(Interaction_deployRopes6); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope6')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope6')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes12 { - displayName = CSTRING(Interaction_deployRopes12); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope12')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope12')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes15 { - displayName = CSTRING(Interaction_deployRopes15); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope15')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope15')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes18 { - displayName = CSTRING(Interaction_deployRopes18); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope18')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope18')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes27 { - displayName = CSTRING(Interaction_deployRopes27); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope27')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope27')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes36 { - displayName = CSTRING(Interaction_deployRopes36); - condition = QUOTE([ARR_4(_target,_player,'ACE_rope36',true)] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope36')])] call CBA_fnc_serverEvent); - }; - class ACE_cutRopes { - displayName = CSTRING(Interaction_cutRopes); - condition = QUOTE([_target] call FUNC(canCutRopes)); - // should not be empty to work with EGVAR(interact_menu,consolidateSingleChild) setting - statement = QUOTE(true); - class confirmCutRopes { - displayName = ECSTRING(common,confirm); - condition = QUOTE([_target] call FUNC(canCutRopes)); - statement = QUOTE([_target] call FUNC(cutRopes)); - }; - }; - class ACE_fastRope { - displayName = CSTRING(Interaction_fastRope); - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canFastRope)); - statement = QUOTE([ARR_2(_player,_target)] call FUNC(fastRope)); - }; - }; + MACRO_FRIES_SELFACTIONS; + }; + class Plane: Air { + MACRO_FRIES_SELFACTIONS; }; class Helicopter_Base_F; diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index c28fb065179..2e6da10a2ab 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -31,7 +31,7 @@ if (isServer) then { - ["Helicopter", "init", { + ["Air", "init", { if (!GVAR(autoAddFRIES)) exitWith {}; params ["_vehicle"]; if (isNumber (configOf _vehicle >> QGVAR(enabled)) && {isNil {_vehicle getVariable [QGVAR(FRIES), nil]}}) then { @@ -51,7 +51,7 @@ if (isServer) then { #ifdef DRAW_FASTROPE_INFO addMissionEventHandler ["Draw3D", { - if !(cursorObject isKindOf "Helicopter") exitWith {}; + if !(cursorObject isKindOf "Air") exitWith {}; private _config = configOf cursorObject; private _enabled = getNumber (_config >> QGVAR(enabled)); drawIcon3D ["", [.5,.5,1,1], (ASLToAGL getPosASL cursorObject), 0.5, 0.5, 0, format ["%1 = %2", typeOf cursorObject, _enabled], 0.5, 0.025, "TahomaB"]; diff --git a/addons/fastroping/XEH_preInit.sqf b/addons/fastroping/XEH_preInit.sqf index b7502751676..fc06833d192 100644 --- a/addons/fastroping/XEH_preInit.sqf +++ b/addons/fastroping/XEH_preInit.sqf @@ -9,9 +9,9 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" if (isServer) then { - ["Helicopter", "Deleted", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; + ["Air", "Deleted", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; }; -["Helicopter", "Killed", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; +["Air", "Killed", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; ADDON = true; diff --git a/addons/fastroping/functions/fnc_deployAI.sqf b/addons/fastroping/functions/fnc_deployAI.sqf index 01aa363afb5..fd566f9bfd2 100644 --- a/addons/fastroping/functions/fnc_deployAI.sqf +++ b/addons/fastroping/functions/fnc_deployAI.sqf @@ -18,7 +18,7 @@ */ params [["_vehicle", objNull, [objNull]], ["_deploySpecial", false, [true]], ["_createDeploymentGroup", true, [true]]]; -if (isNull _vehicle || {!(_vehicle isKindOf "Helicopter")}) exitWith { +if (isNull _vehicle || {!(_vehicle isKindOf "Air")}) exitWith { if (hasInterface) then { // Note: BIS_fnc_guiMessage causes a CTD with call, so spawn is used instead. ["deployAI was called with an invalid or non-existant vehicle.", QFUNC(deployAI)] spawn BIS_fnc_guiMessage;