From: Holger Schemel Date: Sat, 10 Mar 2018 20:06:10 +0000 (+0100) Subject: added message 'level solved' after solving a level X-Git-Tag: 4.1.0.0~19 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c1835c332851f0f30f4bc907d4cc995b56472227;p=rocksndiamonds.git added message 'level solved' after solving a level --- diff --git a/src/files.c b/src/files.c index a07ee8af..497d12c8 100644 --- a/src/files.c +++ b/src/files.c @@ -8081,18 +8081,18 @@ void SaveTape(int nr) tape.changed = FALSE; } -boolean SaveTapeChecked(int nr) +static boolean SaveTapeCheckedExt(int nr, char *msg_replace, char *msg_saved) { char *filename = getTapeFilename(nr); boolean new_tape = !fileExists(filename); boolean tape_saved = FALSE; - if (new_tape || Request("Replace old tape?", REQ_ASK)) + if (new_tape || Request(msg_replace, REQ_ASK)) { SaveTape(nr); if (new_tape) - Request("Tape saved!", REQ_CONFIRM); + Request(msg_saved, REQ_CONFIRM); tape_saved = TRUE; } @@ -8100,6 +8100,17 @@ boolean SaveTapeChecked(int nr) return tape_saved; } +boolean SaveTapeChecked(int nr) +{ + return SaveTapeCheckedExt(nr, "Replace old tape?", "Tape saved!"); +} + +boolean SaveTapeChecked_LevelSolved(int nr) +{ + return SaveTapeCheckedExt(nr, "Level solved! Replace old tape?", + "Level solved! Tape saved!"); +} + void DumpTape(struct TapeInfo *tape) { int tape_frame_counter; diff --git a/src/files.h b/src/files.h index bfad4958..d9c0e2b6 100644 --- a/src/files.h +++ b/src/files.h @@ -52,6 +52,7 @@ void LoadSolutionTape(int); void SaveTape(int); void DumpTape(struct TapeInfo *); boolean SaveTapeChecked(int); +boolean SaveTapeChecked_LevelSolved(int); void LoadScore(int); void SaveScore(int); diff --git a/src/game.c b/src/game.c index f8606638..dcae9beb 100644 --- a/src/game.c +++ b/src/game.c @@ -4699,7 +4699,7 @@ void GameEnd() if (!global.use_envelope_request) CloseDoor(DOOR_CLOSE_1); - SaveTapeChecked(tape.level_nr); /* ask to save tape */ + SaveTapeChecked_LevelSolved(tape.level_nr); /* ask to save tape */ } /* if no tape is to be saved, close both doors simultaneously */