2015-08-21 23:26:01 +00:00
|
|
|
/*
|
|
|
|
* Author: SilentSpike
|
|
|
|
* Interrupts the spectator interface for external systems
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Reason <STRING>
|
2015-10-04 17:30:07 +00:00
|
|
|
* 1: Interrupting <BOOL> (default: true)
|
2015-08-21 23:26:01 +00:00
|
|
|
*
|
|
|
|
* 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 {
|
2016-01-13 18:28:36 +00:00
|
|
|
if (isNull (GETUVAR(GVAR(interface),displayNull))) then {
|
|
|
|
(findDisplay 46) createDisplay QGVAR(interface);
|
2015-08-21 23:26:01 +00:00
|
|
|
[] call FUNC(transitionCamera);
|
|
|
|
};
|
|
|
|
} else {
|
2016-01-13 18:28:36 +00:00
|
|
|
if !(isNull (GETUVAR(GVAR(interface),displayNull))) then {
|
2015-08-21 23:26:01 +00:00
|
|
|
while {dialog} do {
|
|
|
|
closeDialog 0;
|
|
|
|
};
|
|
|
|
|
2016-01-13 18:28:36 +00:00
|
|
|
(GETUVAR(GVAR(interface),displayNull)) closeDisplay 0;
|
2015-08-21 23:26:01 +00:00
|
|
|
};
|
|
|
|
};
|