added setup option for showing (only) undo/redo game buttons
authorHolger Schemel <info@artsoft.org>
Sat, 10 Jul 2021 10:40:32 +0000 (12:40 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 10 Jul 2021 10:40:32 +0000 (12:40 +0200)
src/files.c
src/game.c
src/libgame/system.h
src/screens.c
src/tape.c

index 0d4eb7fe9ced85533ce8bbaa2b2129d74c6b6bcd..1200be3a81e2c70477d0d031efb0e7998924f8ba 100644 (file)
@@ -9681,6 +9681,10 @@ static struct TokenInfo global_setup_tokens[] =
     TYPE_SWITCH,
     &setup.show_snapshot_buttons,              "show_snapshot_buttons"
   },
+  {
+    TYPE_SWITCH,
+    &setup.show_undo_redo_buttons,             "show_undo_redo_buttons"
+  },
   {
     TYPE_SWITCH,
     &setup.only_show_local_scores,             "only_show_local_scores"
@@ -10361,6 +10365,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->sp_show_border_elements = FALSE;
   si->small_game_graphics = FALSE;
   si->show_snapshot_buttons = FALSE;
+  si->show_undo_redo_buttons = FALSE;
   si->only_show_local_scores = FALSE;
 
   si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
index a3cc0704876dc6b065c503b4a7a75fe2f988ac9c..932b8c9ea827976f4195656a5277b801e9355031 100644 (file)
@@ -16168,6 +16168,12 @@ static void UnmapGameButtonsAtSamePosition_All(void)
     UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PAUSE2);
     UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_LOAD);
   }
+  else if (setup.show_undo_redo_buttons)
+  {
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_UNDO);
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PAUSE2);
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_REDO);
+  }
   else
   {
     UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_STOP);
@@ -16232,9 +16238,7 @@ static void MapGameButtonsExt(boolean on_tape)
   int i;
 
   for (i = 0; i < NUM_GAME_BUTTONS; i++)
-    if ((!on_tape || gamebutton_info[i].allowed_on_tape) &&
-       i != GAME_CTRL_ID_UNDO &&
-       i != GAME_CTRL_ID_REDO)
+    if (!on_tape || gamebutton_info[i].allowed_on_tape)
       MapGadget(game_gadget[i]);
 
   UnmapGameButtonsAtSamePosition_All();
@@ -16326,6 +16330,8 @@ static void GameUndoRedoExt(void)
   DrawVideoDisplay(VIDEO_STATE_FRAME_ON, FrameCounter);
   DrawVideoDisplay(VIDEO_STATE_1STEP(tape.single_step), 0);
 
+  ModifyPauseButtons();
+
   BackToFront();
 }
 
index bd3f4b8fd6f3bf30629574dc161275b157a0d1d7..246960319b27304cd7fe6e8cb89783c76a8c64d8 100644 (file)
@@ -1475,6 +1475,7 @@ struct SetupInfo
   boolean sp_show_border_elements;
   boolean small_game_graphics;
   boolean show_snapshot_buttons;
+  boolean show_undo_redo_buttons;
   boolean only_show_local_scores;
 
   char *graphics_set;
index a63aa3339f8d3ec1d70c7d3cd2cab0b0f5432d9d..b7678d0920c9d460b54ecdaebcf64c10900264cd 100644 (file)
@@ -6795,6 +6795,7 @@ static struct TokenInfo setup_info_game[] =
   { TYPE_ENTER_LIST, execSetupChooseSnapshotMode,"Game Engine Snapshot Mode:" },
   { TYPE_STRING,       &snapshot_mode_text,    ""                      },
   { TYPE_SWITCH,       &setup.show_snapshot_buttons,"Show Snapshot Buttons:" },
+  { TYPE_SWITCH,       &setup.show_undo_redo_buttons,"Show Undo/Redo Buttons:" },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execSetupMain,          "Back"                  },
 
index 1c691867378923c3b35a5093a0e98eb9c59cf2b5..aa2f84a572e174a65a51d768d95481996a7da13a 100644 (file)
@@ -828,7 +828,9 @@ void TapeTogglePause(boolean toggle_mode)
 
   if (game_status == GAME_MODE_PLAYING)
   {
-    if (setup.show_snapshot_buttons && CheckEngineSnapshotList())
+    if (setup.show_snapshot_buttons &&
+       setup.show_undo_redo_buttons &&
+       CheckEngineSnapshotList())
     {
       if (tape.pausing)
        MapUndoRedoButtons();