added optional button to restart game (door, panel and touch variants) master 4.3.8.2
authorHolger Schemel <info@artsoft.org>
Sun, 18 Feb 2024 13:34:28 +0000 (14:34 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 18 Feb 2024 13:34:43 +0000 (14:34 +0100)
graphics/gfx_classic/RocksDoor2.png
graphics/gfx_classic/RocksTouch.png
src/conf_gfx.c
src/game.c
src/game.h

index 73efd72d531f0335a909cce09790a0d894ebf171..7d150be02f4870e85a87db166bd812208a54bd16 100644 (file)
Binary files a/graphics/gfx_classic/RocksDoor2.png and b/graphics/gfx_classic/RocksDoor2.png differ
index 4cb63e9c68d4929844f6eab27cd17e4be683e0c0..919207ce5eaf21550ea24974081405c46842d1b5 100644 (file)
Binary files a/graphics/gfx_classic/RocksTouch.png and b/graphics/gfx_classic/RocksTouch.png differ
index 7b9d243ed52ba6b8169815741bae91460e09c35f..62bdab0e6b827bcab7f6064e5c66f425adb41425 100644 (file)
@@ -6420,6 +6420,13 @@ struct ConfigInfo image_config[] =
   { "gfx.game.button.load.height",             "30"                    },
   { "gfx.game.button.load.pressed_xoffset",    "-100"                  },
 
+  { "gfx.game.button.restart",                 "RocksDoor2.png"        },
+  { "gfx.game.button.restart.x",               "200"                   },
+  { "gfx.game.button.restart.y",               "50"                    },
+  { "gfx.game.button.restart.width",           "30"                    },
+  { "gfx.game.button.restart.height",          "30"                    },
+  { "gfx.game.button.restart.pressed_xoffset", "30"                    },
+
   { "gfx.game.button.sound_music",             "RocksDoor.png"         },
   { "gfx.game.button.sound_music.x",           "305"                   },
   { "gfx.game.button.sound_music.y",           "245"                   },
@@ -6445,6 +6452,7 @@ struct ConfigInfo image_config[] =
   { "gfx.game.button.panel_stop",              UNDEFINED_FILENAME      },
   { "gfx.game.button.panel_pause",             UNDEFINED_FILENAME      },
   { "gfx.game.button.panel_play",              UNDEFINED_FILENAME      },
+  { "gfx.game.button.panel_restart",           UNDEFINED_FILENAME      },
 
   { "gfx.game.button.panel_sound_music",       UNDEFINED_FILENAME      },
   { "gfx.game.button.panel_sound_loops",       UNDEFINED_FILENAME      },
@@ -6464,6 +6472,13 @@ struct ConfigInfo image_config[] =
   { "gfx.game.button.touch_pause.pressed_xoffset", "-200"              },
   { "gfx.game.button.touch_pause.active_yoffset", "60"                 },
 
+  { "gfx.game.button.touch_restart",           "RocksTouch.png"        },
+  { "gfx.game.button.touch_restart.x",         "210"                   },
+  { "gfx.game.button.touch_restart.y",         "240"                   },
+  { "gfx.game.button.touch_restart.width",     "60"                    },
+  { "gfx.game.button.touch_restart.height",    "60"                    },
+  { "gfx.game.button.touch_restart.pressed_xoffset", "-200"            },
+
   { "gfx.tape.button.eject",                   "RocksDoor.png"         },
   { "gfx.tape.button.eject.x",                 "305"                   },
   { "gfx.tape.button.eject.y",                 "357"                   },
@@ -9733,6 +9748,8 @@ struct ConfigInfo image_config[] =
   { "game.button.pause2.y",                    "-1"                    },
   { "game.button.load.x",                      "-1"                    },
   { "game.button.load.y",                      "-1"                    },
+  { "game.button.restart.x",                   "-1"                    },
+  { "game.button.restart.y",                   "-1"                    },
   { "game.button.sound_music.x",               "5"                     },
   { "game.button.sound_music.y",               "245"                   },
   { "game.button.sound_loops.x",               "35"                    },
@@ -9746,6 +9763,8 @@ struct ConfigInfo image_config[] =
   { "game.button.panel_pause.y",               "-1"                    },
   { "game.button.panel_play.x",                        "-1"                    },
   { "game.button.panel_play.y",                        "-1"                    },
+  { "game.button.panel_restart.x",             "-1"                    },
+  { "game.button.panel_restart.y",             "-1"                    },
   { "game.button.panel_sound_music.x",         "-1"                    },
   { "game.button.panel_sound_music.y",         "-1"                    },
   { "game.button.panel_sound_loops.x",         "-1"                    },
@@ -9757,6 +9776,8 @@ struct ConfigInfo image_config[] =
   { "game.button.touch_stop.y",                        "0"                     },
   { "game.button.touch_pause.x",               "-60"                   },
   { "game.button.touch_pause.y",               "0"                     },
+  { "game.button.touch_restart.x",             "-1"                    },
+  { "game.button.touch_restart.y",             "-1"                    },
 
   { "tape.button.eject.x",                     "5"                     },
   { "tape.button.eject.y",                     "77"                    },
index 872b4e9b2b769f61906a6063006cfd0b1a5f51e8..fd943b996e0155de3c0509a8498cc9e7a445e29a 100644 (file)
@@ -1017,19 +1017,22 @@ static struct GamePanelControlInfo game_panel_controls[] =
 #define GAME_CTRL_ID_SAVE              5
 #define GAME_CTRL_ID_PAUSE2            6
 #define GAME_CTRL_ID_LOAD              7
-#define GAME_CTRL_ID_PANEL_STOP                8
-#define GAME_CTRL_ID_PANEL_PAUSE       9
-#define GAME_CTRL_ID_PANEL_PLAY                10
-#define GAME_CTRL_ID_TOUCH_STOP                11
-#define GAME_CTRL_ID_TOUCH_PAUSE       12
-#define SOUND_CTRL_ID_MUSIC            13
-#define SOUND_CTRL_ID_LOOPS            14
-#define SOUND_CTRL_ID_SIMPLE           15
-#define SOUND_CTRL_ID_PANEL_MUSIC      16
-#define SOUND_CTRL_ID_PANEL_LOOPS      17
-#define SOUND_CTRL_ID_PANEL_SIMPLE     18
-
-#define NUM_GAME_BUTTONS               19
+#define GAME_CTRL_ID_RESTART           8
+#define GAME_CTRL_ID_PANEL_STOP                9
+#define GAME_CTRL_ID_PANEL_PAUSE       10
+#define GAME_CTRL_ID_PANEL_PLAY                11
+#define GAME_CTRL_ID_PANEL_RESTART     12
+#define GAME_CTRL_ID_TOUCH_STOP                13
+#define GAME_CTRL_ID_TOUCH_PAUSE       14
+#define GAME_CTRL_ID_TOUCH_RESTART     15
+#define SOUND_CTRL_ID_MUSIC            16
+#define SOUND_CTRL_ID_LOOPS            17
+#define SOUND_CTRL_ID_SIMPLE           18
+#define SOUND_CTRL_ID_PANEL_MUSIC      19
+#define SOUND_CTRL_ID_PANEL_LOOPS      20
+#define SOUND_CTRL_ID_PANEL_SIMPLE     21
+
+#define NUM_GAME_BUTTONS               22
 
 
 // forward declaration for internal use
@@ -16246,6 +16249,11 @@ static struct
     GAME_CTRL_ID_LOAD,                         NULL,
     TRUE, FALSE,                               "load game"
   },
+  {
+    IMG_GFX_GAME_BUTTON_RESTART,               &game.button.restart,
+    GAME_CTRL_ID_RESTART,                      NULL,
+    TRUE, FALSE,                               "restart game"
+  },
   {
     IMG_GFX_GAME_BUTTON_PANEL_STOP,            &game.button.panel_stop,
     GAME_CTRL_ID_PANEL_STOP,                   NULL,
@@ -16261,6 +16269,11 @@ static struct
     GAME_CTRL_ID_PANEL_PLAY,                   NULL,
     FALSE, FALSE,                              "play game"
   },
+  {
+    IMG_GFX_GAME_BUTTON_PANEL_RESTART,         &game.button.panel_restart,
+    GAME_CTRL_ID_PANEL_RESTART,                        NULL,
+    FALSE, FALSE,                              "restart game"
+  },
   {
     IMG_GFX_GAME_BUTTON_TOUCH_STOP,            &game.button.touch_stop,
     GAME_CTRL_ID_TOUCH_STOP,                   NULL,
@@ -16271,6 +16284,11 @@ static struct
     GAME_CTRL_ID_TOUCH_PAUSE,                  NULL,
     FALSE, TRUE,                               "pause game"
   },
+  {
+    IMG_GFX_GAME_BUTTON_TOUCH_RESTART,         &game.button.touch_restart,
+    GAME_CTRL_ID_TOUCH_RESTART,                        NULL,
+    FALSE, TRUE,                               "restart game"
+  },
   {
     IMG_GFX_GAME_BUTTON_SOUND_MUSIC,           &game.button.sound_music,
     SOUND_CTRL_ID_MUSIC,                       &setup.sound_music,
@@ -16350,7 +16368,10 @@ void CreateGameButtons(void)
        id == GAME_CTRL_ID_PLAY ||
        id == GAME_CTRL_ID_PANEL_PLAY ||
        id == GAME_CTRL_ID_SAVE ||
-       id == GAME_CTRL_ID_LOAD)
+       id == GAME_CTRL_ID_LOAD ||
+       id == GAME_CTRL_ID_RESTART ||
+       id == GAME_CTRL_ID_PANEL_RESTART ||
+       id == GAME_CTRL_ID_TOUCH_RESTART)
     {
       button_type = GD_TYPE_NORMAL_BUTTON;
       checked = FALSE;
@@ -16698,6 +16719,13 @@ static void HandleGameButtonsExt(int id, int button)
       TapeQuickLoad();
       break;
 
+    case GAME_CTRL_ID_RESTART:
+    case GAME_CTRL_ID_PANEL_RESTART:
+    case GAME_CTRL_ID_TOUCH_RESTART:
+      TapeRestartGame();
+
+      break;
+
     case SOUND_CTRL_ID_MUSIC:
     case SOUND_CTRL_ID_PANEL_MUSIC:
       if (setup.sound_music)
index c555578b4ae8ce4a2f8755d380e51bcb18d7aced..3752ba00a7ed37d657bcb9a59b281cf54b9fb86a 100644 (file)
@@ -123,6 +123,8 @@ struct GameButtonInfo
   struct XY pause2;
   struct XY load;
 
+  struct XY restart;
+
   struct XY sound_music;
   struct XY sound_loops;
   struct XY sound_simple;
@@ -131,12 +133,15 @@ struct GameButtonInfo
   struct XY panel_pause;
   struct XY panel_play;
 
+  struct XY panel_restart;
+
   struct XY panel_sound_music;
   struct XY panel_sound_loops;
   struct XY panel_sound_simple;
 
   struct XY touch_stop;
   struct XY touch_pause;
+  struct XY touch_restart;
 };
 
 struct GameSnapshotInfo