2015-12-22 07:53:57 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
[QGVAR(deployRopes), {
|
|
|
|
_this call FUNC(deployRopes);
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-12-22 07:53:57 +00:00
|
|
|
|
|
|
|
[QGVAR(startFastRope), {
|
|
|
|
[FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler;
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2016-07-05 08:26:50 +00:00
|
|
|
|
2017-10-14 16:55:48 +00:00
|
|
|
// Keybinds
|
|
|
|
["ACE3 Vehicles", QGVAR(fastRope), localize LSTRING(Interaction_fastRope), {
|
|
|
|
if ((vehicle ACE_player) == ACE_player) exitWith {false};
|
|
|
|
if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false};
|
|
|
|
if ([ACE_player, vehicle ACE_player] call FUNC(canFastRope)) then {
|
|
|
|
[ACE_player, vehicle ACE_player] call FUNC(fastRope);
|
|
|
|
true
|
|
|
|
} else {
|
|
|
|
false
|
|
|
|
};
|
|
|
|
}, ""] call CBA_fnc_addKeybind;
|
|
|
|
|
2016-07-05 08:26:50 +00:00
|
|
|
["ACE3 Vehicles", QGVAR(cutRopes), localize LSTRING(Interaction_cutRopes), {
|
2017-10-14 16:55:48 +00:00
|
|
|
if ((vehicle ACE_player) == ACE_player) exitWith {false};
|
|
|
|
if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false};
|
2016-07-05 08:26:50 +00:00
|
|
|
if ([vehicle ACE_player] call FUNC(canCutRopes)) then {
|
|
|
|
[vehicle ACE_player] call FUNC(cutRopes);
|
|
|
|
true
|
|
|
|
} else {
|
|
|
|
false
|
|
|
|
};
|
|
|
|
}, {false}] call CBA_fnc_addKeybind;
|
2016-11-16 23:42:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef DRAW_FASTROPE_INFO
|
|
|
|
addMissionEventHandler ["Draw3D", {
|
|
|
|
if (!(cursorObject isKindOf "Helicopter")) exitWith {};
|
2021-02-18 18:58:08 +00:00
|
|
|
private _config = configOf cursorObject;
|
2016-11-16 23:42:11 +00:00
|
|
|
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"];
|
|
|
|
if (_enabled > 0) then {
|
|
|
|
{
|
|
|
|
private _hookAttachment = cursorObject getVariable [QGVAR(FRIES), cursorObject];
|
|
|
|
private _ropeOrigin = if (_x isEqualType []) then {_x} else {_hookAttachment selectionPosition _x};
|
|
|
|
drawIcon3D ["", [1,.5,.5,1], (_hookAttachment modelToWorld _ropeOrigin), 0.5, 0.5, 0, format ["Rope: %1", _forEachIndex], 0.5, 0.025, "TahomaB"];
|
|
|
|
} forEach (getArray (_config >> QGVAR(ropeOrigins)));
|
|
|
|
};
|
|
|
|
if (_enabled == 2) then {
|
|
|
|
drawIcon3D ["", [.5,1,.5,1], (cursorObject modelToWorld getArray (_config >> QGVAR(friesAttachmentPoint))), 0.5, 0.5, 0, format ["Fries: %1", getText (_config >> QGVAR(friesType))], 0.5, 0.025, "TahomaB"];
|
|
|
|
};
|
|
|
|
}];
|
|
|
|
#endif
|