- Shadow Warrior as well.

For the cookie text display with international characters the text font is used with 50% size to make it fit the available space.
This commit is contained in:
Christoph Oelckers 2020-09-29 22:46:50 +02:00
parent e8cd336f86
commit 75281de42e
2 changed files with 25 additions and 4 deletions

View file

@ -933,11 +933,10 @@ private:
stats.letterColor = CR_RED;
stats.standardColor = CR_UNTRANSLATED;
stats.time = Scale(leveltime, 1000, 30);
am_textfont = true; // Exhumed has no fallback.
if (automapMode == am_full)
{
DBaseStatusBar::PrintAutomapInfo(stats);
DBaseStatusBar::PrintAutomapInfo(stats, true);
}
else if (hud_stats)
{

View file

@ -951,13 +951,22 @@ private:
{
stats.letterColor = CR_SAPPHIRE;
stats.standardColor = CR_UNTRANSLATED;
bool textfont = am_textfont;
if (!am_textfont)
{
// For non-English languages force use of the text font. The tiny one is simply too small to ever add localized characters to it.
auto p = GStrings["REQUIRED_CHARACTERS"];
if (p && *p) textfont = true;
}
if (!textfont)
{
stats.font = SmallFont2;
stats.spacing = 6;
}
else stats.spacing = SmallFont->GetHeight() + 1;
DBaseStatusBar::PrintAutomapInfo(stats);
DBaseStatusBar::PrintAutomapInfo(stats, textfont);
}
// JBF 20040124: display level stats in screen corner
else if (hud_stats && !(CommEnabled || numplayers > 1))
@ -1052,6 +1061,15 @@ static void UpdateFrame(void)
//
//---------------------------------------------------------------------------
void DrawConString(int x, int y, const char* string, double alpha)
{
x = x * 2 - SmallFont->StringWidth(string) / 2;
y *= 2;
DrawText(twod, SmallFont, CR_TAN, x, y, string, DTA_FullscreenScale, FSMode_Fit640x400, DTA_Alpha, alpha, TAG_DONE);
}
void UpdateStatusBar()
{
DSWStatusBar sbar;
@ -1066,7 +1084,11 @@ void UpdateStatusBar()
if (pp->cookieTime > 0)
{
const int MESSAGE_LINE = 142; // Used to be 164
MNU_DrawSmallString(160, MESSAGE_LINE, pp->cookieQuote, 0, 0, 0, clamp(pp->cookieTime / 60., 0., 1.));
if (!SmallFont2->CanPrint(pp->cookieQuote))
DrawConString(160, MESSAGE_LINE, pp->cookieQuote, clamp(pp->cookieTime / 60., 0., 1.));
else
MNU_DrawSmallString(160, MESSAGE_LINE, pp->cookieQuote, 0, 0, 0, clamp(pp->cookieTime / 60., 0., 1.));
}
}