From: Holger Schemel Date: Sat, 10 Jul 2021 10:40:32 +0000 (+0200) Subject: added setup option for showing (only) undo/redo game buttons X-Git-Tag: 4.3.0.0~106 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=45edbd7477e4684132ff96fa737336539ecc6f4c;p=rocksndiamonds.git added setup option for showing (only) undo/redo game buttons --- diff --git a/src/files.c b/src/files.c index 0d4eb7fe..1200be3a 100644 --- a/src/files.c +++ b/src/files.c @@ -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); diff --git a/src/game.c b/src/game.c index a3cc0704..932b8c9e 100644 --- a/src/game.c +++ b/src/game.c @@ -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(); } diff --git a/src/libgame/system.h b/src/libgame/system.h index bd3f4b8f..24696031 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -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; diff --git a/src/screens.c b/src/screens.c index a63aa333..b7678d09 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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" }, diff --git a/src/tape.c b/src/tape.c index 1c691867..aa2f84a5 100644 --- a/src/tape.c +++ b/src/tape.c @@ -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();