From 834e03c5311a47ff10c4fb0d93e0376bd9a6a484 Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 20 Oct 2015 13:45:28 +0100 Subject: [PATCH] Continue is default widget on title if save file exists. --- src/game/title.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/game/title.c b/src/game/title.c index 3d17a92..b2fc654 100644 --- a/src/game/title.c +++ b/src/game/title.c @@ -70,7 +70,17 @@ void initTitle(void) initFighters(); - selectWidget("newGame", "title"); + if (fileExists(getSaveFilePath("game.save"))) + { + selectWidget("continue", "title"); + } + else + { + getWidget("continue", "title")->enabled = 0; + + selectWidget("newGame", "title"); + } + getWidget("newGame", "title")->action = newGame; getWidget("continue", "title")->action = continueGame; getWidget("options", "title")->action = options; @@ -207,10 +217,7 @@ static void newGame(void) static void continueGame(void) { - if (fileExists(getSaveFilePath("game.save"))) - { - loadGame(); - } + loadGame(); initGalacticMap(); }