1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 01:29:43 +01:00

Add setrtl(on/off) scripting command

With the <font> tag (which doesn't indicate RTL-ness as explained),
we've had a setfont(font) scripting command. Now we have an <rtl>
tag, so we need a setrtl(on/off) command too to control that.
This commit is contained in:
Dav999 2024-01-03 20:43:37 +01:00 committed by Misa Elizabeth Kai
parent 29e2b19698
commit ed0c9b6b1f

View file

@ -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]);