Add setfont scripting command

The <font> in the level file is basically the starting font, but it can
be changed at any time via scripting.
This commit is contained in:
Dav999-v
2023-01-20 04:57:06 +01:00
committed by Misa Elizabeth Kai
parent 7db0e73109
commit cc6b00a711
4 changed files with 21 additions and 1 deletions

View File

@@ -2424,6 +2424,19 @@ void scriptclass::run(void)
position--;
}
}
else if (words[0] == "setfont")
{
#ifndef NO_CUSTOM_LEVELS
if (words[1] == "")
{
font::set_custom_font(cl.level_font_name.c_str());
}
else
{
font::set_custom_font(words[1].c_str());
}
#endif
}
position++;
}
@@ -3433,6 +3446,9 @@ bool scriptclass::loadcustom(const std::string& t)
}else if(words[0] == "loadtext"){
if(customtextmode==1){ add("endtext"); customtextmode=0;}
add(lines[i]);
}else if(words[0] == "setfont"){
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]);