mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
21b0ee087a
A public API system to allow external systems to interrupt and resume the spectator interface. Also made use of it for the escape menu and zeus support.
45 lines
971 B
Plaintext
45 lines
971 B
Plaintext
/*
|
|
* Author: SilentSpike
|
|
* Interrupts the spectator interface for external systems
|
|
*
|
|
* Arguments:
|
|
* 0: Reason <STRING>
|
|
* 1: Interrupting <BOOL>
|
|
*
|
|
* Return Value:
|
|
* None <NIL>
|
|
*
|
|
* Example:
|
|
* ["mySystem"] call ace_spectator_fnc_interrupt
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params [["_reason", "", [""]], ["_interrupt", true, [true]]];
|
|
|
|
// Nothing to do when spectator is closed
|
|
if !(GVAR(isSet)) exitWith {};
|
|
|
|
if (_reason == "") exitWith { ERROR("Invalid Reason"); };
|
|
if (_interrupt) then {
|
|
GVAR(interrupts) pushBack _reason;
|
|
} else {
|
|
GVAR(interrupts) = GVAR(interrupts) - [_reason];
|
|
};
|
|
|
|
if (GVAR(interrupts) isEqualTo []) then {
|
|
if (isNull (findDisplay 12249)) then {
|
|
createDialog QGVAR(interface);
|
|
[] call FUNC(transitionCamera);
|
|
};
|
|
} else {
|
|
if !(isNull (findDisplay 12249)) then {
|
|
while {dialog} do {
|
|
closeDialog 0;
|
|
};
|
|
|
|
(findDisplay 12249) closeDisplay 0;
|
|
};
|
|
};
|