Always call close on the old screen before opening a new one!

pull/12/head
Caroline Bell 2020-02-28 23:10:43 -08:00
parent 1787ea0242
commit cfbdab79c7
2 changed files with 4 additions and 2 deletions

View File

@ -43,5 +43,4 @@ public class IngameHUD extends Screen
debugText.remove();
positionText.remove();
}
}

View File

@ -51,7 +51,10 @@ public class Ginger
}
public void openScreen(Screen screen)
{ gingerRegister.currentScreen = screen; }
{
if (gingerRegister.currentScreen != null) gingerRegister.currentScreen.close();
gingerRegister.currentScreen = screen;
}
public void setGingerPlayer(Player player)
{