ACE3/addons/concertina_wire/functions/fnc_dismount.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

41 lines
945 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Ruthberg
*
* Start dismounting the concertina wire
*
* Arguments:
* 0: wire <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [wire, bob] call ace_concertina_wire_fnc_dismount
*
* Public: No
*/
// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine
if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitWith {
[{
_this call FUNC(dismount);
}, _this] call CBA_fnc_execNextFrame;
};
params ["_wire", "_unit"];
private _config = (configOf _unit);
private _delay = [45, 30] select ([_unit] call EFUNC(common,isEngineer) || {[_unit] call EFUNC(common,isEOD)});
// TODO: Animation?
[
_delay,
[_wire],
{(_this select 0) call FUNC(dismountSuccess)},
{},
LLSTRING(UnrollWire),
{true},
["isnotinside"]
] call EFUNC(common,progressBar);