2017-03-18 14:42:34 +00:00
|
|
|
// Note that the status screen needs to run in 'play' scope!
|
2017-03-18 11:16:44 +00:00
|
|
|
|
2017-03-18 23:52:42 +00:00
|
|
|
class InterBackground native play version("2.5")
|
2017-03-18 12:25:22 +00:00
|
|
|
{
|
2017-03-18 18:34:03 +00:00
|
|
|
native static InterBackground Create(wbstartstruct wbst);
|
|
|
|
native virtual bool LoadBackground(bool isenterpic);
|
|
|
|
native virtual void updateAnimatedBack();
|
|
|
|
native virtual void drawBackground(int CurState, bool drawsplat, bool snl_pointeron);
|
2017-03-18 12:25:22 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 23:52:42 +00:00
|
|
|
struct PatchInfo play version("2.5")
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
Font mFont;
|
|
|
|
TextureID mPatch;
|
|
|
|
int mColor;
|
|
|
|
|
|
|
|
void Init(GIFont gifont)
|
|
|
|
{
|
|
|
|
if (gifont.color == 'Null')
|
|
|
|
{
|
|
|
|
mPatch = TexMan.CheckForTexture(gifont.fontname, TexMan.Type_MiscPatch);
|
|
|
|
mColor = mPatch.isValid() ? Font.CR_UNTRANSLATED : Font.CR_UNDEFINED;
|
|
|
|
mFont = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mFont = Font.GetFont(gifont.fontname);
|
|
|
|
mColor = Font.FindFontColor(gifont.color);
|
|
|
|
mPatch.SetInvalid();
|
|
|
|
}
|
|
|
|
if (mFont == NULL)
|
|
|
|
{
|
|
|
|
mFont = BigFont;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Will be made a class later, but for now needs to mirror the internal version.
|
2017-03-18 23:52:42 +00:00
|
|
|
class StatusScreen abstract play version("2.5")
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
enum EValues
|
|
|
|
{
|
|
|
|
// GLOBAL LOCATIONS
|
2017-03-18 18:34:03 +00:00
|
|
|
TITLEY = 2,
|
2017-03-18 11:16:44 +00:00
|
|
|
|
|
|
|
// SINGPLE-PLAYER STUFF
|
|
|
|
SP_STATSX = 50,
|
|
|
|
SP_STATSY = 50,
|
|
|
|
|
|
|
|
SP_TIMEX = 8,
|
|
|
|
SP_TIMEY = (200 - 32),
|
|
|
|
|
|
|
|
// NET GAME STUFF
|
|
|
|
NG_STATSY = 50,
|
|
|
|
};
|
|
|
|
|
2017-03-18 14:42:34 +00:00
|
|
|
enum EState
|
|
|
|
{
|
|
|
|
NoState = -1,
|
|
|
|
StatCount,
|
|
|
|
ShowNextLoc,
|
|
|
|
LeavingIntermission
|
|
|
|
};
|
2017-03-18 11:16:44 +00:00
|
|
|
|
|
|
|
// States for single-player
|
|
|
|
enum ESPState
|
|
|
|
{
|
|
|
|
SP_KILLS = 0,
|
|
|
|
SP_ITEMS = 2,
|
|
|
|
SP_SECRET = 4,
|
|
|
|
SP_FRAGS = 6,
|
|
|
|
SP_TIME = 8,
|
|
|
|
};
|
|
|
|
|
|
|
|
const SHOWNEXTLOCDELAY = 4; // in seconds
|
|
|
|
|
2017-03-18 20:19:32 +00:00
|
|
|
InterBackground bg;
|
|
|
|
int acceleratestage; // used to accelerate or skip a stage
|
|
|
|
bool playerready[MAXPLAYERS];
|
|
|
|
int me; // wbs.pnum
|
|
|
|
int bcnt;
|
|
|
|
int CurState; // specifies current CurState
|
|
|
|
wbstartstruct wbs; // contains information passed into intermission
|
|
|
|
wbplayerstruct Plrs[MAXPLAYERS]; // wbs.plyr[]
|
|
|
|
int cnt; // used for general timing
|
|
|
|
int cnt_kills[MAXPLAYERS];
|
|
|
|
int cnt_items[MAXPLAYERS];
|
|
|
|
int cnt_secret[MAXPLAYERS];
|
|
|
|
int cnt_frags[MAXPLAYERS];
|
|
|
|
int cnt_deaths[MAXPLAYERS];
|
|
|
|
int cnt_time;
|
|
|
|
int cnt_total_time;
|
|
|
|
int cnt_par;
|
|
|
|
int cnt_pause;
|
|
|
|
int total_frags;
|
|
|
|
int total_deaths;
|
|
|
|
bool noautostartmap;
|
|
|
|
int dofrags;
|
|
|
|
int ng_state;
|
|
|
|
float shadowalpha;
|
|
|
|
|
|
|
|
PatchInfo mapname;
|
|
|
|
PatchInfo finished;
|
|
|
|
PatchInfo entering;
|
2019-07-14 07:08:19 +00:00
|
|
|
PatchInfo content;
|
2019-08-02 07:11:40 +00:00
|
|
|
PatchInfo author;
|
2017-03-18 20:19:32 +00:00
|
|
|
|
|
|
|
TextureID p_secret;
|
|
|
|
TextureID kills;
|
|
|
|
TextureID secret;
|
|
|
|
TextureID items;
|
|
|
|
TextureID timepic;
|
|
|
|
TextureID par;
|
|
|
|
TextureID sucks;
|
2017-03-18 11:16:44 +00:00
|
|
|
|
|
|
|
// [RH] Info to dynamically generate the level name graphics
|
2017-03-18 20:19:32 +00:00
|
|
|
String lnametexts[2];
|
2019-08-02 07:11:40 +00:00
|
|
|
String authortexts[2];
|
2017-03-18 11:16:44 +00:00
|
|
|
|
2017-03-18 20:19:32 +00:00
|
|
|
bool snl_pointeron;
|
2017-03-18 11:16:44 +00:00
|
|
|
|
2017-03-18 20:19:32 +00:00
|
|
|
int player_deaths[MAXPLAYERS];
|
|
|
|
int sp_state;
|
2017-03-18 11:16:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Draws a single character with a shadow
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
int DrawCharPatch(Font fnt, int charcode, int x, int y, int translation = Font.CR_UNTRANSLATED, bool nomove = false)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
int width = fnt.GetCharWidth(charcode);
|
|
|
|
screen.DrawChar(fnt, translation, x, y, charcode, nomove ? DTA_CleanNoMove : DTA_Clean, true);
|
|
|
|
return x - width;
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Draws a level name with the big font
|
|
|
|
//
|
|
|
|
// x is no longer passed as a parameter because the text is now broken into several lines
|
|
|
|
// if it is too long
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
int DrawName(int y, TextureID tex, String levelname)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
// draw <LevelName>
|
|
|
|
if (tex.isValid())
|
|
|
|
{
|
|
|
|
int w,h;
|
|
|
|
[w, h] = TexMan.GetSize(tex);
|
|
|
|
let size = TexMan.GetScaledSize(tex);
|
|
|
|
screen.DrawTexture(tex, true, (screen.GetWidth() - size.X * CleanXfac) /2, y, DTA_CleanNoMove, true);
|
|
|
|
if (h > 50)
|
|
|
|
{ // Fix for Deus Vult II and similar wads that decide to make these hugely tall
|
|
|
|
// patches with vast amounts of empty space at the bottom.
|
|
|
|
size.Y = TexMan.CheckRealHeight(tex) * size.Y / h;
|
|
|
|
}
|
|
|
|
return y + (h + BigFont.GetHeight()/4) * CleanYfac;
|
|
|
|
}
|
|
|
|
else if (levelname.Length() > 0)
|
|
|
|
{
|
|
|
|
int h = 0;
|
|
|
|
int lumph = mapname.mFont.GetHeight() * CleanYfac;
|
|
|
|
|
|
|
|
BrokenLines lines = mapname.mFont.BreakLines(levelname, screen.GetWidth() / CleanXfac);
|
|
|
|
|
|
|
|
int count = lines.Count();
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
screen.DrawText(mapname.mFont, mapname.mColor, (screen.GetWidth() - lines.StringWidth(i) * CleanXfac) / 2, y + h, lines.StringAt(i), DTA_CleanNoMove, true);
|
|
|
|
h += lumph;
|
|
|
|
}
|
|
|
|
return y + h + lumph/4;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-08-02 07:11:40 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Draws a level author's name with the big font
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
int DrawAuthor(int y, String levelname)
|
|
|
|
{
|
|
|
|
if (levelname.Length() > 0)
|
|
|
|
{
|
|
|
|
int h = 0;
|
|
|
|
int lumph = author.mFont.GetHeight() * CleanYfac;
|
|
|
|
|
|
|
|
BrokenLines lines = author.mFont.BreakLines(levelname, screen.GetWidth() / CleanXfac);
|
|
|
|
|
|
|
|
int count = lines.Count();
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
screen.DrawText(author.mFont, author.mColor, (screen.GetWidth() - lines.StringWidth(i) * CleanXfac) / 2, y + h, lines.StringAt(i), DTA_CleanNoMove, true);
|
|
|
|
h += lumph;
|
|
|
|
}
|
|
|
|
return y + h;
|
|
|
|
}
|
2019-08-07 10:59:20 +00:00
|
|
|
return y;
|
2019-08-02 07:11:40 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 11:16:44 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Draws a text, either as patch or as string from the string table
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
int DrawPatchText(int y, PatchInfo pinfo, String stringname)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
String string = Stringtable.Localize(stringname);
|
|
|
|
int midx = screen.GetWidth() / 2;
|
|
|
|
|
|
|
|
if (pinfo.mPatch.isValid())
|
|
|
|
{
|
|
|
|
let size = TexMan.GetScaledSize(pinfo.mPatch);
|
|
|
|
screen.DrawTexture(pinfo.mPatch, true, midx - size.X * CleanXfac/2, y, DTA_CleanNoMove, true);
|
2017-04-27 08:23:31 +00:00
|
|
|
return y + int(size.Y * CleanYfac);
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
screen.DrawText(pinfo.mFont, pinfo.mColor, midx - pinfo.mFont.StringWidth(string) * CleanXfac/2, y, string, DTA_CleanNoMove, true);
|
|
|
|
return y + pinfo.mFont.GetHeight() * CleanYfac;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-07-16 21:10:04 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Draws a text, either as patch or as string from the string table
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
int DrawPatchOrText(int y, PatchInfo pinfo, TextureID patch, String stringname)
|
|
|
|
{
|
|
|
|
String string = Stringtable.Localize(stringname);
|
|
|
|
int midx = screen.GetWidth() / 2;
|
|
|
|
|
|
|
|
if (TexMan.OkForLocalization(patch, stringname))
|
|
|
|
{
|
|
|
|
let size = TexMan.GetScaledSize(patch);
|
|
|
|
screen.DrawTexture(patch, true, midx - size.X * CleanXfac/2, y, DTA_CleanNoMove, true);
|
|
|
|
return y + int(size.Y * CleanYfac);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
screen.DrawText(pinfo.mFont, pinfo.mColor, midx - pinfo.mFont.StringWidth(string) * CleanXfac/2, y, string, DTA_CleanNoMove, true);
|
|
|
|
return y + pinfo.mFont.GetHeight() * CleanYfac;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-18 11:16:44 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Draws "<Levelname> Finished!"
|
|
|
|
//
|
|
|
|
// Either uses the specified patch or the big font
|
|
|
|
// A level name patch can be specified for all games now, not just Doom.
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2019-07-16 21:10:04 +00:00
|
|
|
virtual int drawLF ()
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2017-03-18 18:34:03 +00:00
|
|
|
int y = TITLEY * CleanYfac;
|
2017-03-18 11:16:44 +00:00
|
|
|
|
|
|
|
y = DrawName(y, wbs.LName0, lnametexts[0]);
|
|
|
|
|
|
|
|
// Adjustment for different font sizes for map name and 'finished'.
|
|
|
|
y -= ((mapname.mFont.GetHeight() - finished.mFont.GetHeight()) * CleanYfac) / 4;
|
|
|
|
|
2019-08-07 10:59:20 +00:00
|
|
|
y = DrawAuthor(y, authortexts[0]);
|
2019-08-02 07:11:40 +00:00
|
|
|
|
2017-03-18 11:16:44 +00:00
|
|
|
// draw "Finished!"
|
|
|
|
if (y < (NG_STATSY - finished.mFont.GetHeight()*3/4) * CleanYfac)
|
|
|
|
{
|
|
|
|
// don't draw 'finished' if the level name is too tall
|
Fixed “Finished:” and “Now entering” in Heretic
The text file
gzdoom/wadsrc/static/zscript/statscreen/statscreen.txt
is set to use strings called “$ENTERING” and “$FINISHED”, located in the language files, in intermission screens between levels in Heretic. However, these strings are named incorrectly in the language files, instead being written as “$WI_ENTERING” and “$WI_FINISHED” for some reason I’m unaware of. After renaming the original script, the ingame text shows up through what is written in the language files, as intended.
On a miscellaneous note: in GZDoom, the text between levels in Heretic says “Entering:”. In the DOS version, it says “Now entering:”. This is accurately reflected in the English language file, though, and thus faithful to the original when displayed ingame.
2019-02-02 07:52:51 +00:00
|
|
|
y = DrawPatchText(y, finished, "$WI_FINISHED");
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
return y;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Draws "Entering <LevelName>"
|
|
|
|
//
|
|
|
|
// Either uses the specified patch or the big font
|
|
|
|
// A level name patch can be specified for all games now, not just Doom.
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2019-07-16 21:10:04 +00:00
|
|
|
virtual void drawEL ()
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2017-03-18 18:34:03 +00:00
|
|
|
int y = TITLEY * CleanYfac;
|
2017-03-18 11:16:44 +00:00
|
|
|
|
Fixed “Finished:” and “Now entering” in Heretic
The text file
gzdoom/wadsrc/static/zscript/statscreen/statscreen.txt
is set to use strings called “$ENTERING” and “$FINISHED”, located in the language files, in intermission screens between levels in Heretic. However, these strings are named incorrectly in the language files, instead being written as “$WI_ENTERING” and “$WI_FINISHED” for some reason I’m unaware of. After renaming the original script, the ingame text shows up through what is written in the language files, as intended.
On a miscellaneous note: in GZDoom, the text between levels in Heretic says “Entering:”. In the DOS version, it says “Now entering:”. This is accurately reflected in the English language file, though, and thus faithful to the original when displayed ingame.
2019-02-02 07:52:51 +00:00
|
|
|
y = DrawPatchText(y, entering, "$WI_ENTERING");
|
2017-03-18 11:16:44 +00:00
|
|
|
y += entering.mFont.GetHeight() * CleanYfac / 4;
|
2019-08-02 07:11:40 +00:00
|
|
|
y = DrawName(y, wbs.LName1, lnametexts[1]);
|
|
|
|
|
|
|
|
DrawAuthor(y, authortexts[1]);
|
|
|
|
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Draws a number.
|
|
|
|
// If digits > 0, then use that many digits minimum,
|
|
|
|
// otherwise only use as many as necessary.
|
|
|
|
// x is the right edge of the number.
|
|
|
|
// Returns new x position, that is, the left edge of the number.
|
|
|
|
//
|
|
|
|
//====================================================================
|
2017-03-18 18:34:03 +00:00
|
|
|
int drawNum (Font fnt, int x, int y, int n, int digits, bool leadingzeros = true, int translation = Font.CR_UNTRANSLATED)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
int fntwidth = fnt.StringWidth("3");
|
|
|
|
String text;
|
|
|
|
int len;
|
|
|
|
bool nomove = fnt != IntermissionFont;
|
|
|
|
|
|
|
|
if (nomove)
|
|
|
|
{
|
|
|
|
fntwidth *= CleanXfac;
|
|
|
|
}
|
|
|
|
text = String.Format("%d", n);
|
|
|
|
len = text.Length();
|
|
|
|
if (leadingzeros)
|
|
|
|
{
|
|
|
|
int filldigits = digits - len;
|
|
|
|
for(int i = 0; i < filldigits; i++)
|
|
|
|
{
|
|
|
|
text = "0" .. text;
|
|
|
|
}
|
|
|
|
len = text.Length();
|
|
|
|
}
|
|
|
|
|
|
|
|
for(int text_p = len-1; text_p >= 0; text_p--)
|
|
|
|
{
|
|
|
|
// Digits are centered in a box the width of the '3' character.
|
|
|
|
// Other characters (specifically, '-') are right-aligned in their cell.
|
2019-04-13 07:31:36 +00:00
|
|
|
int c = text.ByteAt(text_p);
|
2017-03-18 11:16:44 +00:00
|
|
|
if (c >= "0" && c <= "9")
|
|
|
|
{
|
|
|
|
x -= fntwidth;
|
|
|
|
DrawCharPatch(fnt, c, x + (fntwidth - fnt.GetCharWidth(c)) / 2, y, translation, nomove);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DrawCharPatch(fnt, c, x - fnt.GetCharWidth(c), y, translation, nomove);
|
|
|
|
x -= fntwidth;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (len < digits)
|
|
|
|
{
|
|
|
|
x -= fntwidth * (digits - len);
|
|
|
|
}
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
void drawPercent (Font fnt, int x, int y, int p, int b, bool show_total = true, int color = Font.CR_UNTRANSLATED)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
if (p < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (wi_percents)
|
|
|
|
{
|
|
|
|
if (fnt != IntermissionFont)
|
|
|
|
{
|
|
|
|
x -= fnt.StringWidth("%") * CleanXfac;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x -= fnt.StringWidth("%");
|
|
|
|
}
|
|
|
|
screen.DrawText(fnt, color, x, y, "%", fnt != IntermissionFont ? DTA_CleanNoMove : DTA_Clean, true);
|
|
|
|
if (fnt != IntermissionFont)
|
|
|
|
{
|
|
|
|
x -= 2*CleanXfac;
|
|
|
|
}
|
|
|
|
drawNum(fnt, x, y, b == 0 ? 100 : p * 100 / b, -1, false, color);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (show_total)
|
|
|
|
{
|
|
|
|
x = drawNum(fnt, x, y, b, 2, false);
|
|
|
|
x -= fnt.StringWidth("/");
|
|
|
|
screen.DrawText (IntermissionFont, color, x, y, "/", DTA_Clean, true);
|
|
|
|
}
|
|
|
|
drawNum (fnt, x, y, p, -1, false, color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Display level completion time and par, or "sucks" message if overflow.
|
|
|
|
//
|
|
|
|
//====================================================================
|
2017-03-18 14:42:34 +00:00
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
void drawTime (int x, int y, int t, bool no_sucks=false)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
bool sucky;
|
|
|
|
|
|
|
|
if (t < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
sucky = !no_sucks && t >= wbs.sucktime * 60 * 60 && wbs.sucktime > 0;
|
|
|
|
|
|
|
|
if (sucky)
|
|
|
|
{ // "sucks"
|
|
|
|
if (Sucks.isValid())
|
|
|
|
{
|
|
|
|
let size = TexMan.GetScaledSize(Sucks);
|
|
|
|
screen.DrawTexture (Sucks, true, x - size.X, y - size.Y - 2, DTA_Clean, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
screen.DrawText (BigFont, Font.CR_UNTRANSLATED, x - BigFont.StringWidth("SUCKS"), y - IntermissionFont.GetHeight() - 2, "SUCKS", DTA_Clean, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int hours = t / 3600;
|
|
|
|
t -= hours * 3600;
|
|
|
|
int minutes = t / 60;
|
|
|
|
t -= minutes * 60;
|
|
|
|
int seconds = t;
|
|
|
|
|
|
|
|
// Why were these offsets hard coded? Half the WADs with custom patches
|
|
|
|
// I tested screwed up miserably in this function!
|
|
|
|
int num_spacing = IntermissionFont.GetCharWidth("3");
|
|
|
|
int colon_spacing = IntermissionFont.GetCharWidth(":");
|
|
|
|
|
|
|
|
x = drawNum (IntermissionFont, x, y, seconds, 2) - 1;
|
|
|
|
DrawCharPatch (IntermissionFont, ":", x -= colon_spacing, y);
|
|
|
|
x = drawNum (IntermissionFont, x, y, minutes, 2, hours!=0);
|
|
|
|
if (hours)
|
|
|
|
{
|
|
|
|
DrawCharPatch (IntermissionFont, ":", x -= colon_spacing, y);
|
|
|
|
drawNum (IntermissionFont, x, y, hours, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-14 07:08:19 +00:00
|
|
|
void drawTimeFont (Font printFont, int x, int y, int t, int color) // hack hack
|
|
|
|
{
|
|
|
|
drawTime(x, y, t);
|
|
|
|
}
|
|
|
|
|
2017-03-18 14:42:34 +00:00
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2018-09-15 02:59:25 +00:00
|
|
|
virtual void End ()
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
|
|
|
CurState = LeavingIntermission;
|
|
|
|
|
|
|
|
//Added by mc
|
|
|
|
if (deathmatch)
|
|
|
|
{
|
|
|
|
level.RemoveAllBots (consoleplayer != Net_Arbitrator);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
bool autoSkip()
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
|
|
|
return wi_autoadvance > 0 && bcnt > (wi_autoadvance * Thinker.TICRATE);
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
protected virtual void initNoState ()
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
|
|
|
CurState = NoState;
|
|
|
|
acceleratestage = 0;
|
|
|
|
cnt = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
protected virtual void updateNoState ()
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
|
|
|
if (acceleratestage)
|
|
|
|
{
|
|
|
|
cnt = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bool noauto = noautostartmap;
|
|
|
|
|
|
|
|
for (int i = 0; !noauto && i < MAXPLAYERS; ++i)
|
|
|
|
{
|
|
|
|
if (playeringame[i])
|
|
|
|
{
|
|
|
|
noauto |= players[i].GetNoAutostartMap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!noauto || autoSkip())
|
|
|
|
{
|
|
|
|
cnt--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cnt == 0)
|
|
|
|
{
|
|
|
|
End();
|
|
|
|
level.WorldDone();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
protected virtual void initShowNextLoc ()
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
|
|
|
if (wbs.next == "")
|
|
|
|
{
|
|
|
|
// Last map in episode - there is no next location!
|
|
|
|
End();
|
|
|
|
level.WorldDone();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
CurState = ShowNextLoc;
|
|
|
|
acceleratestage = 0;
|
|
|
|
cnt = SHOWNEXTLOCDELAY * Thinker.TICRATE;
|
2017-09-10 08:01:17 +00:00
|
|
|
noautostartmap = bg.LoadBackground(true);
|
2017-03-18 14:42:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
protected virtual void updateShowNextLoc ()
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
|
|
|
if (!--cnt || acceleratestage)
|
|
|
|
initNoState();
|
|
|
|
else
|
|
|
|
snl_pointeron = (cnt & 31) < 20;
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
protected virtual void drawShowNextLoc(void)
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
|
|
|
bg.drawBackground(CurState, true, snl_pointeron);
|
|
|
|
|
|
|
|
// draws which level you are entering..
|
|
|
|
drawEL ();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
protected virtual void drawNoState ()
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
|
|
|
snl_pointeron = true;
|
|
|
|
drawShowNextLoc();
|
|
|
|
}
|
2017-03-18 11:16:44 +00:00
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
protected int fragSum (int playernum)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int frags = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < MAXPLAYERS; i++)
|
|
|
|
{
|
|
|
|
if (playeringame[i]
|
|
|
|
&& i!=playernum)
|
|
|
|
{
|
|
|
|
frags += Plrs[playernum].frags[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// JDC hack - negative frags.
|
|
|
|
frags -= Plrs[playernum].frags[playernum];
|
|
|
|
|
|
|
|
return frags;
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
static void PlaySound(Sound snd)
|
|
|
|
{
|
|
|
|
S_Sound(snd, CHAN_VOICE | CHAN_UI, 1, ATTN_NONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ====================================================================
|
|
|
|
// checkForAccelerate
|
|
|
|
// Purpose: See if the player has hit either the attack or use key
|
|
|
|
// or mouse button. If so we set acceleratestage to 1 and
|
|
|
|
// all those display routines above jump right to the end.
|
|
|
|
// Args: none
|
|
|
|
// Returns: void
|
|
|
|
//
|
|
|
|
// ====================================================================
|
|
|
|
|
|
|
|
protected void checkForAccelerate(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
// check for button presses to skip delays
|
|
|
|
for (i = 0; i < MAXPLAYERS; i++)
|
|
|
|
{
|
|
|
|
PlayerInfo player = players[i];
|
|
|
|
if (playeringame[i])
|
|
|
|
{
|
2017-04-30 18:29:39 +00:00
|
|
|
if ((player.cmd.buttons ^ player.oldbuttons) &&
|
|
|
|
((player.cmd.buttons & player.oldbuttons) == player.oldbuttons) && player.Bot == NULL)
|
2017-03-18 18:34:03 +00:00
|
|
|
{
|
|
|
|
acceleratestage = 1;
|
|
|
|
playerready[i] = true;
|
|
|
|
}
|
|
|
|
player.oldbuttons = player.buttons;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ====================================================================
|
|
|
|
// Ticker
|
|
|
|
// Purpose: Do various updates every gametic, for stats, animation,
|
|
|
|
// checking that intermission music is running, etc.
|
|
|
|
// Args: none
|
|
|
|
// Returns: void
|
|
|
|
//
|
|
|
|
// ====================================================================
|
|
|
|
|
|
|
|
virtual void StartMusic()
|
|
|
|
{
|
|
|
|
level.SetInterMusic(wbs.next);
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
virtual void Ticker(void)
|
|
|
|
{
|
|
|
|
// counter for general background animation
|
|
|
|
bcnt++;
|
|
|
|
|
|
|
|
if (bcnt == 1)
|
|
|
|
{
|
|
|
|
StartMusic();
|
|
|
|
}
|
|
|
|
|
|
|
|
checkForAccelerate();
|
|
|
|
bg.updateAnimatedBack();
|
|
|
|
|
|
|
|
switch (CurState)
|
|
|
|
{
|
|
|
|
case StatCount:
|
|
|
|
updateStats();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ShowNextLoc:
|
|
|
|
updateShowNextLoc();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NoState:
|
|
|
|
updateNoState();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LeavingIntermission:
|
|
|
|
// Hush, GCC.
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-03-18 20:19:32 +00:00
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
virtual void Drawer (void)
|
|
|
|
{
|
|
|
|
switch (CurState)
|
|
|
|
{
|
|
|
|
case StatCount:
|
2017-03-18 20:19:32 +00:00
|
|
|
// draw animated background
|
|
|
|
bg.drawBackground(CurState, false, false);
|
2017-03-18 18:34:03 +00:00
|
|
|
drawStats();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ShowNextLoc:
|
|
|
|
drawShowNextLoc();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LeavingIntermission:
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
drawNoState();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
virtual void Start (wbstartstruct wbstartstruct)
|
|
|
|
{
|
|
|
|
wbs = wbstartstruct;
|
|
|
|
acceleratestage = 0;
|
|
|
|
cnt = bcnt = 0;
|
|
|
|
me = wbs.pnum;
|
|
|
|
for (int i = 0; i < MAXPLAYERS; i++) Plrs[i] = wbs.plyr[i];
|
|
|
|
|
|
|
|
entering.Init(gameinfo.mStatscreenEnteringFont);
|
|
|
|
finished.Init(gameinfo.mStatscreenFinishedFont);
|
|
|
|
mapname.Init(gameinfo.mStatscreenMapNameFont);
|
2019-07-14 07:08:19 +00:00
|
|
|
content.Init(gameinfo.mStatscreenContentFont);
|
2019-08-02 07:11:40 +00:00
|
|
|
author.Init(gameinfo.mStatscreenAuthorFont);
|
2017-03-18 18:34:03 +00:00
|
|
|
|
|
|
|
Kills = TexMan.CheckForTexture("WIOSTK", TexMan.Type_MiscPatch); // "kills"
|
|
|
|
Secret = TexMan.CheckForTexture("WIOSTS", TexMan.Type_MiscPatch); // "scrt"
|
|
|
|
P_secret = TexMan.CheckForTexture("WISCRT2", TexMan.Type_MiscPatch); // "secret"
|
|
|
|
Items = TexMan.CheckForTexture("WIOSTI", TexMan.Type_MiscPatch); // "items"
|
|
|
|
Timepic = TexMan.CheckForTexture("WITIME", TexMan.Type_MiscPatch); // "time"
|
|
|
|
Sucks = TexMan.CheckForTexture("WISUCKS", TexMan.Type_MiscPatch); // "sucks"
|
|
|
|
Par = TexMan.CheckForTexture("WIPAR", TexMan.Type_MiscPatch); // "par"
|
|
|
|
|
- allow the language table to supersede the title patches, if appropriate
For the Doom IWADs the provided font looks almost identical to the characters used on the title patches. So, for any level name that got replaced in some language, it will now check if the retrieved name comes from the default table, and if not, ignore the title patch and print the name with the specified font.
This also required removing the 'en' label from the default table, because with this present, the text would always be picked from 'en' instead of 'default'. Since 'en' and 'default' had the same contents, in any English locale the 'default' table was never hit, so this won't make any difference for the texts being chosen.
Last but not least, wminfo has been made a local variable in G_DoCompleted. There were two places where this was accessed from outside the summary screen or its setup code, and both were incorrect.
# Conflicts:
# src/g_hub.cpp
# src/g_level.cpp
# src/gamedata/g_mapinfo.h
# src/gi.h
# src/p_setup.cpp
# src/stringtable.cpp
# src/stringtable.h
# wadsrc/static/zscript/ui/statscreen/statscreen.zs
# wadsrc_extra/static/iwadinfo.txt
# Conflicts:
# src/gi.h
# wadsrc_extra/static/iwadinfo.txt
2019-02-14 23:29:24 +00:00
|
|
|
lnametexts[0] = wbstartstruct.thisname;
|
2017-03-18 20:19:32 +00:00
|
|
|
lnametexts[1] = wbstartstruct.nextname;
|
2019-08-02 07:11:40 +00:00
|
|
|
authortexts[0] = wbstartstruct.thisauthor;
|
|
|
|
authortexts[1] = wbstartstruct.nextauthor;
|
2017-03-18 18:34:03 +00:00
|
|
|
|
|
|
|
bg = InterBackground.Create(wbs);
|
2017-09-10 08:01:17 +00:00
|
|
|
noautostartmap = bg.LoadBackground(false);
|
2017-03-18 18:34:03 +00:00
|
|
|
initStats();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected virtual void initStats() {}
|
|
|
|
protected virtual void updateStats() {}
|
|
|
|
protected virtual void drawStats() {}
|
|
|
|
|
2017-03-18 20:19:32 +00:00
|
|
|
native static int, int, int GetPlayerWidths();
|
|
|
|
native static Color GetRowColor(PlayerInfo player, bool highlight);
|
|
|
|
native static void GetSortedPlayers(in out Array<int> sorted, bool teamplay);
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|