ACE3/addons/concertina_wire/functions/fnc_dismount.sqf

41 lines
942 B
Plaintext
Raw Normal View History

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