Skip to content

Commit

Permalink
Fastroping - Allow FRIES functionality for Planes (#10449)
Browse files Browse the repository at this point in the history
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
  • Loading branch information
altar-of-needles and johnb432 authored Nov 2, 2024
1 parent ff05b9b commit 7376307
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 68 deletions.
132 changes: 69 additions & 63 deletions addons/fastroping/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions addons/fastroping/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"];
Expand Down
4 changes: 2 additions & 2 deletions addons/fastroping/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion addons/fastroping/functions/fnc_deployAI.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7376307

Please sign in to comment.