mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Spectator - Add display loaded and unloaded events (#7720)
This commit is contained in:
parent
eaa23cc84f
commit
7746dbcc75
@ -19,6 +19,8 @@ params ["_display"];
|
||||
|
||||
uiNamespace setVariable [QGVAR(display), _display];
|
||||
|
||||
[QGVAR(displayLoaded), _display] call CBA_fnc_localEvent;
|
||||
|
||||
// Handle ACRE2 Toggle Spectator (if present)
|
||||
if (!isNil "acre_api_fnc_addDisplayPassthroughKeys") then {
|
||||
[_display] call acre_api_fnc_addDisplayPassthroughKeys;
|
||||
|
20
addons/spectator/functions/fnc_ui_handleUnload.sqf
Normal file
20
addons/spectator/functions/fnc_ui_handleUnload.sqf
Normal file
@ -0,0 +1,20 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: mharis001
|
||||
* Function used to handle unload event.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Spectator display <DISPLAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* _this call ace_spectator_fnc_ui_handleUnload
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_display"];
|
||||
|
||||
[QGVAR(displayUnloaded), _display] call CBA_fnc_localEvent;
|
@ -20,6 +20,7 @@ class GVAR(display) {
|
||||
closeOnMissionEnd = 1;
|
||||
|
||||
onLoad = QUOTE(_this call FUNC(ui_handleLoad));
|
||||
onUnload = QUOTE(_this call FUNC(ui_handleUnload));
|
||||
|
||||
onKeyDown = QUOTE(_this call FUNC(ui_handleKeyDown));
|
||||
onKeyUp = QUOTE(_this call FUNC(ui_handleKeyUp));
|
||||
|
@ -51,6 +51,8 @@ Note that these settings govern the default spectator behaviour. Through the use
|
||||
Event Name | Passed Parameter(s) | Locality | Description
|
||||
---------- | ----------- | ------------------- | --------
|
||||
`ace_spectatorSet` | [_isSpectator, _player] | Global | Player's spectator status was changed
|
||||
`ace_spectator_displayLoaded` | _display | Local | Spectator display was loaded
|
||||
`ace_spectator_displayUnloaded` | _display | Local | Spectator display was unloaded
|
||||
|
||||
## 4. Scripting
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user