From: Holger Schemel Date: Sun, 18 Feb 2024 13:34:28 +0000 (+0100) Subject: added optional button to restart game (door, panel and touch variants) X-Git-Tag: 4.3.8.2^0 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=rocksndiamonds.git added optional button to restart game (door, panel and touch variants) --- diff --git a/graphics/gfx_classic/RocksDoor2.png b/graphics/gfx_classic/RocksDoor2.png index 73efd72d..7d150be0 100644 Binary files a/graphics/gfx_classic/RocksDoor2.png and b/graphics/gfx_classic/RocksDoor2.png differ diff --git a/graphics/gfx_classic/RocksTouch.png b/graphics/gfx_classic/RocksTouch.png index 4cb63e9c..919207ce 100644 Binary files a/graphics/gfx_classic/RocksTouch.png and b/graphics/gfx_classic/RocksTouch.png differ diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 7b9d243e..62bdab0e 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -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" }, diff --git a/src/game.c b/src/game.c index 872b4e9b..fd943b99 100644 --- a/src/game.c +++ b/src/game.c @@ -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) diff --git a/src/game.h b/src/game.h index c555578b..3752ba00 100644 --- a/src/game.h +++ b/src/game.h @@ -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