From db9ee0d8e3662da74a84fdc6c56e67263244e349 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 19 Mar 2021 20:08:41 -0700 Subject: [PATCH] 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. --- desktop_version/src/Script.cpp | 6 ++++-- desktop_version/src/Script.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 5972dd07..8b5dc23a 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -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++) diff --git a/desktop_version/src/Script.h b/desktop_version/src/Script.h index 63f37f8f..893b2adb 100644 --- a/desktop_version/src/Script.h +++ b/desktop_version/src/Script.h @@ -60,6 +60,7 @@ public: int textx; int texty; int r,g,b; + bool textflipme; //Misc int i, j, k;