2017-03-18 18:34:03 +00:00
|
|
|
|
|
|
|
class DoomStatusScreen : StatusScreen
|
|
|
|
{
|
|
|
|
int intermissioncounter;
|
|
|
|
|
|
|
|
override void initStats ()
|
|
|
|
{
|
|
|
|
intermissioncounter = gameinfo.intermissioncounter;
|
|
|
|
CurState = StatCount;
|
|
|
|
acceleratestage = 0;
|
|
|
|
sp_state = 1;
|
|
|
|
cnt_kills[0] = cnt_items[0] = cnt_secret[0] = -1;
|
|
|
|
cnt_time = cnt_par = -1;
|
|
|
|
cnt_pause = Thinker.TICRATE;
|
|
|
|
|
|
|
|
cnt_total_time = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
override void updateStats ()
|
|
|
|
{
|
|
|
|
if (acceleratestage && sp_state != 10)
|
|
|
|
{
|
|
|
|
acceleratestage = 0;
|
|
|
|
sp_state = 10;
|
|
|
|
PlaySound("intermission/nextstage");
|
|
|
|
|
|
|
|
cnt_kills[0] = Plrs[me].skills;
|
|
|
|
cnt_items[0] = Plrs[me].sitems;
|
|
|
|
cnt_secret[0] = Plrs[me].ssecret;
|
2017-03-20 18:04:17 +00:00
|
|
|
cnt_time = Thinker.Tics2Seconds(Plrs[me].stime);
|
2017-05-07 07:10:26 +00:00
|
|
|
cnt_par = wbs.partime / Thinker.TICRATE;
|
2017-03-20 18:04:17 +00:00
|
|
|
cnt_total_time = Thinker.Tics2Seconds(wbs.totaltime);
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (sp_state == 2)
|
|
|
|
{
|
|
|
|
if (intermissioncounter)
|
|
|
|
{
|
|
|
|
cnt_kills[0] += 2;
|
|
|
|
|
|
|
|
if (!(bcnt&3))
|
|
|
|
PlaySound("intermission/tick");
|
|
|
|
}
|
|
|
|
if (!intermissioncounter || cnt_kills[0] >= Plrs[me].skills)
|
|
|
|
{
|
|
|
|
cnt_kills[0] = Plrs[me].skills;
|
|
|
|
PlaySound("intermission/nextstage");
|
|
|
|
sp_state++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (sp_state == 4)
|
|
|
|
{
|
|
|
|
if (intermissioncounter)
|
|
|
|
{
|
|
|
|
cnt_items[0] += 2;
|
|
|
|
|
|
|
|
if (!(bcnt&3))
|
|
|
|
PlaySound("intermission/tick");
|
|
|
|
}
|
|
|
|
if (!intermissioncounter || cnt_items[0] >= Plrs[me].sitems)
|
|
|
|
{
|
|
|
|
cnt_items[0] = Plrs[me].sitems;
|
|
|
|
PlaySound("intermission/nextstage");
|
|
|
|
sp_state++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (sp_state == 6)
|
|
|
|
{
|
|
|
|
if (intermissioncounter)
|
|
|
|
{
|
|
|
|
cnt_secret[0] += 2;
|
|
|
|
|
|
|
|
if (!(bcnt&3))
|
|
|
|
PlaySound("intermission/tick");
|
|
|
|
}
|
|
|
|
if (!intermissioncounter || cnt_secret[0] >= Plrs[me].ssecret)
|
|
|
|
{
|
|
|
|
cnt_secret[0] = Plrs[me].ssecret;
|
|
|
|
PlaySound("intermission/nextstage");
|
|
|
|
sp_state++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (sp_state == 8)
|
|
|
|
{
|
|
|
|
if (intermissioncounter)
|
|
|
|
{
|
|
|
|
if (!(bcnt&3))
|
|
|
|
PlaySound("intermission/tick");
|
|
|
|
|
|
|
|
cnt_time += 3;
|
|
|
|
cnt_par += 3;
|
|
|
|
cnt_total_time += 3;
|
|
|
|
}
|
|
|
|
|
2017-03-20 18:04:17 +00:00
|
|
|
int sec = Thinker.Tics2Seconds(Plrs[me].stime);
|
2017-03-18 18:34:03 +00:00
|
|
|
if (!intermissioncounter || cnt_time >= sec)
|
|
|
|
cnt_time = sec;
|
|
|
|
|
2017-03-20 18:04:17 +00:00
|
|
|
int tsec = Thinker.Tics2Seconds(wbs.totaltime);
|
2017-03-18 18:34:03 +00:00
|
|
|
if (!intermissioncounter || cnt_total_time >= tsec)
|
|
|
|
cnt_total_time = tsec;
|
|
|
|
|
2017-05-07 07:10:26 +00:00
|
|
|
int psec = wbs.partime / Thinker.TICRATE;
|
2017-03-20 18:04:17 +00:00
|
|
|
if (!intermissioncounter || cnt_par >= psec)
|
2017-03-18 18:34:03 +00:00
|
|
|
{
|
2017-03-20 18:04:17 +00:00
|
|
|
cnt_par = psec;
|
2017-03-18 18:34:03 +00:00
|
|
|
|
|
|
|
if (cnt_time >= sec)
|
|
|
|
{
|
|
|
|
cnt_total_time = tsec;
|
|
|
|
PlaySound("intermission/nextstage");
|
|
|
|
sp_state++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (sp_state == 10)
|
|
|
|
{
|
|
|
|
if (acceleratestage)
|
|
|
|
{
|
|
|
|
PlaySound("intermission/paststats");
|
|
|
|
initShowNextLoc();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (sp_state & 1)
|
|
|
|
{
|
|
|
|
if (!--cnt_pause)
|
|
|
|
{
|
|
|
|
sp_state++;
|
|
|
|
cnt_pause = Thinker.TICRATE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override void drawStats (void)
|
|
|
|
{
|
|
|
|
// line height
|
|
|
|
int lh = IntermissionFont.GetHeight() * 3 / 2;
|
|
|
|
|
|
|
|
drawLF();
|
2019-02-19 00:22:12 +00:00
|
|
|
|
2019-03-09 16:50:23 +00:00
|
|
|
|
2019-02-19 23:44:17 +00:00
|
|
|
// For visual consistency, only use the patches here if all are present.
|
2019-02-20 23:35:27 +00:00
|
|
|
bool useGfx = TexMan.OkForLocalization(Kills, "$TXT_IMKILLS")
|
|
|
|
&& TexMan.OkForLocalization(Items, "$TXT_IMITEMS")
|
|
|
|
&& TexMan.OkForLocalization(P_secret, "$TXT_IMSECRETS")
|
|
|
|
&& TexMan.OkForLocalization(Timepic, "$TXT_IMTIME")
|
|
|
|
&& (!wbs.partime || TexMan.OkForLocalization(Par, "$TXT_IMPAR"));
|
2019-07-14 07:08:19 +00:00
|
|
|
|
|
|
|
// The font color may only be used when the entire screen is printed as text.
|
|
|
|
// Otherwise the text based parts should not be translated to match the other graphics patches.
|
|
|
|
let tcolor = useGfx? Font.CR_UNTRANSLATED : content.mColor;
|
2019-03-09 16:50:23 +00:00
|
|
|
|
2019-02-19 23:44:17 +00:00
|
|
|
Font printFont;
|
2019-07-14 07:08:19 +00:00
|
|
|
Font textFont = generic_ui? NewSmallFont : content.mFont;
|
2019-07-14 08:02:21 +00:00
|
|
|
int statsx = SP_STATSX;
|
|
|
|
|
|
|
|
|
2019-02-19 23:44:17 +00:00
|
|
|
if (useGfx)
|
2019-02-19 00:22:12 +00:00
|
|
|
{
|
2019-02-19 23:44:17 +00:00
|
|
|
printFont = IntermissionFont;
|
2019-07-14 08:02:21 +00:00
|
|
|
screen.DrawTexture (Kills, true, statsx, SP_STATSY, DTA_Clean, true);
|
|
|
|
screen.DrawTexture (Items, true, statsx, SP_STATSY+lh, DTA_Clean, true);
|
|
|
|
screen.DrawTexture (P_secret, true, statsx, SP_STATSY+2*lh, DTA_Clean, true);
|
2019-02-19 00:22:12 +00:00
|
|
|
screen.DrawTexture (Timepic, true, SP_TIMEX, SP_TIMEY, DTA_Clean, true);
|
2019-02-19 23:44:17 +00:00
|
|
|
if (wbs.partime) screen.DrawTexture (Par, true, 160 + SP_TIMEX, SP_TIMEY, DTA_Clean, true);
|
2019-02-19 00:22:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-07-14 08:02:21 +00:00
|
|
|
// Check if everything fits on the screen.
|
|
|
|
String percentage = wi_percents? " 0000%" : " 0000/0000";
|
|
|
|
int perc_width = textFont.StringWidth(percentage);
|
|
|
|
int k_width = textFont.StringWidth("$TXT_IMKILLS");
|
|
|
|
int i_width = textFont.StringWidth("$TXT_IMITEMS");
|
|
|
|
int s_width = textFont.StringWidth("$TXT_IMSECRETS");
|
|
|
|
int allwidth = max(k_width, i_width, s_width) + perc_width;
|
|
|
|
if ((SP_STATSX*2 + allwidth) > 320) // The content does not fit so adjust the position a bit.
|
|
|
|
{
|
|
|
|
statsx = max(0, (320 - allwidth) / 2);
|
|
|
|
}
|
|
|
|
|
2019-04-11 00:00:51 +00:00
|
|
|
printFont = generic_ui? IntermissionFont : BigFont;
|
2019-07-14 08:02:21 +00:00
|
|
|
screen.DrawText (textFont, tcolor, statsx, SP_STATSY, "$TXT_IMKILLS", DTA_Clean, true);
|
|
|
|
screen.DrawText (textFont, tcolor, statsx, SP_STATSY+lh, "$TXT_IMITEMS", DTA_Clean, true);
|
|
|
|
screen.DrawText (textFont, tcolor, statsx, SP_STATSY+2*lh, "$TXT_IMSECRETS", DTA_Clean, true);
|
2019-04-11 00:00:51 +00:00
|
|
|
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);
|
2019-02-19 23:44:17 +00:00
|
|
|
}
|
|
|
|
|
2019-07-14 08:02:21 +00:00
|
|
|
drawPercent (printFont, 320 - statsx, SP_STATSY, cnt_kills[0], wbs.maxkills, true, tcolor);
|
|
|
|
drawPercent (printFont, 320 - statsx, SP_STATSY+lh, cnt_items[0], wbs.maxitems, true, tcolor);
|
|
|
|
drawPercent (printFont, 320 - statsx, SP_STATSY+2*lh, cnt_secret[0], wbs.maxsecret, true, tcolor);
|
2019-02-20 23:16:48 +00:00
|
|
|
drawTimeFont (printFont, 160 - SP_TIMEX, SP_TIMEY, cnt_time, tcolor);
|
2019-02-19 23:44:17 +00:00
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
if (cnt_time >= wbs.sucktime * 60 * 60 && wbs.sucktime > 0 && Sucks.IsValid())
|
|
|
|
{ // "sucks"
|
|
|
|
int x = 160 - SP_TIMEX;
|
|
|
|
int y = SP_TIMEY;
|
2019-02-20 23:35:27 +00:00
|
|
|
if (useGfx && TexMan.OkForLocalization(Sucks, "$TXT_IMSUCKS"))
|
2019-02-19 00:22:12 +00:00
|
|
|
{
|
2019-02-19 23:44:17 +00:00
|
|
|
let size = TexMan.GetScaledSize(Sucks);
|
|
|
|
screen.DrawTexture (Sucks, true, x - size.X, y - size.Y - 2, DTA_Clean, true);
|
2019-02-19 00:22:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-07-14 07:08:19 +00:00
|
|
|
screen.DrawText (textFont, tColor, x - printFont.StringWidth("$TXT_IMSUCKS"), y - printFont.GetHeight() - 2, "$TXT_IMSUCKS", DTA_Clean, true);
|
2019-02-19 00:22:12 +00:00
|
|
|
}
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
2019-02-19 23:44:17 +00:00
|
|
|
|
|
|
|
if (wi_showtotaltime)
|
|
|
|
{
|
2019-02-20 23:16:48 +00:00
|
|
|
drawTimeFont (printFont, 160 - SP_TIMEX, SP_TIMEY + lh, cnt_total_time, tcolor);
|
2019-02-19 23:44:17 +00:00
|
|
|
}
|
2019-05-13 08:04:55 +00:00
|
|
|
|
|
|
|
if (wbs.partime)
|
|
|
|
{
|
|
|
|
drawTimeFont (printFont, 320 - SP_TIMEX, SP_TIMEY, cnt_par, tcolor);
|
|
|
|
}
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class RavenStatusScreen : DoomStatusScreen
|
|
|
|
{
|
|
|
|
override void drawStats (void)
|
|
|
|
{
|
|
|
|
// line height
|
|
|
|
int lh = IntermissionFont.GetHeight() * 3 / 2;
|
|
|
|
|
|
|
|
drawLF();
|
2019-04-11 00:00:51 +00:00
|
|
|
|
2019-07-14 07:08:19 +00:00
|
|
|
Font textFont = generic_ui? NewSmallFont : content.mFont;
|
|
|
|
let tcolor = content.mColor;
|
2019-04-11 00:00:51 +00:00
|
|
|
|
2019-07-14 07:08:19 +00:00
|
|
|
screen.DrawText (textFont, tcolor, 50, 65, "$TXT_IMKILLS", DTA_Clean, true, DTA_Shadow, true);
|
|
|
|
screen.DrawText (textFont, tcolor, 50, 90, "$TXT_IMITEMS", DTA_Clean, true, DTA_Shadow, true);
|
|
|
|
screen.DrawText (textFont, tcolor, 50, 115, "$TXT_IMSECRETS", DTA_Clean, true, DTA_Shadow, true);
|
2017-03-18 18:34:03 +00:00
|
|
|
|
|
|
|
int countpos = gameinfo.gametype==GAME_Strife? 285:270;
|
|
|
|
if (sp_state >= 2)
|
|
|
|
{
|
2019-07-14 07:08:19 +00:00
|
|
|
drawPercent (IntermissionFont, countpos, 65, cnt_kills[0], wbs.maxkills, true, tcolor);
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
if (sp_state >= 4)
|
|
|
|
{
|
2019-07-14 07:08:19 +00:00
|
|
|
drawPercent (IntermissionFont, countpos, 90, cnt_items[0], wbs.maxitems, true, tcolor);
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
if (sp_state >= 6)
|
|
|
|
{
|
2019-07-14 07:08:19 +00:00
|
|
|
drawPercent (IntermissionFont, countpos, 115, cnt_secret[0], wbs.maxsecret, true, tcolor);
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
if (sp_state >= 8)
|
|
|
|
{
|
2019-07-14 07:08:19 +00:00
|
|
|
screen.DrawText (textFont, tcolor, 85, 160, "$TXT_IMTIME", DTA_Clean, true, DTA_Shadow, true);
|
|
|
|
drawTimeFont (textFont, 249, 160, cnt_time, tcolor);
|
2017-03-18 18:34:03 +00:00
|
|
|
if (wi_showtotaltime)
|
|
|
|
{
|
2019-07-14 07:08:19 +00:00
|
|
|
drawTimeFont (textFont, 249, 180, cnt_total_time, tcolor);
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|