- fixed layout of summary screen.

This commit is contained in:
Christoph Oelckers 2019-02-21 00:16:48 +01:00
parent 6a742f8d34
commit 8bdbd2e915
5 changed files with 38 additions and 39 deletions

View file

@ -667,7 +667,7 @@ void MapLoader::FloodSectorStacks()
for (auto section : HandledSections)
{
if (section->sector != &sector)
Printf("Marked section of sector %d for ceiling portal\n", section->sector->Index());
DPrintf(DMSG_NOTIFY, "Marked section of sector %d for ceiling portal\n", section->sector->Index());
section->flags |= FSection::DONTRENDERCEILING;
}
}
@ -688,7 +688,7 @@ void MapLoader::FloodSectorStacks()
for (auto section : HandledSections)
{
if (section->sector != &sector)
Printf("Marked section of sector %d for floor portal\n", section->sector->Index());
DPrintf(DMSG_NOTIFY, "Marked section of sector %d for floor portal\n", section->sector->Index());
section->flags |= FSection::DONTRENDERFLOOR;
}
}

View file

@ -194,8 +194,8 @@ class StatusScreen abstract play version("2.5")
if (pinfo.mPatch.isValid())
{
Vector2 size = TexMan.GetScaledSize(pinfo.mPatch);
screen.DrawTexture(pinfo.mPatch, true, midx - size.X, y, DTA_CleanNoMove, true);
let size = TexMan.GetScaledSize(pinfo.mPatch);
screen.DrawTexture(pinfo.mPatch, true, midx - size.X * CleanXfac/2, y, DTA_CleanNoMove, true);
return y + int(size.Y * CleanYfac);
}
else
@ -262,12 +262,11 @@ class StatusScreen abstract play version("2.5")
// Returns new x position, that is, the left edge of the number.
//
//====================================================================
int drawNum (Font fnt, int x, int y, int n, int digits, bool leadingzeros = true, int translation = Font.CR_UNTRANSLATED)
int drawNum (Font fnt, int x, int y, int n, int digits, bool leadingzeros = true, int translation = Font.CR_UNTRANSLATED, bool nomove = false)
{
int fntwidth = fnt.StringWidth("3");
String text;
int len;
bool nomove = fnt != IntermissionFont;
if (nomove)
{
@ -314,14 +313,14 @@ class StatusScreen abstract play version("2.5")
//
//====================================================================
void drawPercent (Font fnt, int x, int y, int p, int b, bool show_total = true, int color = Font.CR_UNTRANSLATED)
void drawPercent (Font fnt, int x, int y, int p, int b, bool show_total = true, int color = Font.CR_UNTRANSLATED, bool nomove = false)
{
if (p < 0)
return;
if (wi_percents)
{
if (fnt != IntermissionFont)
if (nomove)
{
x -= fnt.StringWidth("%") * CleanXfac;
}
@ -329,8 +328,8 @@ class StatusScreen abstract play version("2.5")
{
x -= fnt.StringWidth("%");
}
screen.DrawText(fnt, color, x, y, "%", fnt != IntermissionFont ? DTA_CleanNoMove : DTA_Clean, true);
if (fnt != IntermissionFont)
screen.DrawText(fnt, color, x, y, "%", nomove? DTA_CleanNoMove : DTA_Clean, true);
if (nomove)
{
x -= 2*CleanXfac;
}
@ -340,9 +339,9 @@ class StatusScreen abstract play version("2.5")
{
if (show_total)
{
x = drawNum(fnt, x, y, b, 2, false);
x = drawNum(fnt, x, y, b, 2, false, color);
x -= fnt.StringWidth("/");
screen.DrawText (IntermissionFont, color, x, y, "/", DTA_Clean, true);
screen.DrawText (IntermissionFont, color, x, y, "/", nomove? DTA_CleanNoMove : DTA_Clean, true);
}
drawNum (fnt, x, y, p, -1, false, color);
}
@ -354,7 +353,7 @@ class StatusScreen abstract play version("2.5")
//
//====================================================================
void drawTimeFont (Font printFont, int x, int y, int t)
void drawTimeFont (Font printFont, int x, int y, int t, int color)
{
bool sucky;
@ -372,19 +371,19 @@ class StatusScreen abstract play version("2.5")
int num_spacing = printFont.GetCharWidth("3");
int colon_spacing = printFont.GetCharWidth(":");
x = drawNum (printFont, x, y, seconds, 2) - 1;
DrawCharPatch (printFont, ":", x -= colon_spacing, y);
x = drawNum (printFont, x, y, minutes, 2, hours!=0);
x = drawNum (printFont, x, y, seconds, 2, true, color) - 1;
DrawCharPatch (printFont, ":", x -= colon_spacing, y, color);
x = drawNum (printFont, x, y, minutes, 2, hours!=0, color);
if (hours)
{
DrawCharPatch (printFont, ":", x -= colon_spacing, y);
drawNum (printFont, x, y, hours, 2);
DrawCharPatch (printFont, ":", x -= colon_spacing, y, color);
drawNum (printFont, x, y, hours, 2, false, color);
}
}
void drawTime (int x, int y, int t, bool no_sucks=false)
{
drawTimeFont(IntermissionFont, x, y, t);
drawTimeFont(printFont, x, y, t, Font.CR_UNTRANSLATED);
}

View file

@ -275,15 +275,15 @@ class CoopStatusScreen : StatusScreen
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);
drawPercent(SmallFont, kills_x, y + ypadding, cnt_kills[i], wbs.maxkills, false, thiscolor);
drawPercent(SmallFont, kills_x, y + ypadding, cnt_kills[i], wbs.maxkills, false, thiscolor, true);
missed_kills -= cnt_kills[i];
if (ng_state >= 4)
{
drawPercent(SmallFont, bonus_x, y + ypadding, cnt_items[i], wbs.maxitems, false, thiscolor);
drawPercent(SmallFont, bonus_x, y + ypadding, cnt_items[i], wbs.maxitems, false, thiscolor, true);
missed_items -= cnt_items[i];
if (ng_state >= 6)
{
drawPercent(SmallFont, secret_x, y + ypadding, cnt_secret[i], wbs.maxsecret, false, thiscolor);
drawPercent(SmallFont, secret_x, y + ypadding, cnt_secret[i], wbs.maxsecret, false, thiscolor, true);
missed_secrets -= cnt_secret[i];
}
}
@ -293,26 +293,26 @@ class CoopStatusScreen : StatusScreen
// Draw "MISSED" line
y += 3 * CleanYfac;
screen.DrawText(SmallFont, Font.CR_DARKGRAY, name_x, y, Stringtable.Localize("$SCORE_MISSED"), DTA_CleanNoMove, true);
drawPercent(SmallFont, kills_x, y, missed_kills, wbs.maxkills, false, Font.CR_DARKGRAY);
drawPercent(SmallFont, kills_x, y, missed_kills, wbs.maxkills, false, Font.CR_DARKGRAY, true);
if (ng_state >= 4)
{
drawPercent(SmallFont, bonus_x, y, missed_items, wbs.maxitems, false, Font.CR_DARKGRAY);
drawPercent(SmallFont, bonus_x, y, missed_items, wbs.maxitems, false, Font.CR_DARKGRAY, true);
if (ng_state >= 6)
{
drawPercent(SmallFont, secret_x, y, missed_secrets, wbs.maxsecret, false, Font.CR_DARKGRAY);
drawPercent(SmallFont, secret_x, y, missed_secrets, wbs.maxsecret, false, Font.CR_DARKGRAY, true);
}
}
// Draw "TOTAL" line
y += height + 3 * CleanYfac;
screen.DrawText(SmallFont, textcolor, name_x, y, Stringtable.Localize("$SCORE_TOTAL"), DTA_CleanNoMove, true);
drawNum(SmallFont, kills_x, y, wbs.maxkills, 0, false, textcolor);
drawNum(SmallFont, kills_x, y, wbs.maxkills, 0, false, textcolor, true);
if (ng_state >= 4)
{
drawNum(SmallFont, bonus_x, y, wbs.maxitems, 0, false, textcolor);
drawNum(SmallFont, bonus_x, y, wbs.maxitems, 0, false, textcolor, true);
if (ng_state >= 6)
{
drawNum(SmallFont, secret_x, y, wbs.maxsecret, 0, false, textcolor);
drawNum(SmallFont, secret_x, y, wbs.maxsecret, 0, false, textcolor, true);
}
}
}

View file

@ -209,10 +209,10 @@ class DeathmatchStatusScreen : StatusScreen
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);
drawNum(SmallFont, frags_x, y + ypadding, cnt_frags[pnum], 0, false, thiscolor, true);
if (ng_state >= 2)
{
drawNum(SmallFont, deaths_x, y + ypadding, cnt_deaths[pnum], 0, false, thiscolor);
drawNum(SmallFont, deaths_x, y + ypadding, cnt_deaths[pnum], 0, false, thiscolor, true);
}
y += lineheight + CleanYfac;
}
@ -220,10 +220,10 @@ class DeathmatchStatusScreen : StatusScreen
// Draw "TOTAL" line
y += height + 3 * CleanYfac;
screen.DrawText(SmallFont, textcolor, name_x, y, Stringtable.Localize("$SCORE_TOTAL"), DTA_CleanNoMove, true);
drawNum(SmallFont, frags_x, y, total_frags, 0, false, textcolor);
drawNum(SmallFont, frags_x, y, total_frags, 0, false, textcolor, true);
if (ng_state >= 4)
{
drawNum(SmallFont, deaths_x, y, total_deaths, 0, false, textcolor);
drawNum(SmallFont, deaths_x, y, total_deaths, 0, false, textcolor, true);
}
// Draw game time

View file

@ -163,13 +163,13 @@ class DoomStatusScreen : StatusScreen
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, SP_TIMEX, SP_TIMEY, "$TXT_IMPAR", DTA_Clean, true);
if (wbs.partime) screen.DrawText (BigFont, tcolor, 160 + SP_TIMEX, SP_TIMEY, "$TXT_IMPAR", DTA_Clean, true);
}
drawPercent (printFont, 320 - SP_STATSX, SP_STATSY, cnt_kills[0], wbs.maxkills);
drawPercent (printFont, 320 - SP_STATSX, SP_STATSY+lh, cnt_items[0], wbs.maxitems);
drawPercent (printFont, 320 - SP_STATSX, SP_STATSY+2*lh, cnt_secret[0], wbs.maxsecret);
drawTimeFont (printFont, 160 - SP_TIMEX, SP_TIMEY, cnt_time);
drawPercent (printFont, 320 - SP_STATSX, SP_STATSY, cnt_kills[0], wbs.maxkills, true, tcolor);
drawPercent (printFont, 320 - SP_STATSX, SP_STATSY+lh, cnt_items[0], wbs.maxitems, true, tcolor);
drawPercent (printFont, 320 - SP_STATSX, SP_STATSY+2*lh, cnt_secret[0], wbs.maxsecret, true, tcolor);
drawTimeFont (printFont, 160 - SP_TIMEX, SP_TIMEY, cnt_time, tcolor);
// This really sucks - not just by its message - and should have been removed long ago!
// To avoid problems here, the "sucks" text only gets printed if the lump is present, this even applies to the text replacement.
@ -191,9 +191,9 @@ class DoomStatusScreen : StatusScreen
if (wi_showtotaltime)
{
drawTimeFont (printFont, 160 - SP_TIMEX, SP_TIMEY + lh, cnt_total_time);
drawTimeFont (printFont, 160 - SP_TIMEX, SP_TIMEY + lh, cnt_total_time, tcolor);
}
drawTimeFont (printFont, 320 - SP_TIMEX, SP_TIMEY, cnt_par);
drawTimeFont (printFont, 320 - SP_TIMEX, SP_TIMEY, cnt_par, tcolor);
}
}