ACE3/addons/spectator/XEH_preInit.sqf
SilentSpike 65e981373b Store spectator display in a uiNamespace variable
This allows me to explicitly close the right display and hopefully fix the interface staying open upon mission end.

@Commy2's theory is that perhaps the main display `46` is killed upon mission end, meaning that `findDisplay` can't find the spectator display to close it because the game thinks it doesn't exist.
2016-01-13 18:38:51 +00:00

64 lines
1.3 KiB
Plaintext

#include "script_component.hpp"
ADDON = false;
PREP(cacheUnitInfo);
PREP(cycleCamera);
PREP(handleCamera);
PREP(handleCompass);
PREP(handleIcons);
PREP(handleInterface);
PREP(handleMap);
PREP(handleMouse);
PREP(handleToolbar);
PREP(handleUnits);
PREP(interrupt);
PREP(moduleSpectatorSettings);
PREP(respawnTemplate);
PREP(setCameraAttributes);
PREP(setSpectator);
PREP(stageSpectator);
PREP(transitionCamera);
PREP(toggleInterface);
PREP(updateCameraModes);
PREP(updateSpectatableSides);
PREP(updateUnits);
PREP(updateVisionModes);
// Reset the stored display
SETUVAR(GVAR(interface),displayNull);
// Permanent variables
GVAR(availableModes) = [0,1,2];
GVAR(availableSides) = [west,east,resistance,civilian];
GVAR(availableVisions) = [-2,-1,0,1];
GVAR(camAgent) = objNull;
GVAR(camDistance) = 10;
GVAR(camMode) = 0;
GVAR(camPan) = 0;
GVAR(camPos) = ATLtoASL [worldSize * 0.5, worldSize * 0.5, 20];
GVAR(camSpeed) = 1.5;
GVAR(camTilt) = -10;
GVAR(camUnit) = objNull;
GVAR(camVision) = -2;
GVAR(camZoom) = 1.25;
GVAR(interrupts) = [];
GVAR(isSet) = false;
GVAR(showComp) = true;
GVAR(showHelp) = true;
GVAR(showIcons) = true;
GVAR(showInterface) = true;
GVAR(showMap) = false;
GVAR(showTool) = true;
GVAR(showUnit) = true;
GVAR(unitList) = [];
GVAR(unitBlacklist) = [];
GVAR(unitWhitelist) = [];
GVAR(groupList) = [];
ADDON = true;