diff --git a/desktop_version/lang/ar/strings.xml b/desktop_version/lang/ar/strings.xml
index dc4ab172a4..fa676260ae 100644
--- a/desktop_version/lang/ar/strings.xml
+++ b/desktop_version/lang/ar/strings.xml
@@ -236,6 +236,11 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/desktop_version/lang/cy/strings.xml b/desktop_version/lang/cy/strings.xml
index 75233e0a01..e4a69d5efd 100644
--- a/desktop_version/lang/cy/strings.xml
+++ b/desktop_version/lang/cy/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/de/strings.xml b/desktop_version/lang/de/strings.xml
index 8bc440f81a..922ef2b08a 100644
--- a/desktop_version/lang/de/strings.xml
+++ b/desktop_version/lang/de/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/en/strings.xml b/desktop_version/lang/en/strings.xml
index 86a4217f37..2f5fe398cc 100644
--- a/desktop_version/lang/en/strings.xml
+++ b/desktop_version/lang/en/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/eo/strings.xml b/desktop_version/lang/eo/strings.xml
index 6c08504366..d40600510c 100644
--- a/desktop_version/lang/eo/strings.xml
+++ b/desktop_version/lang/eo/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/es/strings.xml b/desktop_version/lang/es/strings.xml
index 68c8a2468d..95af51fcc1 100644
--- a/desktop_version/lang/es/strings.xml
+++ b/desktop_version/lang/es/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/es_419/strings.xml b/desktop_version/lang/es_419/strings.xml
index 827a3b97f9..dcde51ebbe 100644
--- a/desktop_version/lang/es_419/strings.xml
+++ b/desktop_version/lang/es_419/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/es_AR/strings.xml b/desktop_version/lang/es_AR/strings.xml
index e2cdc45706..4669bd0295 100644
--- a/desktop_version/lang/es_AR/strings.xml
+++ b/desktop_version/lang/es_AR/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/fr/strings.xml b/desktop_version/lang/fr/strings.xml
index 411cc564be..021c29e456 100644
--- a/desktop_version/lang/fr/strings.xml
+++ b/desktop_version/lang/fr/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/ga/strings.xml b/desktop_version/lang/ga/strings.xml
index cbdf99877c..38115d4b13 100644
--- a/desktop_version/lang/ga/strings.xml
+++ b/desktop_version/lang/ga/strings.xml
@@ -233,6 +233,11 @@ Déan cóip chúltaca, ar eagla na heagla." explanation="translation maintenance
+
+
+
+
+
diff --git a/desktop_version/lang/it/strings.xml b/desktop_version/lang/it/strings.xml
index f4798b2b6a..b2aea43242 100644
--- a/desktop_version/lang/it/strings.xml
+++ b/desktop_version/lang/it/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/ja/strings.xml b/desktop_version/lang/ja/strings.xml
index f7fe0042f1..3a2c5ba7fc 100644
--- a/desktop_version/lang/ja/strings.xml
+++ b/desktop_version/lang/ja/strings.xml
@@ -246,6 +246,11 @@ Escキーを押すと表示を終了する。" explanation="" max="38*6" max_loc
+
+
+
+
+
diff --git a/desktop_version/lang/ko/strings.xml b/desktop_version/lang/ko/strings.xml
index e7b69f1f94..131453f3a3 100755
--- a/desktop_version/lang/ko/strings.xml
+++ b/desktop_version/lang/ko/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/nl/strings.xml b/desktop_version/lang/nl/strings.xml
index 6d1aeebc24..12b3de8582 100644
--- a/desktop_version/lang/nl/strings.xml
+++ b/desktop_version/lang/nl/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/pl/strings.xml b/desktop_version/lang/pl/strings.xml
index 059bd1edd8..3dfe2cae22 100644
--- a/desktop_version/lang/pl/strings.xml
+++ b/desktop_version/lang/pl/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/pt_BR/strings.xml b/desktop_version/lang/pt_BR/strings.xml
index 0d084ab8a1..db151e1f5f 100644
--- a/desktop_version/lang/pt_BR/strings.xml
+++ b/desktop_version/lang/pt_BR/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/pt_PT/strings.xml b/desktop_version/lang/pt_PT/strings.xml
index 3d24a84f57..b3d1a9c744 100644
--- a/desktop_version/lang/pt_PT/strings.xml
+++ b/desktop_version/lang/pt_PT/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/ru/strings.xml b/desktop_version/lang/ru/strings.xml
index 04c6476b5e..2c1cf436cc 100644
--- a/desktop_version/lang/ru/strings.xml
+++ b/desktop_version/lang/ru/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/szl/strings.xml b/desktop_version/lang/szl/strings.xml
index 3eadda2581..6aefae606d 100644
--- a/desktop_version/lang/szl/strings.xml
+++ b/desktop_version/lang/szl/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/tr/strings.xml b/desktop_version/lang/tr/strings.xml
index c7cfdf82b7..b80a41fd61 100644
--- a/desktop_version/lang/tr/strings.xml
+++ b/desktop_version/lang/tr/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/uk/strings.xml b/desktop_version/lang/uk/strings.xml
index dbfc81a9c6..047e4ab518 100644
--- a/desktop_version/lang/uk/strings.xml
+++ b/desktop_version/lang/uk/strings.xml
@@ -232,6 +232,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/zh/strings.xml b/desktop_version/lang/zh/strings.xml
index d437c5ba4c..40d263801f 100644
--- a/desktop_version/lang/zh/strings.xml
+++ b/desktop_version/lang/zh/strings.xml
@@ -238,6 +238,11 @@
+
+
+
+
+
diff --git a/desktop_version/lang/zh_TW/strings.xml b/desktop_version/lang/zh_TW/strings.xml
index 157c0cbaaf..62cf319700 100644
--- a/desktop_version/lang/zh_TW/strings.xml
+++ b/desktop_version/lang/zh_TW/strings.xml
@@ -238,6 +238,11 @@
+
+
+
+
+
diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp
index 210145a814..52a1e82812 100644
--- a/desktop_version/src/Entity.cpp
+++ b/desktop_version/src/Entity.cpp
@@ -2732,6 +2732,8 @@ bool entityclass::updateentities( int i )
game.savedir = entities[player].dir;
}
entities[i].state = 0;
+
+ game.checkpoint_save();
}
break;
case 9: //Gravity Lines
diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp
index 1d7bad140c..25131e1a0b 100644
--- a/desktop_version/src/Game.cpp
+++ b/desktop_version/src/Game.cpp
@@ -376,6 +376,12 @@ void Game::init(void)
screenshot_border_timer = 0;
screenshot_saved_success = false;
+#ifdef __ANDROID__
+ checkpoint_saving = true;
+#else
+ checkpoint_saving = false;
+#endif
+
setdefaultcontrollerbuttons();
}
@@ -821,7 +827,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!"));
@@ -829,6 +835,31 @@ 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::checkpoint_save(void)
+{
+ if (checkpoint_saving && !inspecial())
+ {
+ bool success = map.custommode ? customsavequick(cl.ListOfMetaData[playcustomlevel].filename) : savequick();
+ gamesaved = success;
+ gamesavefailed = !success;
+
+ if (gamesavefailed)
+ {
+ show_save_fail();
+ graphics.textboxapplyposition();
+ }
+ }
+}
+
void Game::savetele_textbox(void)
{
if (inspecial() || map.custommode)
@@ -846,11 +877,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();
}
@@ -4936,6 +4963,10 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
roomname_translator::set_enabled(help.Int(pText));
}
+ if (SDL_strcmp(pKey, "checkpoint_saving") == 0)
+ {
+ checkpoint_saving = help.Int(pText);
+ }
}
setdefaultcontrollerbuttons();
@@ -5194,6 +5225,8 @@ void Game::serializesettings(tinyxml2::XMLElement* dataNode, const struct Screen
xml::update_tag(dataNode, "english_sprites", (int) loc::english_sprites);
xml::update_tag(dataNode, "new_level_font", loc::new_level_font.c_str());
xml::update_tag(dataNode, "roomname_translator", (int) roomname_translator::enabled);
+
+ xml::update_tag(dataNode, "checkpoint_saving", (int) checkpoint_saving);
}
static bool settings_loaded = false;
@@ -6852,6 +6885,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
option(loc::gettext("unfocus pause"));
option(loc::gettext("unfocus audio pause"));
option(loc::gettext("room name background"));
+ option(loc::gettext("checkpoint saving"));
option(loc::gettext("return"));
menuyoff = 0;
maxspacing = 15;
diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h
index 362a956ced..21faf747a8 100644
--- a/desktop_version/src/Game.h
+++ b/desktop_version/src/Game.h
@@ -225,6 +225,8 @@ class Game
void crewmate_textbox(const int color);
void remaining_textbox(void);
void actionprompt_textbox(void);
+ void show_save_fail(void);
+ void checkpoint_save(void);
void savetele_textbox(void);
void setstate(int gamestate);
@@ -363,6 +365,7 @@ class Game
int savetrinkets;
bool startscript;
std::string newscript;
+ bool checkpoint_saving;
bool menustart;
diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp
index 468c265aac..c00f736206 100644
--- a/desktop_version/src/Input.cpp
+++ b/desktop_version/src/Input.cpp
@@ -862,6 +862,12 @@ static void menuactionpress(void)
game.savestatsandsettings_menu();
music.playef(Sound_VIRIDIAN);
break;
+ case 3:
+ // toggle checkpoint saving
+ game.checkpoint_saving = !game.checkpoint_saving;
+ game.savestatsandsettings_menu();
+ music.playef(Sound_VIRIDIAN);
+ break;
default:
//back
music.playef(Sound_VIRIDIAN);
diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp
index 20efc8ffd0..252dc53dc3 100644
--- a/desktop_version/src/Render.cpp
+++ b/desktop_version/src/Render.cpp
@@ -1139,6 +1139,7 @@ static void menurender(void)
break;
}
case 2:
+ {
font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Room Name BG"), tr, tg, tb);
int next_y = font::print_wrap(PR_CEN, -1, 65, loc::gettext("Lets you see through what is behind the name at the bottom of the screen."), tr, tg, tb);
if (graphics.translucentroomname)
@@ -1147,6 +1148,21 @@ static void menurender(void)
font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Room name background is OPAQUE"), tr, tg, tb);
break;
}
+ case 3:
+ {
+ 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)
+ {
+ font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Checkpoint saving is OFF"), tr / 2, tg / 2, tb / 2);
+ }
+ else
+ {
+ font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Checkpoint saving is ON"), tr, tg, tb);
+ }
+ break;
+ }
+ }
break;
case Menu::accessibility:
{
diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp
index a58b1735a1..53d4737c9c 100644
--- a/desktop_version/src/Script.cpp
+++ b/desktop_version/src/Script.cpp
@@ -1206,6 +1206,8 @@ void scriptclass::run(void)
{
game.savedir = obj.entities[i].dir;
}
+
+ game.checkpoint_save();
}
else if (words[0] == "gamestate")
{