2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-06-04 15:51:04 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
*
|
2017-06-08 13:31:51 +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:51:04 +00:00
|
|
|
*/
|
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);
|
2016-05-22 13:27:24 +00:00
|
|
|
}, _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
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _config = (configFile >> "CfgVehicles" >> typeOf _unit);
|
2017-01-13 19:43:54 +00:00
|
|
|
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);
|