2015-06-29 02:34:21 +00:00
|
|
|
#include "script_component.hpp"
|
2015-07-04 23:07:51 +00:00
|
|
|
|
2016-06-03 00:59:18 +00:00
|
|
|
["ace_settingsInitialized", {
|
2015-07-21 12:31:13 +00:00
|
|
|
GVAR(availableModes) = [[0,1,2], [1,2], [0], [1], [2]] select GVAR(restrictModes);
|
|
|
|
GVAR(availableVisions) = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select GVAR(restrictVisions);
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-10-04 15:08:42 +00:00
|
|
|
|
2015-11-22 20:03:10 +00:00
|
|
|
if (isServer) then {
|
2017-08-12 13:25:48 +00:00
|
|
|
// Create a radio channel for any spectators to text chat in
|
2015-11-22 20:03:10 +00:00
|
|
|
GVAR(channel) = radioChannelCreate [[0.729,0.149,0.098,1],"Spectator","Spectator (%UNIT_NAME)",[]];
|
|
|
|
publicVariable QGVAR(channel);
|
|
|
|
|
2017-08-12 13:25:48 +00:00
|
|
|
// Used by the template to transfer zeus to virtual unit
|
|
|
|
// Commands must be ran on server
|
|
|
|
[QGVAR(transferZeus),{
|
|
|
|
unassignCurator (_this select 1);
|
2016-05-07 20:17:21 +00:00
|
|
|
|
2017-08-12 13:25:48 +00:00
|
|
|
// Can only re-assign when ready
|
|
|
|
[
|
|
|
|
{isNull getAssignedCuratorUnit (_this select 0)},
|
|
|
|
{(_this select 0) assignCurator (_this select 1)},
|
|
|
|
_this
|
|
|
|
] call CBA_fnc_waitUntilAndExecute;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
};
|
2016-05-21 17:59:44 +00:00
|
|
|
|
2016-06-03 00:29:30 +00:00
|
|
|
[QGVAR(stageSpectator), FUNC(stageSpectator)] call CBA_fnc_addEventHandler;
|
2017-08-12 13:25:48 +00:00
|
|
|
|
|
|
|
// Delay until local player (must not be ACE_Player) is fully initalized
|
|
|
|
[
|
|
|
|
{ !isNil { player } && { !isNull player } },
|
|
|
|
{
|
|
|
|
// Initalise virtual spectator players (must not be ACE_Player)
|
|
|
|
[QGVAR(virtual),"initpost",{
|
|
|
|
if !(GVAR(isSet)) then {
|
|
|
|
if (player == (_this select 0)) then { [true] call FUNC(setSpectator) };
|
|
|
|
};
|
|
|
|
},false,[],true] call CBA_fnc_addClassEventHandler;
|
|
|
|
},[]
|
|
|
|
] call CBA_fnc_waitUntilAndExecute;
|