Switch flipme script command to use flipme textbox attribute

This is why the text box attribute was named flipme, after all.

You may have noticed that the flipme command inverts textflipme instead
of simply setting it to true. Well, that's because it should be the same
as the previous behavior, which was essentially to invert it instead of
setting it to true - i.e. calling flipme twice would keep the original
text box position in Flip Mode, which means it would be upside-down
(this is a lot of flipping to keep track of...) - because flipme added
to texty in-place instead of simply assigning to it. (It did the
calculation incorrectly in 2.2 and previous, but I digress.)

Similarly, textflipme is not reset in hardreset(), because none of the
other script text box variables are reset either.
This commit is contained in:
Misa authored and Ethan Lee committed 2021-03-21 02:53:25 -04:00
1 parent 6939563e6d
commit db9ee0d8e3
2 files changed
+5 -2

No files matched your search

+4 -2
View File
@@ -30,6 +30,7 @@ scriptclass::scriptclass(void)
r = 0;
textx = 0;
texty = 0;
textflipme = false;
}
void scriptclass::clearcustom(void)
@@ -624,7 +625,7 @@ void scriptclass::run(void)
}
else if (words[0] == "flipme")
{
if(graphics.flipmode) texty += 2*(120 - texty) - 8*(txt.size()+2);
textflipme = !textflipme;
}
else if (words[0] == "speak_active" || words[0] == "speak")
{
@@ -634,7 +635,8 @@ void scriptclass::run(void)
{
txt.resize(1);
}
graphics.createtextbox(txt[0], textx, texty, r, g, b);
graphics.createtextboxreal(txt[0], textx, texty, r, g, b, textflipme);
textflipme = false;
if ((int) txt.size() > 1)
{
for (i = 1; i < (int) txt.size(); i++)
+1
View File
@@ -60,6 +60,7 @@ public:
int textx;
int texty;
int r,g,b;
bool textflipme;
//Misc
int i, j, k;