added setup option to enable/disable (now optional) snapshot buttons
authorHolger Schemel <info@artsoft.org>
Sun, 31 May 2015 00:14:50 +0000 (02:14 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 31 May 2015 00:16:46 +0000 (02:16 +0200)
src/conf_gfx.c
src/files.c
src/game.c
src/game.h
src/libgame/system.h
src/screens.c
src/tape.c

index b63cb9408a4476714e2bdc342abba6edab2ffc5d..44eafc75419d54bbc5346b5696c962b67a18858a 100644 (file)
@@ -4741,6 +4741,13 @@ struct ConfigInfo image_config[] =
   { "game.button.gfx.save.width",              "30"                    },
   { "game.button.gfx.save.height",             "30"                    },
   { "game.button.gfx.save.pressed_xoffset",    "-100"                  },
+  { "game.button.gfx.pause2",                  "RocksDoor2.png"        },
+  { "game.button.gfx.pause2.x",                        "135"                   },
+  { "game.button.gfx.pause2.y",                        "50"                    },
+  { "game.button.gfx.pause2.width",            "30"                    },
+  { "game.button.gfx.pause2.height",           "30"                    },
+  { "game.button.gfx.pause2.pressed_xoffset",  "-100"                  },
+  { "game.button.gfx.pause2.active_yoffset",   "-30"                   },
   { "game.button.gfx.load",                    "RocksDoor2.png"        },
   { "game.button.gfx.load.x",                  "165"                   },
   { "game.button.gfx.load.y",                  "50"                    },
@@ -7367,11 +7374,11 @@ struct ConfigInfo image_config[] =
   { "game.panel.level_author.draw_masked",     "true"                  },
   { "game.panel.level_author.draw_order",      "0"                     },
 
-  { "game.button.stop.x",                      "-1"                    },
-  { "game.button.stop.y",                      "-1"                    },
+  { "game.button.stop.x",                      "5"                     },
+  { "game.button.stop.y",                      "215"                   },
   { "game.button.pause.x",                     "35"                    },
   { "game.button.pause.y",                     "215"                   },
-  { "game.button.play.x",                      "35"                    },
+  { "game.button.play.x",                      "65"                    },
   { "game.button.play.y",                      "215"                   },
   { "game.button.undo.x",                      "5"                     },
   { "game.button.undo.y",                      "215"                   },
@@ -7379,6 +7386,8 @@ struct ConfigInfo image_config[] =
   { "game.button.redo.y",                      "215"                   },
   { "game.button.save.x",                      "5"                     },
   { "game.button.save.y",                      "215"                   },
+  { "game.button.pause2.x",                    "35"                    },
+  { "game.button.pause2.y",                    "215"                   },
   { "game.button.load.x",                      "65"                    },
   { "game.button.load.y",                      "215"                   },
   { "game.button.sound_music.x",               "5"                     },
index 184fbb0f111cba96c7f65dd9d7133a1c7d894214..47e26ffa6707a6e57a6433589209bba86ce6586d 100644 (file)
@@ -7913,20 +7913,21 @@ void SaveScore(int nr)
 #define SETUP_TOKEN_GAME_FRAME_DELAY           26
 #define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS    27
 #define SETUP_TOKEN_SMALL_GAME_GRAPHICS                28
-#define SETUP_TOKEN_GRAPHICS_SET               29
-#define SETUP_TOKEN_SOUNDS_SET                 30
-#define SETUP_TOKEN_MUSIC_SET                  31
-#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS    32
-#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS      33
-#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC       34
-#define SETUP_TOKEN_VOLUME_SIMPLE              35
-#define SETUP_TOKEN_VOLUME_LOOPS               36
-#define SETUP_TOKEN_VOLUME_MUSIC               37
-#define SETUP_TOKEN_TOUCH_CONTROL_TYPE         38
-#define SETUP_TOKEN_TOUCH_MOVE_DISTANCE                39
-#define SETUP_TOKEN_TOUCH_DROP_DISTANCE                40
-
-#define NUM_GLOBAL_SETUP_TOKENS                        41
+#define SETUP_TOKEN_SHOW_SNAPSHOT_BUTTONS      29
+#define SETUP_TOKEN_GRAPHICS_SET               30
+#define SETUP_TOKEN_SOUNDS_SET                 31
+#define SETUP_TOKEN_MUSIC_SET                  32
+#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS    33
+#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS      34
+#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC       35
+#define SETUP_TOKEN_VOLUME_SIMPLE              36
+#define SETUP_TOKEN_VOLUME_LOOPS               37
+#define SETUP_TOKEN_VOLUME_MUSIC               38
+#define SETUP_TOKEN_TOUCH_CONTROL_TYPE         39
+#define SETUP_TOKEN_TOUCH_MOVE_DISTANCE                40
+#define SETUP_TOKEN_TOUCH_DROP_DISTANCE                41
+
+#define NUM_GLOBAL_SETUP_TOKENS                        42
 
 /* editor setup */
 #define SETUP_TOKEN_EDITOR_EL_BOULDERDASH      0
@@ -8085,6 +8086,7 @@ static struct TokenInfo global_setup_tokens[] =
   { TYPE_INTEGER,&si.game_frame_delay,        "game_frame_delay"       },
   { TYPE_SWITCH, &si.sp_show_border_elements, "sp_show_border_elements"        },
   { TYPE_SWITCH, &si.small_game_graphics,     "small_game_graphics"    },
+  { TYPE_SWITCH, &si.show_snapshot_buttons,   "show_snapshot_buttons"  },
   { TYPE_STRING, &si.graphics_set,            "graphics_set"           },
   { TYPE_STRING, &si.sounds_set,              "sounds_set"             },
   { TYPE_STRING, &si.music_set,               "music_set"              },
@@ -8264,6 +8266,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->game_frame_delay = GAME_FRAME_DELAY;
   si->sp_show_border_elements = FALSE;
   si->small_game_graphics = FALSE;
+  si->show_snapshot_buttons = FALSE;
 
   si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
   si->sounds_set   = getStringCopy(SND_CLASSIC_SUBDIR);
index 6a8967685317b411cd256feb9d8fba756c639555..c02e590f5fb026eb3d4c59cf09a03725a804b265 100644 (file)
@@ -974,12 +974,13 @@ static struct GamePanelControlInfo game_panel_controls[] =
 #define GAME_CTRL_ID_UNDO              3
 #define GAME_CTRL_ID_REDO              4
 #define GAME_CTRL_ID_SAVE              5
-#define GAME_CTRL_ID_LOAD              6
-#define SOUND_CTRL_ID_MUSIC            7
-#define SOUND_CTRL_ID_LOOPS            8
-#define SOUND_CTRL_ID_SIMPLE           9
+#define GAME_CTRL_ID_PAUSE2            6
+#define GAME_CTRL_ID_LOAD              7
+#define SOUND_CTRL_ID_MUSIC            8
+#define SOUND_CTRL_ID_LOOPS            9
+#define SOUND_CTRL_ID_SIMPLE           10
 
-#define NUM_GAME_BUTTONS               10
+#define NUM_GAME_BUTTONS               11
 
 
 /* forward declaration for internal use */
@@ -14866,6 +14867,10 @@ static struct
     IMG_GAME_BUTTON_GFX_SAVE,          &game.button.save,
     GAME_CTRL_ID_SAVE,                 "save game"
   },
+  {
+    IMG_GAME_BUTTON_GFX_PAUSE2,                &game.button.pause2,
+    GAME_CTRL_ID_PAUSE2,               "pause game"
+  },
   {
     IMG_GAME_BUTTON_GFX_LOAD,          &game.button.load,
     GAME_CTRL_ID_LOAD,                 "load game"
@@ -14916,7 +14921,6 @@ void CreateGameButtons()
     }
 
     if (id == GAME_CTRL_ID_STOP ||
-       id == GAME_CTRL_ID_PAUSE ||
        id == GAME_CTRL_ID_PLAY ||
        id == GAME_CTRL_ID_SAVE ||
        id == GAME_CTRL_ID_LOAD)
@@ -15001,22 +15005,18 @@ void MapUndoRedoButtons()
 {
   UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_UNDO);
   UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_REDO);
-  UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PLAY);
 
   MapGadget(game_gadget[GAME_CTRL_ID_UNDO]);
   MapGadget(game_gadget[GAME_CTRL_ID_REDO]);
-  MapGadget(game_gadget[GAME_CTRL_ID_PLAY]);
 }
 
 void UnmapUndoRedoButtons()
 {
   UnmapGadget(game_gadget[GAME_CTRL_ID_UNDO]);
   UnmapGadget(game_gadget[GAME_CTRL_ID_REDO]);
-  UnmapGadget(game_gadget[GAME_CTRL_ID_PLAY]);
 
   MapGameButtonsAtSamePosition(GAME_CTRL_ID_UNDO);
   MapGameButtonsAtSamePosition(GAME_CTRL_ID_REDO);
-  MapGameButtonsAtSamePosition(GAME_CTRL_ID_PLAY);
 }
 
 void MapGameButtons()
@@ -15025,9 +15025,23 @@ void MapGameButtons()
 
   for (i = 0; i < NUM_GAME_BUTTONS; i++)
     if (i != GAME_CTRL_ID_UNDO &&
-       i != GAME_CTRL_ID_REDO &&
-       i != GAME_CTRL_ID_PLAY)
+       i != GAME_CTRL_ID_REDO)
       MapGadget(game_gadget[i]);
+
+  if (setup.show_snapshot_buttons)
+  {
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_SAVE);
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PAUSE2);
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_LOAD);
+  }
+  else
+  {
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_STOP);
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PAUSE);
+    UnmapGameButtonsAtSamePosition(GAME_CTRL_ID_PLAY);
+  }
+
+  RedrawGameButtons();
 }
 
 void UnmapGameButtons()
@@ -15111,6 +15125,7 @@ static void HandleGameButtonsExt(int id, int button)
       break;
 
     case GAME_CTRL_ID_PAUSE:
+    case GAME_CTRL_ID_PAUSE2:
       if (options.network && game_status == GAME_MODE_PLAYING)
       {
 #if defined(NETWORK_AVALIABLE)
index a962abd7ca9afc097b0b13ed7ce721f4f634f2c9..b801932c3f9df35338c2519a69d7d7a4af54a889 100644 (file)
@@ -105,6 +105,7 @@ struct GameButtonInfo
   struct XY redo;
 
   struct XY save;
+  struct XY pause2;
   struct XY load;
 
   struct XY sound_music;
index 9a42c147f194c9345c2356cb52d9f519396e8a65..df223fe7d0e89b5124d223b246487524ed21b21b 100644 (file)
@@ -982,6 +982,7 @@ struct SetupInfo
   int game_frame_delay;
   boolean sp_show_border_elements;
   boolean small_game_graphics;
+  boolean show_snapshot_buttons;
 
   char *graphics_set;
   char *sounds_set;
index deb4da87f625881bc6ec6006f85e8c986379ba95..d1b80e26eddf43d8ec759c59adbeba7eaffc38ec 100644 (file)
@@ -5286,6 +5286,7 @@ static struct TokenInfo setup_info_game[] =
 #endif
   { TYPE_ENTER_LIST, execSetupChooseSnapshotMode,"Game Engine Snapshot Mode:" },
   { TYPE_STRING,       &snapshot_mode_text,    ""                      },
+  { TYPE_SWITCH,       &setup.show_snapshot_buttons,"Show Snapshot Buttons:" },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execSetupMain,          "Back"                  },
 
index 7a896e807bf79e7ebb6864cf0e50e09670f718fb..4ff0c9687de9577369e54cbb935b61605ed562d5 100644 (file)
@@ -747,7 +747,9 @@ void TapeTogglePause(boolean toggle_manual)
     }
   }
 
-  if (game_status == GAME_MODE_PLAYING && CheckEngineSnapshotList())
+  if (setup.show_snapshot_buttons &&
+      game_status == GAME_MODE_PLAYING &&
+      CheckEngineSnapshotList())
   {
     if (tape.pausing)
       MapUndoRedoButtons();