From: Holger Schemel Date: Wed, 8 Jan 2025 22:47:08 +0000 (+0100) Subject: added setup option to save tape without asking X-Git-Tag: 4.4.0.1~26 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b270a1fa11900027fccdfd611e746a16c80c8219;p=rocksndiamonds.git added setup option to save tape without asking --- diff --git a/src/files.c b/src/files.c index c6faf9e5..92757dd5 100644 --- a/src/files.c +++ b/src/files.c @@ -9972,6 +9972,11 @@ void SaveScoreTape(int nr) SaveTapeExt(filename); } +static boolean SaveTapeRequest(char *msg, unsigned int req_state) +{ + return (!setup.ask_on_save_tape || Request(msg, req_state)); +} + static boolean SaveTapeCheckedExt(int nr, char *msg_replace, char *msg_saved, unsigned int req_state_added) { @@ -9979,12 +9984,12 @@ static boolean SaveTapeCheckedExt(int nr, char *msg_replace, char *msg_saved, boolean new_tape = !fileExists(filename); boolean tape_saved = FALSE; - if (new_tape || Request(msg_replace, REQ_ASK | req_state_added)) + if (new_tape || SaveTapeRequest(msg_replace, REQ_ASK | req_state_added)) { SaveTape(nr); if (new_tape) - Request(msg_saved, REQ_CONFIRM | req_state_added); + SaveTapeRequest(msg_saved, REQ_CONFIRM | req_state_added); tape_saved = TRUE; } @@ -10969,6 +10974,10 @@ static struct TokenInfo global_setup_tokens[] = TYPE_SWITCH, &setup.ask_on_escape_editor, "ask_on_escape_editor" }, + { + TYPE_SWITCH, + &setup.ask_on_save_tape, "ask_on_save_tape" + }, { TYPE_SWITCH, &setup.ask_on_game_over, "ask_on_game_over" @@ -11925,6 +11934,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->vsync_mode = getStringCopy(STR_VSYNC_MODE_DEFAULT); si->ask_on_escape = TRUE; si->ask_on_escape_editor = TRUE; + si->ask_on_save_tape = TRUE; si->ask_on_game_over = TRUE; si->ask_on_quit_game = TRUE; si->ask_on_quit_program = TRUE; diff --git a/src/libgame/system.h b/src/libgame/system.h index 5bae5afb..e07c553b 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1568,6 +1568,7 @@ struct SetupInfo char *vsync_mode; boolean ask_on_escape; boolean ask_on_escape_editor; + boolean ask_on_save_tape; boolean ask_on_game_over; boolean ask_on_quit_game; boolean ask_on_quit_program; diff --git a/src/screens.c b/src/screens.c index e7c233a1..2de3946c 100644 --- a/src/screens.c +++ b/src/screens.c @@ -8547,6 +8547,7 @@ static struct TokenInfo setup_info_game[] = { TYPE_SWITCH, &setup.auto_play_next_level, "Auto-play Next Level:" }, { TYPE_SWITCH, &setup.count_score_after_game, "Count Score After Game:" }, { TYPE_SWITCH, &setup.show_scores_after_game, "Show Scores After Game:" }, + { TYPE_YES_NO, &setup.ask_on_save_tape, "Ask on Save Tape:" }, { TYPE_YES_NO, &setup.ask_on_game_over, "Ask on Game Over:" }, { TYPE_YES_NO, &setup.ask_on_quit_game, "Ask on Quit Game:" }, { TYPE_YES_NO, &setup.ask_on_quit_program, "Ask on Quit Program:" },