Use .clear() when removing text boxes in reset functions

graphics.textbox.clear() should be used instead of
graphics.textboxremove() or graphics.textboxremovefast(), because even
with graphics.textboxremovefast(), you'll still have to process at least
one frame of GAMEMODE logic before the text boxes are actually properly
removed, and this caused a 1-frame glitch when exiting playtesting with
text boxes on-screen and then re-entering playtesting.

Technically I could've only fixed it in Game::returntoeditor(), but I
wanted to be safe, so I also fixed it in scriptclass::hardreset(), too.
This commit is contained in:
Misa authored and Ethan Lee committed 2020-07-15 11:45:28 -04:00
1 parent 7fada0548b
commit 846c6f61d4
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -7298,7 +7298,7 @@ void Game::returntoeditor()
{
game.gamestate = EDITORMODE;
graphics.textboxremove();
graphics.textbox.clear();
game.hascontrol = true;
game.advancetext = false;
game.completestop = false;
+1 -1
View File
@@ -3648,7 +3648,7 @@ void scriptclass::hardreset()
//dwgraphicsclass
graphics.backgrounddrawn = false;
graphics.textboxremovefast();
graphics.textbox.clear();
graphics.flipmode = false; //This will be reset if needs be elsewhere
graphics.showcutscenebars = false;
graphics.cutscenebarspos = 0;