diff --git a/addons/frag/XEH_PREP.hpp b/addons/frag/XEH_PREP.hpp index f87756ea13..5402c89e23 100644 --- a/addons/frag/XEH_PREP.hpp +++ b/addons/frag/XEH_PREP.hpp @@ -8,7 +8,6 @@ PREP(dev_fragCalcDump); PREP(dev_trackHitBox); PREP(dev_trackObj); PREP(dev_sphereDraw); -PREP(dev_switchUnitHandle); PREP(doExplosions); PREP(doFrag); PREP(doFragRandom); diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index b6afbf66ed..6209f17e0e 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -15,10 +15,28 @@ 0 ] call CBA_fnc_addPerFrameHandler; [ - "unit", - LINKFUNC(dev_switchUnitHandle), - true - ] call CBA_fnc_addPlayerEventHandler; + "ace_interact_menu_newControllableObject", + { + params ["_type"]; + + private _action = [ + QGVAR(debugReset), + "Reset ACE Frag traces", + "", + { + remoteExecCall [QFUNC(dev_clearTraces), 2]; + }, + {true} + ] call EFUNC(interact_menu,createAction); + [ + _type, + 1, + ["ACE_SelfActions"], + _action, + true + ] call ace_interact_menu_fnc_addActionToClass; + } + ] call CBA_fnc_addEventHandler; }; #endif } diff --git a/addons/frag/functions/fnc_dev_switchUnitHandle.sqf b/addons/frag/functions/fnc_dev_switchUnitHandle.sqf deleted file mode 100644 index 16f7ab5530..0000000000 --- a/addons/frag/functions/fnc_dev_switchUnitHandle.sqf +++ /dev/null @@ -1,51 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Lambda.Tiger - * Handle for debug actions when switching units - * - * Arguments: - * 0: Last unit - * 1: Current unit - * - * Return Value: - * None - * - * Example: - * [unit0, player] call ace_frag_fnc_dev_switchUnitHandle; - * - * Public: No - */ - -TRACE_1("switchUnit",_this); -params ["_currentUnit", "_lastUnit"]; - -if (isNull _currentUnit || {_lastUnit isEqualTo _currentUnit}) exitWith {}; -if (!local _currentUnit) exitWith { - [ - {local _currentUnit}, - FUNC(dev_switchUnitHandle), - _this, - 5 - ] call CBA_fnc_waitUntilAndExecute; -}; - -private _actionID = missionNamespace getVariable [QGVAR(dev_clearTraceAction), -1]; -if (_actionID > -1 && {!isNull _lastUnit}) then { - _lastUnit removeAction _actionID; -}; - -_actionID = _currentUnit addAction [ - "Reset Lines", - { - remoteExecCall [QFUNC(dev_clearTraces), 2]; - }, - nil, - 1.5, - true, - false, - "", - "true", - 8 -]; - -missionNamespace setVariable [QGVAR(dev_clearTraceAction), _actionID];