Skip to content

Commit

Permalink
- handle generic fonts on the summary screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Apr 11, 2019
1 parent 6a3bc71 commit 9f5b000
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 32 deletions.
6 changes: 3 additions & 3 deletions wadsrc/static/mapinfo/chex.txt
Expand Up @@ -64,9 +64,9 @@ gameinfo
textscreeny = 10
defaultendsequence = "Inter_Pic1"
maparrow = "maparrows/arrow.txt", "maparrows/ddtarrow.txt"
statscreen_mapnamefont = "BigFont"
statscreen_finishedfont = "BigFont", "green"
statscreen_enteringfont = "BigFont", "green"
statscreen_mapnamefont = "*BigFont"
statscreen_finishedfont = "*BigFont", "green"
statscreen_enteringfont = "*BigFont", "green"
statscreen_coop = "CoopStatusScreen"
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "DoomStatusScreen"
Expand Down
6 changes: 3 additions & 3 deletions wadsrc/static/mapinfo/doomcommon.txt
Expand Up @@ -64,9 +64,9 @@ gameinfo
textscreeny = 10
defaultendsequence = "Inter_Cast"
maparrow = "maparrows/arrow.txt", "maparrows/ddtarrow.txt"
statscreen_mapnamefont = "BigFont"
statscreen_finishedfont = "BigFont", "red"
statscreen_enteringfont = "BigFont", "red"
statscreen_mapnamefont = "*BigFont"
statscreen_finishedfont = "*BigFont", "red"
statscreen_enteringfont = "*BigFont", "red"
statscreen_coop = "CoopStatusScreen"
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "DoomStatusScreen"
Expand Down
6 changes: 3 additions & 3 deletions wadsrc/static/mapinfo/heretic.txt
Expand Up @@ -63,9 +63,9 @@ gameinfo
textscreeny = 5
defaultendsequence = "Inter_Pic1"
maparrow = "maparrows/dagger.txt"
statscreen_mapnamefont = "BigFont"
statscreen_finishedfont = "SmallFont"
statscreen_enteringfont = "SmallFont"
statscreen_mapnamefont = "*BigFont"
statscreen_finishedfont = "*SmallFont"
statscreen_enteringfont = "*SmallFont"
statscreen_coop = "CoopStatusScreen"
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "RavenStatusScreen"
Expand Down
6 changes: 3 additions & 3 deletions wadsrc/static/mapinfo/hexen.txt
Expand Up @@ -61,9 +61,9 @@ gameinfo
textscreeny = 5
defaultendsequence = "Inter_Chess"
maparrow = "maparrows/dagger.txt"
statscreen_mapnamefont = "BigFont"
statscreen_finishedfont = "SmallFont"
statscreen_enteringfont = "SmallFont"
statscreen_mapnamefont = "*BigFont"
statscreen_finishedfont = "*SmallFont"
statscreen_enteringfont = "*SmallFont"
statscreen_coop = "CoopStatusScreen"
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "RavenStatusScreen"
Expand Down
6 changes: 3 additions & 3 deletions wadsrc/static/mapinfo/mindefaults.txt
Expand Up @@ -54,9 +54,9 @@ gameinfo
textscreeny = 10
defaultendsequence = "Inter_Cast"
maparrow = "maparrows/arrow.txt", "maparrows/ddtarrow.txt"
statscreen_mapnamefont = "BigFont"
statscreen_finishedfont = "BigFont"
statscreen_enteringfont = "BigFont"
statscreen_mapnamefont = "*BigFont"
statscreen_finishedfont = "*BigFont"
statscreen_enteringfont = "*BigFont"
messageboxclass = "MessageBoxMenu"
}

Expand Down
6 changes: 3 additions & 3 deletions wadsrc/static/mapinfo/strife.txt
Expand Up @@ -62,9 +62,9 @@ gameinfo
textscreeny = 10
defaultendsequence = "Inter_Strife"
maparrow = "maparrows/arrow.txt", "maparrows/ddtarrow.txt"
statscreen_mapnamefont = "BigFont"
statscreen_finishedfont = "BigFont", "white"
statscreen_enteringfont = "BigFont", "white"
statscreen_mapnamefont = "*BigFont"
statscreen_finishedfont = "*BigFont", "white"
statscreen_enteringfont = "*BigFont", "white"
statscreen_coop = "CoopStatusScreen"
statscreen_dm = "DeathmatchStatusScreen"
statscreen_single = "RavenStatusScreen"
Expand Down
14 changes: 13 additions & 1 deletion wadsrc/static/zscript/ui/statscreen/statscreen.zs
Expand Up @@ -17,7 +17,19 @@ struct PatchInfo play version("2.5")

void Init(GIFont gifont)
{
mFont = Font.GetFont(gifont.fontname);
// Replace with the VGA-Unicode font if needed.
// The default settings for this are marked with a *.
// If some mod changes this it is assumed that it doesn't provide any localization for the map name in a language not supported by the font.
String s = gifont.fontname;
if (s.CharAt(0) != "*")
mFont = Font.GetFont(gifont.fontname);
else if (generic_ui)
mFont = NewSmallFont;
else
{
s = s.Mid(1);
mFont = Font.GetFont(s);
}
mColor = Font.FindFontColor(gifont.color);
if (mFont == NULL)
{
Expand Down
28 changes: 15 additions & 13 deletions wadsrc/static/zscript/ui/statscreen/statscreen_sp.zs
Expand Up @@ -150,7 +150,7 @@ class DoomStatusScreen : StatusScreen
let tcolor = useGfx? Font.CR_UNTRANSLATED : Font.CR_RED;

Font printFont;

Font textFont = generic_ui? NewSmallFont : BigFont;
if (useGfx)
{
printFont = IntermissionFont;
Expand All @@ -162,12 +162,12 @@ class DoomStatusScreen : StatusScreen
}
else
{
printFont = BigFont;
screen.DrawText (BigFont, tcolor, SP_STATSX, SP_STATSY, "$TXT_IMKILLS", DTA_Clean, true);
screen.DrawText (BigFont, tcolor, SP_STATSX, SP_STATSY+lh, "$TXT_IMITEMS", DTA_Clean, true);
screen.DrawText (BigFont, tcolor, SP_STATSX, SP_STATSY+2*lh, "$TXT_IMSECRETS", DTA_Clean, true);
screen.DrawText (BigFont, tcolor, SP_TIMEX, SP_TIMEY, "$TXT_IMTIME", DTA_Clean, true);
if (wbs.partime) screen.DrawText (BigFont, tcolor, 160 + SP_TIMEX, SP_TIMEY, "$TXT_IMPAR", DTA_Clean, true);
printFont = generic_ui? IntermissionFont : BigFont;
screen.DrawText (textFont, tcolor, SP_STATSX, SP_STATSY, "$TXT_IMKILLS", DTA_Clean, true);
screen.DrawText (textFont, tcolor, SP_STATSX, SP_STATSY+lh, "$TXT_IMITEMS", DTA_Clean, true);
screen.DrawText (textFont, tcolor, SP_STATSX, SP_STATSY+2*lh, "$TXT_IMSECRETS", DTA_Clean, true);
screen.DrawText (textFont, tcolor, SP_TIMEX, SP_TIMEY, "$TXT_IMTIME", DTA_Clean, true);
if (wbs.partime) screen.DrawText (textFont, tcolor, 160 + SP_TIMEX, SP_TIMEY, "$TXT_IMPAR", DTA_Clean, true);
}

drawPercent (printFont, 320 - SP_STATSX, SP_STATSY, cnt_kills[0], wbs.maxkills, true, tcolor);
Expand All @@ -189,7 +189,7 @@ class DoomStatusScreen : StatusScreen
}
else
{
screen.DrawText (printFont, Font.CR_UNTRANSLATED, x - printFont.StringWidth("$TXT_IMSUCKS"), y - printFont.GetHeight() - 2, "$TXT_IMSUCKS", DTA_Clean, true);
screen.DrawText (textFont, Font.CR_UNTRANSLATED, x - printFont.StringWidth("$TXT_IMSUCKS"), y - printFont.GetHeight() - 2, "$TXT_IMSUCKS", DTA_Clean, true);
}
}

Expand All @@ -209,10 +209,12 @@ class RavenStatusScreen : DoomStatusScreen
int lh = IntermissionFont.GetHeight() * 3 / 2;

drawLF();

screen.DrawText (BigFont, Font.CR_UNTRANSLATED, 50, 65, "$TXT_IMKILLS", DTA_Clean, true, DTA_Shadow, true);
screen.DrawText (BigFont, Font.CR_UNTRANSLATED, 50, 90, "$TXT_IMITEMS", DTA_Clean, true, DTA_Shadow, true);
screen.DrawText (BigFont, Font.CR_UNTRANSLATED, 50, 115, "$TXT_IMSECRETS", DTA_Clean, true, DTA_Shadow, true);

Font textFont = generic_ui? NewSmallFont : BigFont;

screen.DrawText (textFont, Font.CR_UNTRANSLATED, 50, 65, "$TXT_IMKILLS", DTA_Clean, true, DTA_Shadow, true);
screen.DrawText (textFont, Font.CR_UNTRANSLATED, 50, 90, "$TXT_IMITEMS", DTA_Clean, true, DTA_Shadow, true);
screen.DrawText (textFont, Font.CR_UNTRANSLATED, 50, 115, "$TXT_IMSECRETS", DTA_Clean, true, DTA_Shadow, true);

int countpos = gameinfo.gametype==GAME_Strife? 285:270;
if (sp_state >= 2)
Expand All @@ -229,7 +231,7 @@ class RavenStatusScreen : DoomStatusScreen
}
if (sp_state >= 8)
{
screen.DrawText (BigFont, Font.CR_UNTRANSLATED, 85, 160, "$TXT_IMTIME", DTA_Clean, true, DTA_Shadow, true);
screen.DrawText (textFont, Font.CR_UNTRANSLATED, 85, 160, "$TXT_IMTIME", DTA_Clean, true, DTA_Shadow, true);
drawTime (249, 160, cnt_time);
if (wi_showtotaltime)
{
Expand Down

0 comments on commit 9f5b000

Please sign in to comment.