2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2020-06-19 15:35:57 +00:00
|
|
|
/*
|
|
|
|
* Author: joko // Jonas
|
|
|
|
* Binds Draw EventHandlers to Spectator map.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Map Handle from a spectator gui <CONTROL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* _mapCtrl call ace_map_gestures_fnc_initDisplaySpectator
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
params ["_mapCtrl"];
|
|
|
|
TRACE_1("initDisplaySpectator",_mapCtrl);
|
|
|
|
|
|
|
|
_mapCtrl ctrlAddEventHandler ["Draw", {
|
2020-08-18 17:44:16 +00:00
|
|
|
if (!GVAR(allowSpectator)) exitWith {};
|
|
|
|
private _targets = [[positionCameraToWorld [0, 0, 0], GVAR(maxRangeCamera)]];
|
2020-06-19 15:35:57 +00:00
|
|
|
|
|
|
|
private _aceSpectatorFocus = missionNamespace getVariable [QEGVAR(spectator,camFocus), objNull];
|
|
|
|
if (!isNull _aceSpectatorFocus) then {
|
2020-08-18 17:44:16 +00:00
|
|
|
_targets pushback [_aceSpectatorFocus, GVAR(maxRange)];
|
2020-06-19 15:35:57 +00:00
|
|
|
};
|
|
|
|
private _vanillaSpectatorFocus = uiNamespace getVariable ["RscEGSpectator_focus", objNull];
|
|
|
|
if (!isNull _vanillaSpectatorFocus) then {
|
2020-08-18 17:44:16 +00:00
|
|
|
_targets pushback [_vanillaSpectatorFocus, GVAR(maxRange)];
|
2020-06-19 15:35:57 +00:00
|
|
|
};
|
|
|
|
[_this select 0, _targets] call FUNC(drawMapGestures);
|
|
|
|
}];
|