diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 7e477dae..1946fd41 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -2755,6 +2755,11 @@ bool entityclass::updateentities( int i ) bool success = game.savequick(); game.gamesaved = success; game.gamesavefailed = !success; + + if (game.gamesavefailed) { + game.show_save_fail(); + graphics.textboxapplyposition(); + } } } break; diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index fb80f66b..72ea288a 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -828,7 +828,7 @@ static void savetele_textbox_success(textboxclass* THIS) THIS->pad(3, 3); } -static void savetele_textbox_fail(textboxclass* THIS) +static void save_textbox_fail(textboxclass* THIS) { THIS->lines.clear(); THIS->lines.push_back(loc::gettext("ERROR: Could not save game!")); @@ -836,6 +836,15 @@ static void savetele_textbox_fail(textboxclass* THIS) THIS->pad(1, 1); } +void Game::show_save_fail(void) +{ + graphics.createtextboxflipme("", -1, 12, TEXT_COLOUR("red")); + graphics.textboxprintflags(PR_FONT_INTERFACE); + graphics.textboxcenterx(); + graphics.textboxtimer(50); + graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, save_textbox_fail); +} + void Game::savetele_textbox(void) { if (inspecial() || map.custommode) @@ -853,11 +862,7 @@ void Game::savetele_textbox(void) } else { - graphics.createtextboxflipme("", -1, 12, TEXT_COLOUR("red")); - graphics.textboxprintflags(PR_FONT_INTERFACE); - graphics.textboxcenterx(); - graphics.textboxtimer(50); - graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, savetele_textbox_fail); + show_save_fail(); } graphics.textboxapplyposition(); } diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 64fcb5a2..b416859a 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -225,6 +225,7 @@ public: void crewmate_textbox(const int color); void remaining_textbox(void); void actionprompt_textbox(void); + void show_save_fail(void); void savetele_textbox(void); void setstate(int gamestate); diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 9b22bd89..252dc53d 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1152,7 +1152,7 @@ static void menurender(void) { font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Checkpoint Saving"), tr, tg, tb); int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Toggle if checkpoints should save the game."), tr, tg, tb); - if (game.checkpoint_saving) + if (!game.checkpoint_saving) { font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Checkpoint saving is OFF"), tr / 2, tg / 2, tb / 2); } diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 3353ee2d..9160e7fe 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1212,6 +1212,11 @@ void scriptclass::run(void) bool success = game.savequick(); game.gamesaved = success; game.gamesavefailed = !success; + + if (game.gamesavefailed) { + game.show_save_fail(); + graphics.textboxapplyposition(); + } } } else if (words[0] == "gamestate")