summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--freecell.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/freecell.c b/freecell.c
index 28b277e..a346277 100644
--- a/freecell.c
+++ b/freecell.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2019  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -340,12 +340,14 @@ static enum Choice chooseMove(void) {
 	return choice;
 }
 
+static uint currentGame;
 static void newGame(uint game) {
 	if (!game) game = 1 + randUniform(32000);
 	deal(game);
 	char buf[sizeof("FreeCell Game #32000")];
 	snprintf(buf, sizeof(buf), "FreeCell Game #%u", game);
 	SDL_SetWindowTitle(window, buf);
+	currentGame = game;
 }
 
 static Card hiliteRank;
@@ -355,6 +357,7 @@ static uint fromStack = StacksLen;
 static bool keyDown(SDL_KeyboardEvent key) {
 	switch (key.keysym.sym) {
 		case SDLK_F2: newGame(0); return true;
+		case SDLK_F5: newGame(currentGame); return true;
 		case SDLK_BACKSPACE: return undo();
 	}
 	if (key.repeat) return false;