mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- use Unicode font for deathmatch summary screen to bring it in line with the coop version.
This commit is contained in:
parent
f1408bfb5b
commit
7a01b6b0d4
3 changed files with 32 additions and 23 deletions
|
@ -41,7 +41,7 @@ class os_SearchField : OptionMenuItemTextField
|
||||||
override String Represent()
|
override String Represent()
|
||||||
{
|
{
|
||||||
return mEnter
|
return mEnter
|
||||||
? mEnter.GetText() .. SmallFont.GetCursor()
|
? mEnter.GetText() .. NewSmallFont.GetCursor()
|
||||||
: mText;
|
: mText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class CoopStatusScreen : StatusScreen
|
||||||
acceleratestage = 0;
|
acceleratestage = 0;
|
||||||
ng_state = 1;
|
ng_state = 1;
|
||||||
displayFont = NewSmallFont;
|
displayFont = NewSmallFont;
|
||||||
FontScale = max(screen.GetHeight() / 480, 1);
|
FontScale = max(screen.GetHeight() / 400, 1);
|
||||||
RowHeight = int(max((displayFont.GetHeight() + 1) * FontScale, 1));
|
RowHeight = int(max((displayFont.GetHeight() + 1) * FontScale, 1));
|
||||||
|
|
||||||
cnt_pause = Thinker.TICRATE;
|
cnt_pause = Thinker.TICRATE;
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
class DeathmatchStatusScreen : StatusScreen
|
class DeathmatchStatusScreen : StatusScreen
|
||||||
{
|
{
|
||||||
int textcolor;
|
int textcolor;
|
||||||
|
double FontScale;
|
||||||
|
int RowHeight;
|
||||||
|
Font displayFont;
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
//
|
//
|
||||||
|
@ -13,10 +16,14 @@ class DeathmatchStatusScreen : StatusScreen
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
textcolor = (gameinfo.gametype & GAME_Raven) ? Font.CR_GREEN : Font.CR_UNTRANSLATED;
|
textcolor = Font.CR_GRAY;
|
||||||
|
|
||||||
CurState = StatCount;
|
CurState = StatCount;
|
||||||
acceleratestage = 0;
|
acceleratestage = 0;
|
||||||
|
displayFont = NewSmallFont;
|
||||||
|
FontScale = max(screen.GetHeight() / 400, 1);
|
||||||
|
RowHeight = max((displayFont.GetHeight() + 1) * FontScale, 1);
|
||||||
|
|
||||||
for(i = 0; i < MAXPLAYERS; i++)
|
for(i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
playerready[i] = false;
|
playerready[i] = false;
|
||||||
|
@ -160,7 +167,7 @@ class DeathmatchStatusScreen : StatusScreen
|
||||||
Vector2 readyoffset = TexMan.GetScaledOffset(readyico);
|
Vector2 readyoffset = TexMan.GetScaledOffset(readyico);
|
||||||
height = int(readysize.Y - readyoffset.Y);
|
height = int(readysize.Y - readyoffset.Y);
|
||||||
maxiconheight = MAX(height, maxiconheight);
|
maxiconheight = MAX(height, maxiconheight);
|
||||||
height = SmallFont.GetHeight() * CleanYfac;
|
height = displayFont.GetHeight() * FontScale;
|
||||||
lineheight = MAX(height, maxiconheight * CleanYfac);
|
lineheight = MAX(height, maxiconheight * CleanYfac);
|
||||||
ypadding = (lineheight - height + 1) / 2;
|
ypadding = (lineheight - height + 1) / 2;
|
||||||
y += CleanYfac;
|
y += CleanYfac;
|
||||||
|
@ -169,10 +176,10 @@ class DeathmatchStatusScreen : StatusScreen
|
||||||
//text_color = Stringtable.Localize("$SCORE_COLOR");
|
//text_color = Stringtable.Localize("$SCORE_COLOR");
|
||||||
text_frags = Stringtable.Localize("$SCORE_FRAGS");
|
text_frags = Stringtable.Localize("$SCORE_FRAGS");
|
||||||
|
|
||||||
icon_x = 8 * CleanXfac;
|
icon_x = 8 * FontScale;
|
||||||
name_x = icon_x + maxscorewidth * CleanXfac;
|
name_x = icon_x + maxscorewidth * FontScale;
|
||||||
frags_x = name_x + (maxnamewidth + MAX(SmallFont.StringWidth("XXXXX"), SmallFont.StringWidth(text_frags)) + 8) * CleanXfac;
|
frags_x = name_x + (maxnamewidth + 1 + MAX(displayFont.StringWidth("XXXXXXXXXX"), displayFont.StringWidth(text_frags)) + 16) * FontScale;
|
||||||
deaths_x = frags_x + ((deaths_len = SmallFont.StringWidth(text_deaths)) + 8) * CleanXfac;
|
deaths_x = frags_x + ((deaths_len = displayFont.StringWidth(text_deaths)) + 16) * FontScale;
|
||||||
|
|
||||||
x = (Screen.GetWidth() - deaths_x) >> 1;
|
x = (Screen.GetWidth() - deaths_x) >> 1;
|
||||||
icon_x += x;
|
icon_x += x;
|
||||||
|
@ -180,10 +187,10 @@ class DeathmatchStatusScreen : StatusScreen
|
||||||
frags_x += x;
|
frags_x += x;
|
||||||
deaths_x += x;
|
deaths_x += x;
|
||||||
|
|
||||||
screen.DrawText(SmallFont, textcolor, name_x, y, Stringtable.Localize("$SCORE_NAME"), DTA_CleanNoMove, true);
|
drawTextScaled(displayFont, name_x, y, Stringtable.Localize("$SCORE_NAME"), FontScale, textcolor);
|
||||||
screen.DrawText(SmallFont, textcolor, frags_x - SmallFont.StringWidth(text_frags) * CleanXfac, y, text_frags, DTA_CleanNoMove, true);
|
drawTextScaled(displayFont, frags_x - displayFont.StringWidth(text_frags) * FontScale, y, text_frags, FontScale, textcolor);
|
||||||
screen.DrawText(SmallFont, textcolor, deaths_x - deaths_len * CleanXfac, y, text_deaths, DTA_CleanNoMove, true);
|
drawTextScaled(displayFont, deaths_x - deaths_len * FontScale, y, text_deaths, FontScale, textcolor);
|
||||||
y += height + 6 * CleanYfac;
|
y += height + 6 * FontScale;
|
||||||
|
|
||||||
// Sort all players
|
// Sort all players
|
||||||
Array<int> sortedplayers;
|
Array<int> sortedplayers;
|
||||||
|
@ -208,22 +215,25 @@ class DeathmatchStatusScreen : StatusScreen
|
||||||
{
|
{
|
||||||
screen.DrawTexture(player.mo.ScoreIcon, true, icon_x, y, DTA_CleanNoMove, true);
|
screen.DrawTexture(player.mo.ScoreIcon, true, icon_x, y, DTA_CleanNoMove, true);
|
||||||
}
|
}
|
||||||
screen.DrawText(SmallFont, thiscolor, name_x, y + ypadding, player.GetUserName(), DTA_CleanNoMove, true);
|
|
||||||
drawNum(SmallFont, frags_x, y + ypadding, cnt_frags[pnum], 0, false, thiscolor, true);
|
drawTextScaled(displayFont, name_x, y + ypadding, player.GetUserName(), FontScale, thiscolor);
|
||||||
|
drawNumScaled(displayFont, frags_x, y + ypadding, FontScale, cnt_frags[pnum], 0, textcolor);
|
||||||
|
|
||||||
if (ng_state >= 2)
|
if (ng_state >= 2)
|
||||||
{
|
{
|
||||||
drawNum(SmallFont, deaths_x, y + ypadding, cnt_deaths[pnum], 0, false, thiscolor, true);
|
drawNumScaled(displayFont, deaths_x, y + ypadding, FontScale, cnt_deaths[pnum], 0, textcolor);
|
||||||
}
|
}
|
||||||
y += lineheight + CleanYfac;
|
y += lineheight + CleanYfac;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw "TOTAL" line
|
// Draw "TOTAL" line
|
||||||
y += height + 3 * CleanYfac;
|
y += height + 3 * CleanYfac;
|
||||||
screen.DrawText(SmallFont, textcolor, name_x, y, Stringtable.Localize("$SCORE_TOTAL"), DTA_CleanNoMove, true);
|
drawTextScaled(displayFont, name_x, y, Stringtable.Localize("$SCORE_TOTAL"), FontScale, textcolor);
|
||||||
drawNum(SmallFont, frags_x, y, total_frags, 0, false, textcolor, true);
|
drawNumScaled(displayFont, frags_x, y, FontScale, total_frags, 0, textcolor);
|
||||||
|
|
||||||
if (ng_state >= 4)
|
if (ng_state >= 4)
|
||||||
{
|
{
|
||||||
drawNum(SmallFont, deaths_x, y, total_deaths, 0, false, textcolor, true);
|
drawNumScaled(displayFont, deaths_x, y, FontScale, total_deaths, 0, textcolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw game time
|
// Draw game time
|
||||||
|
@ -235,7 +245,6 @@ class DeathmatchStatusScreen : StatusScreen
|
||||||
seconds = seconds % 60;
|
seconds = seconds % 60;
|
||||||
|
|
||||||
String leveltime = Stringtable.Localize("$SCORE_LVLTIME") .. ": " .. String.Format("%02i:%02i:%02i", hours, minutes, seconds);
|
String leveltime = Stringtable.Localize("$SCORE_LVLTIME") .. ": " .. String.Format("%02i:%02i:%02i", hours, minutes, seconds);
|
||||||
|
drawTextScaled(displayFont, x, y, leveltime, FontScale, textcolor);
|
||||||
screen.DrawText(SmallFont, textcolor, x, y, leveltime, DTA_CleanNoMove, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue