Skip to content

Commit

Permalink
added confirmation when exiting game from the pause menu
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisj42 committed Jun 12, 2018
1 parent 841da06 commit 7b77aea
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/minicraft/screen/PauseDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,18 @@ public PauseDisplay() {
}

entries.addAll(Arrays.asList(
new SelectEntry("Main Menu", () -> Game.setMenu(new TitleDisplay())),
new SelectEntry("Main Menu", () -> {
Game.setMenu(new Display(false, true, new Menu.Builder(true, 8, RelPos.CENTER,
new StringEntry("Are you sure you want to"),
new StringEntry("exit the game?"),
new BlankEntry(),
new StringEntry("All unsaved progress", Color.RED),
new StringEntry("will be lost!", Color.RED),
new BlankEntry(),
new SelectEntry("No", Game::exitMenu),
new SelectEntry("Yes", () -> Game.setMenu(new TitleDisplay()))
).createMenu()));
}),

new BlankEntry(),

Expand Down

0 comments on commit 7b77aea

Please sign in to comment.