added setup option to ask to play again after game is over but not solved
authorHolger Schemel <info@artsoft.org>
Fri, 12 Oct 2018 22:51:51 +0000 (00:51 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 12 Oct 2018 22:51:51 +0000 (00:51 +0200)
src/files.c
src/libgame/system.h
src/screens.c

index 605efc27af482bb4df72607829ea65fb6dcc2165..75e691c36555fdd434af328a817ac5be0c482c99 100644 (file)
@@ -8365,6 +8365,7 @@ enum
   SETUP_TOKEN_VSYNC_MODE,
   SETUP_TOKEN_ASK_ON_ESCAPE,
   SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR,
+  SETUP_TOKEN_ASK_ON_GAME_OVER,
   SETUP_TOKEN_QUICK_SWITCH,
   SETUP_TOKEN_INPUT_ON_FOCUS,
   SETUP_TOKEN_PREFER_AGA_GRAPHICS,
@@ -8609,6 +8610,7 @@ static struct TokenInfo global_setup_tokens[] =
   { TYPE_STRING, &si.vsync_mode,              "vsync_mode"             },
   { TYPE_SWITCH, &si.ask_on_escape,           "ask_on_escape"          },
   { TYPE_SWITCH, &si.ask_on_escape_editor,    "ask_on_escape_editor"   },
+  { TYPE_SWITCH, &si.ask_on_game_over,        "ask_on_game_over"       },
   { TYPE_SWITCH, &si.quick_switch,            "quick_player_switch"    },
   { TYPE_SWITCH, &si.input_on_focus,          "input_on_focus"         },
   { TYPE_SWITCH, &si.prefer_aga_graphics,     "prefer_aga_graphics"    },
@@ -8832,6 +8834,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->vsync_mode = getStringCopy(STR_VSYNC_MODE_DEFAULT);
   si->ask_on_escape = TRUE;
   si->ask_on_escape_editor = TRUE;
+  si->ask_on_game_over = TRUE;
   si->quick_switch = FALSE;
   si->input_on_focus = FALSE;
   si->prefer_aga_graphics = TRUE;
index 66ff780504d90153a198bf4ef3240c86d422ef5b..711b227355959cd6e7a28a1523c78c1ab9d34be9 100644 (file)
@@ -1288,6 +1288,7 @@ struct SetupInfo
   char *vsync_mode;
   boolean ask_on_escape;
   boolean ask_on_escape_editor;
+  boolean ask_on_game_over;
   boolean quick_switch;
   boolean input_on_focus;
   boolean prefer_aga_graphics;
index 1a40ae7cb291fbe96c9914acad764fed22ee0d0a..3c12d6b5df34b14d528fd4d61f8c7a828e64bfd7 100644 (file)
@@ -6164,6 +6164,7 @@ static struct TokenInfo setup_info_game[] =
   { TYPE_SWITCH,       &setup.increment_levels,"Increment Solved Levels:" },
   { TYPE_SWITCH,       &setup.auto_play_next_level,"Auto-play Next Level:" },
   { TYPE_SWITCH,       &setup.skip_scores_after_game,"Skip Scores After Game:" },
+  { TYPE_YES_NO,       &setup.ask_on_game_over, "Ask on Game Over:"    },
   { TYPE_SWITCH,       &setup.autorecord,      "Auto-Record Tapes:"    },
   { TYPE_ENTER_LIST,   execSetupChooseGameSpeed, "Game Speed:"         },
   { TYPE_STRING,       &game_speed_text,       ""                      },
@@ -8211,7 +8212,8 @@ void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
 
 void HandleGameActions(void)
 {
-  CheckGameOver();
+  if (setup.ask_on_game_over)
+    CheckGameOver();
 
   if (game.restart_game_message != NULL)
   {