From ed0c9b6b1f8d869e2b72b31688805331d85db0dc Mon Sep 17 00:00:00 2001 From: Dav999 Date: Wed, 3 Jan 2024 20:43:37 +0100 Subject: [PATCH] Add setrtl(on/off) scripting command With the tag (which doesn't indicate RTL-ness as explained), we've had a setfont(font) scripting command. Now we have an tag, so we need a setrtl(on/off) command too to control that. --- desktop_version/src/Script.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 4f6f8bfd..8207f7ac 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -2475,7 +2475,7 @@ void scriptclass::run(void) position--; } } - else if (words[0] == "setfont") + else if (words[0] == "setfont" || words[0] == "setrtl") { // If any textbox is currently fading out, wait for that first bool blocked = false; @@ -2492,7 +2492,18 @@ void scriptclass::run(void) if (!blocked) { - if (words[1] == "") + if (words[0] == "setrtl") + { + if (words[1] == "on") + { + cl.rtl = true; + } + else if (words[1] == "off") + { + cl.rtl = false; + } + } + else if (words[1] == "") { font::set_level_font(cl.level_font_name.c_str()); } @@ -3528,6 +3539,9 @@ bool scriptclass::loadcustom(const std::string& t) }else if(words[0] == "setfont"){ if(customtextmode==1){ add("endtext"); customtextmode=0;} add(lines[i]); + }else if(words[0] == "setrtl"){ + if(customtextmode==1){ add("endtext"); customtextmode=0;} + add(lines[i]); }else if(words[0] == "destroy"){ if(customtextmode==1){ add("endtext"); customtextmode=0;} add(lines[i]);