diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 0f2b9164..c6524bfb 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -395,6 +395,8 @@ void Game::init(void) tutorial_screen_pos = 0; tutorial_touch_timer = 0; tutorial_flip = 0; + + seen_touch_tutorial = false; } void Game::setdefaultcontrollerbuttons(void) @@ -4992,6 +4994,11 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett { checkpoint_saving = help.Int(pText); } + + if (SDL_strcmp(pKey, "seen_touch_tutorial") == 0) + { + seen_touch_tutorial = help.Int(pText); + } } setdefaultcontrollerbuttons(); @@ -5255,6 +5262,7 @@ void Game::serializesettings(tinyxml2::XMLElement* dataNode, const struct Screen xml::update_tag(dataNode, "roomname_translator", (int) roomname_translator::enabled); xml::update_tag(dataNode, "checkpoint_saving", (int) checkpoint_saving); + xml::update_tag(dataNode, "seen_touch_tutorial", (int) seen_touch_tutorial); } static bool settings_loaded = false; diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index a28f0cba..092f00bb 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -620,6 +620,8 @@ public: int tutorial_screen_pos; int tutorial_touch_timer; int tutorial_flip; + + bool seen_touch_tutorial; }; #ifndef GAME_DEFINITION diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index bf1ae6a7..81db2a44 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -2529,20 +2529,31 @@ void scriptclass::run(void) } else if (words[0] == "controls") { - game.tutorial_mode = true; - game.tutorial_state = 0; - game.tutorial_timer = 0; + if (!game.seen_touch_tutorial) + { + game.tutorial_mode = true; + game.tutorial_state = 0; + game.tutorial_timer = 0; - game.tutorial_screen_pos = 0; - game.tutorial_touch_timer = 0; - game.tutorial_flip = 0; + game.tutorial_screen_pos = 0; + game.tutorial_touch_timer = 0; + game.tutorial_flip = 0; + } } else if (words[0] == "untilcontrols") { - if (game.tutorial_mode) + if (!game.seen_touch_tutorial) { - scriptdelay = 1; - position--; + if (game.tutorial_mode) + { + scriptdelay = 1; + position--; + } + else + { + game.seen_touch_tutorial = true; + game.savesettings(); + } } } else if (words[0] == "setbars") diff --git a/desktop_version/src/Scripts.cpp b/desktop_version/src/Scripts.cpp index 7b68fcdc..bd45f56d 100644 --- a/desktop_version/src/Scripts.cpp +++ b/desktop_version/src/Scripts.cpp @@ -226,7 +226,6 @@ bool scriptclass::load(const std::string& name) "setbars(320)", "delay(45)", // 100 frames total - "changemood(player,1)", "befadein()", "shake(20)", "playef(10)",