1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Fix script error, only show touch tutorial once

This commit is contained in:
NyakoFox 2024-10-04 19:54:19 -03:00
parent dc04fccf71
commit c6dd712376
4 changed files with 30 additions and 10 deletions

View file

@ -395,6 +395,8 @@ void Game::init(void)
tutorial_screen_pos = 0; tutorial_screen_pos = 0;
tutorial_touch_timer = 0; tutorial_touch_timer = 0;
tutorial_flip = 0; tutorial_flip = 0;
seen_touch_tutorial = false;
} }
void Game::setdefaultcontrollerbuttons(void) void Game::setdefaultcontrollerbuttons(void)
@ -4992,6 +4994,11 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
{ {
checkpoint_saving = help.Int(pText); checkpoint_saving = help.Int(pText);
} }
if (SDL_strcmp(pKey, "seen_touch_tutorial") == 0)
{
seen_touch_tutorial = help.Int(pText);
}
} }
setdefaultcontrollerbuttons(); 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, "roomname_translator", (int) roomname_translator::enabled);
xml::update_tag(dataNode, "checkpoint_saving", (int) checkpoint_saving); 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; static bool settings_loaded = false;

View file

@ -620,6 +620,8 @@ public:
int tutorial_screen_pos; int tutorial_screen_pos;
int tutorial_touch_timer; int tutorial_touch_timer;
int tutorial_flip; int tutorial_flip;
bool seen_touch_tutorial;
}; };
#ifndef GAME_DEFINITION #ifndef GAME_DEFINITION

View file

@ -2529,20 +2529,31 @@ void scriptclass::run(void)
} }
else if (words[0] == "controls") else if (words[0] == "controls")
{ {
game.tutorial_mode = true; if (!game.seen_touch_tutorial)
game.tutorial_state = 0; {
game.tutorial_timer = 0; game.tutorial_mode = true;
game.tutorial_state = 0;
game.tutorial_timer = 0;
game.tutorial_screen_pos = 0; game.tutorial_screen_pos = 0;
game.tutorial_touch_timer = 0; game.tutorial_touch_timer = 0;
game.tutorial_flip = 0; game.tutorial_flip = 0;
}
} }
else if (words[0] == "untilcontrols") else if (words[0] == "untilcontrols")
{ {
if (game.tutorial_mode) if (!game.seen_touch_tutorial)
{ {
scriptdelay = 1; if (game.tutorial_mode)
position--; {
scriptdelay = 1;
position--;
}
else
{
game.seen_touch_tutorial = true;
game.savesettings();
}
} }
} }
else if (words[0] == "setbars") else if (words[0] == "setbars")

View file

@ -226,7 +226,6 @@ bool scriptclass::load(const std::string& name)
"setbars(320)", "setbars(320)",
"delay(45)", // 100 frames total "delay(45)", // 100 frames total
"changemood(player,1)",
"befadein()", "befadein()",
"shake(20)", "shake(20)",
"playef(10)", "playef(10)",