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
|
|
|
*
|
|
|
|
* Public: No
|
2015-06-04 15:51:04 +00:00
|
|
|
*/
|
2015-06-04 15:11:09 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
private ["_config", "_delay"];
|
|
|
|
_config = (configFile >> "CfgVehicles" >> typeOf _unit);
|
|
|
|
_delay = if (getNumber(_config >> "engineer") == 1 || getNumber(_config >> "canDeactivateMines") == 1) then {60} else {120};
|
|
|
|
|
|
|
|
// TODO: Animation?
|
|
|
|
|
|
|
|
[
|
|
|
|
_delay,
|
|
|
|
[_wire],
|
|
|
|
{(_this select 0) call FUNC(dismountSuccess)},
|
|
|
|
{},
|
|
|
|
localize "STR_ACE_UNROLLWIRE",
|
|
|
|
{true},
|
|
|
|
["isnotinside"]
|
|
|
|
] call EFUNC(common,progressBar);
|