2024-01-11 20:01:50 +00:00
|
|
|
#include "..\script_component.hpp"
|
2024-01-08 21:22:52 +00:00
|
|
|
/*
|
|
|
|
* Author: Lambda.Tiger
|
2024-01-13 06:35:22 +00:00
|
|
|
* Handle for debug actions when switching units
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Last unit <OBJECT>
|
|
|
|
* 1: Current unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [unit0, player] call ace_frag_fnc_dev_switchUnitHandle;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2024-01-15 19:13:59 +00:00
|
|
|
params ["_lastUnit", "_currentUnit"];
|
2024-01-08 21:22:52 +00:00
|
|
|
|
|
|
|
|
2024-01-15 19:13:59 +00:00
|
|
|
if (_currentUnit isEqualTo objNull || {_lastUnit isEqualTo _currentUnit}) exitWith {};
|
|
|
|
if (!local _currentUnit) exitWith {
|
|
|
|
[
|
|
|
|
{local _currentUnit},
|
|
|
|
FUNC(dev_switchUnitHandle),
|
|
|
|
_this,
|
|
|
|
5
|
|
|
|
] call CBA_fnc_waitUntilAndExecute;
|
|
|
|
};
|
2024-01-08 21:22:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
private _aID = missionNamespace getVariable [QGVAR(dev_clearTraceAction), -1];
|
2024-01-15 19:13:59 +00:00
|
|
|
if (_aID > -1 && {_lastUnit isNotEqualTo objNull}) then {
|
|
|
|
_lastUnit removeAction _aID;
|
2024-01-08 21:22:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-15 19:13:59 +00:00
|
|
|
_aID = _currentUnit addAction [
|
2024-01-08 21:22:52 +00:00
|
|
|
"Reset Lines",
|
|
|
|
FUNC(dev_clearTraces),
|
2024-01-11 00:51:38 +00:00
|
|
|
nil, // arguments
|
|
|
|
1.5, // priority
|
|
|
|
true, // showWindow
|
|
|
|
false, // hideOnUse
|
|
|
|
"", // shortcut
|
|
|
|
"true", // condition
|
2024-01-13 06:35:22 +00:00
|
|
|
8
|
2024-01-08 21:22:52 +00:00
|
|
|
];
|
|
|
|
|
2024-01-15 19:13:59 +00:00
|
|
|
missionNamespace getVariable [QGVAR(dev_clearTraceAction), _aID];
|