mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Fix script error, only show touch tutorial once
This commit is contained in:
parent
dc04fccf71
commit
c6dd712376
4 changed files with 30 additions and 10 deletions
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -2528,6 +2528,8 @@ void scriptclass::run(void)
|
||||||
graphics.foregrounddrawn = false;
|
graphics.foregrounddrawn = false;
|
||||||
}
|
}
|
||||||
else if (words[0] == "controls")
|
else if (words[0] == "controls")
|
||||||
|
{
|
||||||
|
if (!game.seen_touch_tutorial)
|
||||||
{
|
{
|
||||||
game.tutorial_mode = true;
|
game.tutorial_mode = true;
|
||||||
game.tutorial_state = 0;
|
game.tutorial_state = 0;
|
||||||
|
@ -2537,13 +2539,22 @@ void scriptclass::run(void)
|
||||||
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.seen_touch_tutorial)
|
||||||
{
|
{
|
||||||
if (game.tutorial_mode)
|
if (game.tutorial_mode)
|
||||||
{
|
{
|
||||||
scriptdelay = 1;
|
scriptdelay = 1;
|
||||||
position--;
|
position--;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
game.seen_touch_tutorial = true;
|
||||||
|
game.savesettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (words[0] == "setbars")
|
else if (words[0] == "setbars")
|
||||||
{
|
{
|
||||||
|
|
|
@ -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)",
|
||||||
|
|
Loading…
Reference in a new issue