Bugfix: GamePausedScreen did not correctly replace the GameScreen when going to MainMenu.

This commit is contained in:
Jan Philipp Timme 2014-11-04 21:31:47 +01:00
parent 4017d369b1
commit 0a695432a0
2 changed files with 9 additions and 2 deletions

View File

@ -70,7 +70,13 @@ public class Keyboard implements KeyListener {
Keyboard.listener.remove(listener);
}
/**
* Make sure we only iterate over copies due to possible concurrent modification.
* This method returns a copy of the listener list.
*/
public ArrayList<KeyboardListener> getListener() {
return new ArrayList<KeyboardListener>(Keyboard.listener);
}
/**
* KeyListener method.
* Registers the pressed key and passes the event on to registered listeners.

View File

@ -91,7 +91,8 @@ public class GamePausedScreen extends Screen {
this.parent.setOverlay(null);
break;
case 1:
this.parent.setOverlay(new MainMenuScreen(this.parent));
//Replace our parents (the game) parent (the SuperScreen) overlay.
this.parent.parent.setOverlay(new MainMenuScreen(this.parent.parent));
break;
}
}