Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastroping - Allow FRIES functionality for Planes #10449

Merged
merged 6 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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