mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Use ACRE2 add display passthrough keys API in spectator (#5735)
* Use ACRE2 add display passthrough keys API * Assure backwards compatibility with older ACRE2 versions
This commit is contained in:
parent
18d4b9660d
commit
82f3a57e22
@ -17,6 +17,7 @@ PREP(ui_handleChildDestroyed);
|
||||
PREP(ui_handleKeyDown);
|
||||
PREP(ui_handleKeyUp);
|
||||
PREP(ui_handleListClick);
|
||||
PREP(ui_handleLoad);
|
||||
PREP(ui_handleMapClick);
|
||||
PREP(ui_handleMapDraw);
|
||||
PREP(ui_handleMouseButtonDblClick);
|
||||
|
@ -197,13 +197,4 @@ if ((_key in (actionKeys "CuratorInterface")) && {!isNull (getAssignedCuratorLog
|
||||
true
|
||||
};
|
||||
|
||||
// Handle acre spectate headset down (if present)
|
||||
if (
|
||||
["acre_sys_radio"] call EFUNC(common,isModLoaded) &&
|
||||
{ [_key, [_shift, _ctrl, _alt]] isEqualTo ((["ACRE2", "HeadSet"] call CBA_fnc_getKeybind) select 5) }
|
||||
) exitWith {
|
||||
[] call acre_sys_core_fnc_toggleHeadset;
|
||||
true
|
||||
};
|
||||
|
||||
false // default to unhandled
|
||||
|
25
addons/spectator/functions/fnc_ui_handleLoad.sqf
Normal file
25
addons/spectator/functions/fnc_ui_handleLoad.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Author: SilentSpike, Jonpas
|
||||
* Function used to handle load event.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Spectator display <DISPLAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* _this call ace_spectator_fnc_ui_handleLoad
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
uiNamespace setVariable [QGVAR(display), _display];
|
||||
|
||||
// Handle ACRE2 Toggle Spectator (if present)
|
||||
if (!isNil "acre_api_fnc_addDisplayPassthroughKeys") then {
|
||||
[_display] call acre_api_fnc_addDisplayPassthroughKeys;
|
||||
};
|
@ -18,8 +18,8 @@ class GVAR(display) {
|
||||
enableSimulation = 1;
|
||||
movingEnable = 0;
|
||||
closeOnMissionEnd = 1;
|
||||
|
||||
onLoad = QUOTE(with uiNameSpace do {GVAR(display) = _this select 0};);
|
||||
|
||||
onLoad = QUOTE(_this call FUNC(ui_handleLoad));
|
||||
|
||||
onKeyDown = QUOTE(_this call FUNC(ui_handleKeyDown));
|
||||
onKeyUp = QUOTE(_this call FUNC(ui_handleKeyUp));
|
||||
|
Loading…
Reference in New Issue
Block a user