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-16 21:41:10 +00:00
|
|
|
TRACE_1("switchUnit",_this);
|
|
|
|
params ["_currentUnit", "_lastUnit"];
|
2024-01-08 21:22:52 +00:00
|
|
|
|
2024-01-15 22:05:58 +00:00
|
|
|
if (isNull _currentUnit || {_lastUnit isEqualTo _currentUnit}) exitWith {};
|
2024-01-15 19:13:59 +00:00
|
|
|
if (!local _currentUnit) exitWith {
|
|
|
|
[
|
|
|
|
{local _currentUnit},
|
|
|
|
FUNC(dev_switchUnitHandle),
|
|
|
|
_this,
|
|
|
|
5
|
|
|
|
] call CBA_fnc_waitUntilAndExecute;
|
|
|
|
};
|
2024-01-08 21:22:52 +00:00
|
|
|
|
2024-01-15 22:32:43 +00:00
|
|
|
private _actionID = missionNamespace getVariable [QGVAR(dev_clearTraceAction), -1];
|
|
|
|
if (_actionID > -1 && {!isNull _lastUnit}) then {
|
|
|
|
_lastUnit removeAction _actionID;
|
2024-01-08 21:22:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-15 22:32:43 +00:00
|
|
|
_actionID = _currentUnit addAction [
|
2024-01-08 21:22:52 +00:00
|
|
|
"Reset Lines",
|
2024-01-16 21:41:10 +00:00
|
|
|
{
|
|
|
|
remoteExecCall [QFUNC(dev_clearTraces), 2];
|
|
|
|
},
|
2024-01-15 21:18:42 +00:00
|
|
|
nil,
|
|
|
|
1.5,
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
"",
|
|
|
|
"true",
|
2024-01-13 06:35:22 +00:00
|
|
|
8
|
2024-01-08 21:22:52 +00:00
|
|
|
];
|
|
|
|
|
2024-01-16 21:41:10 +00:00
|
|
|
missionNamespace setVariable [QGVAR(dev_clearTraceAction), _actionID];
|