Clear spectator display variable at preInit

uiNamespace persists between missions and should be reset on mission start
This commit is contained in:
SilentSpike 2015-08-02 12:34:35 +01:00
parent 612aa2d679
commit 38e08d513a
2 changed files with 4 additions and 6 deletions

View File

@ -38,6 +38,8 @@ GVAR(camUnit) = objNull;
GVAR(camVision) = -2; GVAR(camVision) = -2;
GVAR(camZoom) = 1.25; GVAR(camZoom) = 1.25;
SETUVAR(GVAR(display),nil);
GVAR(showComp) = true; GVAR(showComp) = true;
GVAR(showHelp) = true; GVAR(showHelp) = true;
GVAR(showIcons) = true; GVAR(showIcons) = true;

View File

@ -95,9 +95,7 @@ switch (toLower _mode) do {
case "onload": { case "onload": {
_args params ["_display"]; _args params ["_display"];
with uiNamespace do { SETUVAR(GVAR(display),_display);
GVAR(display) = _display;
};
// Always show interface and hide map upon opening // Always show interface and hide map upon opening
[_display,nil,nil,!GVAR(showInterface),GVAR(showMap)] call FUNC(toggleInterface); [_display,nil,nil,!GVAR(showInterface),GVAR(showMap)] call FUNC(toggleInterface);
@ -151,9 +149,7 @@ switch (toLower _mode) do {
//_display displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; //_display displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}];
}; };
case "onunload": { case "onunload": {
with uiNamespace do { SETUVAR(GVAR(display),nil);
GVAR(display) = nil;
};
GVAR(camHandler) = nil; GVAR(camHandler) = nil;
GVAR(compHandler) = nil; GVAR(compHandler) = nil;