Skip to content

Commit

Permalink
Use different events for screen hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
DMagic1 committed Oct 24, 2016
1 parent aa53eab commit 23ec754
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions SCANsat/SCANcontroller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,8 @@ private void Start()
finishRegistration(id);
}

GameEvents.onShowUI.Add(UIOn);
GameEvents.onHideUI.Add(UIOff);
GameEvents.onShowUI.Add(UIShow);
GameEvents.onHideUI.Add(UIHide);
GameEvents.onGUIMissionControlSpawn.Add(UIOff);
GameEvents.onGUIMissionControlDespawn.Add(UIOn);
GameEvents.onGUIRnDComplexSpawn.Add(UIOff);
Expand Down Expand Up @@ -1182,6 +1182,18 @@ private void UIOff()
showUI = false;
}

private void UIShow()
{
if (HighLogic.LoadedSceneIsFlight)
showUI = true;
}

private void UIHide()
{
if (HighLogic.LoadedSceneIsFlight)
showUI = false;
}

internal void loadPQS(CelestialBody b, mapSource s = mapSource.Data)
{
if (!SCANmainMenuLoader.KopernicusLoaded)
Expand Down

0 comments on commit 23ec754

Please sign in to comment.