- added a CanPrint function to FFont and used that to handle the statistics display on the automap HUD to only replace the font when actually needed, not based on the language.
This commit is contained in:
parent
68c33a6e43
commit
e0a0be4f7b
8 changed files with 119 additions and 29 deletions
|
|
@ -2021,6 +2021,19 @@ DEFINE_ACTION_FUNCTION_NATIVE(FFont, StringWidth, StringWidth)
|
|||
ACTION_RETURN_INT(StringWidth(self, str));
|
||||
}
|
||||
|
||||
static int CanPrint(FFont *font, const FString &str)
|
||||
{
|
||||
const char *txt = str[0] == '$' ? GStrings(&str[1]) : str.GetChars();
|
||||
return font->CanPrint(txt);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(FFont, CanPrint, CanPrint)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FFont);
|
||||
PARAM_STRING(str);
|
||||
ACTION_RETURN_INT(CanPrint(self, str));
|
||||
}
|
||||
|
||||
static int FindFontColor(int name)
|
||||
{
|
||||
return V_FindFontColor(ENamedName(name));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue