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
|
|
|
|
2022-04-22 10:43:08 +00:00
|
|
|
class InterBackground native ui 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
|
|
|
}
|
|
|
|
|
2019-02-20 23:35:27 +00:00
|
|
|
// This is obsolete. Hopefully this was never used...
|
2022-04-22 10:43:08 +00:00
|
|
|
struct PatchInfo ui version("2.5")
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
Font mFont;
|
2019-02-20 23:35:27 +00:00
|
|
|
deprecated("3.8") TextureID mPatch;
|
2017-03-18 11:16:44 +00:00
|
|
|
int mColor;
|
|
|
|
|
2019-02-20 23:35:27 +00:00
|
|
|
void Init(GIFont gifont)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2019-04-11 00:00:51 +00:00
|
|
|
// 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;
|
- fixed deprecation warnings in core scripts
Script warning, "gzdoom.pk3:zscript/ui/statscreen/statscreen.zs" line 24:
Call to deprecated function CharAt
Script warning, "gzdoom.pk3:zscript/ui/statscreen/statscreen.zs" line 24:
Accessing deprecated function CharAt - deprecated since 4.1.0
Script warning, "gzdoom.pk3:zscript/ui/menu/search/query.zs" line 64:
Call to deprecated function ToLower
Script warning, "gzdoom.pk3:zscript/ui/menu/search/query.zs" line 64:
Accessing deprecated function ToLower - deprecated since 4.1.0
Script warning, "gzdoom.pk3:zscript/ui/menu/search/query.zs" line 65:
Call to deprecated function ToLower
Script warning, "gzdoom.pk3:zscript/ui/menu/search/query.zs" line 65:
Accessing deprecated function ToLower - deprecated since 4.1.0
Script warning, "gzdoom.pk3:zscript/ui/menu/conversationmenu.zs" line 202:
Call to deprecated function CharAt
Script warning, "gzdoom.pk3:zscript/ui/menu/conversationmenu.zs" line 202:
Accessing deprecated function CharAt - deprecated since 4.1.0
Script warning, "gzdoom.pk3:zscript/ui/menu/conversationmenu.zs" line 235:
Call to deprecated function CharAt
Script warning, "gzdoom.pk3:zscript/ui/menu/conversationmenu.zs" line 235:
Accessing deprecated function CharAt - deprecated since 4.1.0
2019-04-28 08:26:01 +00:00
|
|
|
if (s.Left(1) != "*")
|
2019-04-11 00:00:51 +00:00
|
|
|
mFont = Font.GetFont(gifont.fontname);
|
|
|
|
else if (generic_ui)
|
|
|
|
mFont = NewSmallFont;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
s = s.Mid(1);
|
|
|
|
mFont = Font.GetFont(s);
|
|
|
|
}
|
2019-02-20 23:35:27 +00:00
|
|
|
mColor = Font.FindFontColor(gifont.color);
|
2017-03-18 11:16:44 +00:00
|
|
|
if (mFont == NULL)
|
|
|
|
{
|
|
|
|
mFont = BigFont;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-04-26 16:06:26 +00:00
|
|
|
class StatusScreen : ScreenJob abstract version("2.5")
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
enum EValues
|
|
|
|
{
|
|
|
|
// GLOBAL LOCATIONS
|
2019-02-21 00:13:42 +00:00
|
|
|
TITLEY = 5,
|
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[]
|
2020-08-30 13:34:53 +00:00
|
|
|
int otherkills;
|
2017-03-18 20:19:32 +00:00
|
|
|
int cnt; // used for general timing
|
2020-08-30 13:34:53 +00:00
|
|
|
int cnt_otherkills;
|
2017-03-18 20:19:32 +00:00
|
|
|
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;
|
2022-04-26 16:06:26 +00:00
|
|
|
PatchInfo finishedp;
|
2017-03-18 20:19:32 +00:00
|
|
|
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;
|
2019-02-20 23:35:27 +00:00
|
|
|
TextureID finishedPatch;
|
|
|
|
TextureID enteringPatch;
|
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;
|
2020-10-03 11:32:39 +00:00
|
|
|
|
|
|
|
int cWidth, cHeight; // size of the canvas
|
|
|
|
int scalemode;
|
|
|
|
int wrapwidth; // size used to word wrap level names
|
|
|
|
int scaleFactorX, scaleFactorY;
|
2017-03-18 11:16:44 +00:00
|
|
|
|
|
|
|
|
2020-10-04 13:14:30 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Set fixed size mode.
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
void SetSize(int width, int height, int wrapw = -1, int scalemode = FSMode_ScaleToFit43)
|
|
|
|
{
|
|
|
|
cwidth = width;
|
|
|
|
cheight = height;
|
|
|
|
scalemode = FSMode_ScaleToFit43;
|
|
|
|
scalefactorx = 1;
|
|
|
|
scalefactory = 1;
|
|
|
|
wrapwidth = wrapw == -1 ? width : wrapw;;
|
|
|
|
}
|
|
|
|
|
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);
|
2020-10-03 11:32:39 +00:00
|
|
|
if (scalemode == -1) screen.DrawChar(fnt, translation, x, y, charcode, nomove ? DTA_CleanNoMove : DTA_Clean, true);
|
|
|
|
else screen.DrawChar(fnt, translation, x, y, charcode, DTA_FullscreenScale, scalemode, DTA_VirtualWidth, cwidth, DTA_VirtualHeight, cheight);
|
2017-03-18 11:16:44 +00:00
|
|
|
return x - width;
|
|
|
|
}
|
2020-10-03 11:32:39 +00:00
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
void DrawTexture(TextureID tex, double x, double y, bool nomove = false)
|
|
|
|
{
|
|
|
|
if (scalemode == -1) screen.DrawTexture(tex, true, x, y, nomove ? DTA_CleanNoMove : DTA_Clean, true);
|
|
|
|
else screen.DrawTexture(tex, true, x, y, DTA_FullscreenScale, scalemode, DTA_VirtualWidth, cwidth, DTA_VirtualHeight, cheight);
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
void DrawText(Font fnt, int color, double x, double y, String str, bool nomove = false, bool shadow = false)
|
|
|
|
{
|
|
|
|
if (scalemode == -1) screen.DrawText(fnt, color, x, y, str, nomove ? DTA_CleanNoMove : DTA_Clean, true, DTA_Shadow, shadow);
|
|
|
|
else screen.DrawText(fnt, color, x, y, str, DTA_FullscreenScale, scalemode, DTA_VirtualWidth, cwidth, DTA_VirtualHeight, cheight, DTA_Shadow, shadow);
|
|
|
|
}
|
2017-03-18 11:16:44 +00:00
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2019-07-30 08:52:24 +00:00
|
|
|
int DrawName(int y, TextureID tex, String levelname)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
// draw <LevelName>
|
|
|
|
if (tex.isValid())
|
|
|
|
{
|
|
|
|
let size = TexMan.GetScaledSize(tex);
|
2020-10-03 11:32:39 +00:00
|
|
|
DrawTexture(tex, (cwidth - size.X * scaleFactorX) /2, y, true);
|
2019-07-14 10:44:42 +00:00
|
|
|
if (size.Y > 50)
|
2017-03-18 11:16:44 +00:00
|
|
|
{ // 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.
|
2019-07-14 10:44:42 +00:00
|
|
|
size.Y = TexMan.CheckRealHeight(tex);
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
2020-10-03 11:32:39 +00:00
|
|
|
return y + int(Size.Y) * scaleFactorY;
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
else if (levelname.Length() > 0)
|
|
|
|
{
|
|
|
|
int h = 0;
|
2020-10-03 11:32:39 +00:00
|
|
|
int lumph = mapname.mFont.GetHeight() * scaleFactorY;
|
2017-03-18 11:16:44 +00:00
|
|
|
|
2020-10-03 11:32:39 +00:00
|
|
|
BrokenLines lines = mapname.mFont.BreakLines(levelname, wrapwidth / scaleFactorX);
|
2017-03-18 11:16:44 +00:00
|
|
|
|
|
|
|
int count = lines.Count();
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
DrawText(mapname.mFont, mapname.mColor, (cwidth - lines.StringWidth(i) * scaleFactorX) / 2, y + h, lines.StringAt(i), true);
|
2017-03-18 11:16:44 +00:00
|
|
|
h += lumph;
|
|
|
|
}
|
2019-07-30 08:52:24 +00:00
|
|
|
return y + h;
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
2019-07-30 08:52:24 +00:00
|
|
|
return 0;
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
|
2019-08-02 07:11:40 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
2020-10-03 11:32:39 +00:00
|
|
|
// Draws a level author's name with the given font
|
2019-08-02 07:11:40 +00:00
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
int DrawAuthor(int y, String levelname)
|
|
|
|
{
|
|
|
|
if (levelname.Length() > 0)
|
|
|
|
{
|
|
|
|
int h = 0;
|
2020-10-03 11:32:39 +00:00
|
|
|
int lumph = author.mFont.GetHeight() * scaleFactorY;
|
2019-08-02 07:11:40 +00:00
|
|
|
|
2020-10-03 11:32:39 +00:00
|
|
|
BrokenLines lines = author.mFont.BreakLines(levelname, wrapwidth / scaleFactorX);
|
2019-08-02 07:11:40 +00:00
|
|
|
|
|
|
|
int count = lines.Count();
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
DrawText(author.mFont, author.mColor, (cwidth - lines.StringWidth(i) * scaleFactorX) / 2, y + h, lines.StringAt(i), true);
|
2019-08-02 07:11:40 +00:00
|
|
|
h += lumph;
|
|
|
|
}
|
|
|
|
return y + h;
|
|
|
|
}
|
2019-08-07 10:09:47 +00:00
|
|
|
return y;
|
2019-08-02 07:11:40 +00:00
|
|
|
}
|
|
|
|
|
2017-03-18 11:16:44 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
2019-02-20 23:35:27 +00:00
|
|
|
// Only kept so that mods that were accessing it continue to compile
|
2017-03-18 11:16:44 +00:00
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2019-02-20 23:35:27 +00:00
|
|
|
deprecated("3.8") 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;
|
|
|
|
|
2019-02-20 23:35:27 +00:00
|
|
|
screen.DrawText(pinfo.mFont, pinfo.mColor, midx - pinfo.mFont.StringWidth(string) * CleanXfac/2, y, string, DTA_CleanNoMove, true);
|
|
|
|
return y + pinfo.mFont.GetHeight() * CleanYfac;
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// 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);
|
2020-10-03 11:32:39 +00:00
|
|
|
int midx = cwidth / 2;
|
2019-02-20 23:35:27 +00:00
|
|
|
|
|
|
|
if (TexMan.OkForLocalization(patch, stringname))
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2019-02-20 23:35:27 +00:00
|
|
|
let size = TexMan.GetScaledSize(patch);
|
2020-10-03 11:32:39 +00:00
|
|
|
DrawTexture(patch, midx - size.X * scaleFactorX/2, y, true);
|
|
|
|
return y + int(size.Y * scaleFactorY);
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
2019-02-20 23:35:27 +00:00
|
|
|
else
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
DrawText(pinfo.mFont, pinfo.mColor, midx - pinfo.mFont.StringWidth(string) * scaleFactorX/2, y, string, true);
|
|
|
|
return y + pinfo.mFont.GetHeight() * scaleFactorY;
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
}
|
2019-02-20 23:35:27 +00:00
|
|
|
|
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-02-20 23:35:27 +00:00
|
|
|
virtual int drawLF ()
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2019-07-30 08:52:24 +00:00
|
|
|
bool ispatch = wbs.LName0.isValid();
|
2020-10-03 11:32:39 +00:00
|
|
|
int oldy = TITLEY * scaleFactorY;
|
2019-07-14 10:44:42 +00:00
|
|
|
int h;
|
2019-07-30 08:52:24 +00:00
|
|
|
|
|
|
|
if (!ispatch)
|
|
|
|
{
|
|
|
|
let asc = mapname.mFont.GetMaxAscender(lnametexts[1]);
|
|
|
|
if (asc > TITLEY - 2)
|
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
oldy = (asc+2) * scaleFactorY;
|
2019-07-30 08:52:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int y = DrawName(oldy, wbs.LName0, lnametexts[0]);
|
2019-07-14 10:44:42 +00:00
|
|
|
|
2019-07-30 08:52:24 +00:00
|
|
|
// If the displayed info is made of patches we need some additional offsetting here.
|
|
|
|
if (ispatch)
|
|
|
|
{
|
2019-08-07 10:09:47 +00:00
|
|
|
int disp = 0;
|
2019-07-30 08:52:24 +00:00
|
|
|
// The offset getting applied here must at least be as tall as the largest ascender in the following text to avoid overlaps.
|
2019-08-07 10:09:47 +00:00
|
|
|
if (authortexts[0].length() == 0)
|
|
|
|
{
|
|
|
|
int h1 = BigFont.GetHeight() - BigFont.GetDisplacement();
|
2020-10-03 11:32:39 +00:00
|
|
|
int h2 = (y - oldy) / scaleFactorY / 4;
|
2019-08-07 10:09:47 +00:00
|
|
|
disp = min(h1, h2);
|
|
|
|
|
|
|
|
if (!TexMan.OkForLocalization(finishedPatch, "$WI_FINISHED"))
|
|
|
|
{
|
2022-04-26 16:06:26 +00:00
|
|
|
disp += finishedp.mFont.GetMaxAscender("$WI_FINISHED");
|
2019-08-07 10:09:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2019-07-30 08:52:24 +00:00
|
|
|
{
|
2019-08-07 10:09:47 +00:00
|
|
|
disp += author.mFont.GetMaxAscender(authortexts[0]);
|
|
|
|
}
|
2020-10-03 11:32:39 +00:00
|
|
|
y += disp * scaleFactorY;
|
2019-07-30 08:52:24 +00:00
|
|
|
}
|
|
|
|
|
2019-08-07 10:09:47 +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!"
|
2019-02-21 00:13:42 +00:00
|
|
|
|
2020-10-03 11:32:39 +00:00
|
|
|
int statsy = multiplayer? NG_STATSY : SP_STATSY * scaleFactorY;
|
2022-04-26 16:06:26 +00:00
|
|
|
if (y < (statsy - finishedp.mFont.GetHeight()*3/4) * scaleFactorY)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
// don't draw 'finished' if the level name is too tall
|
2022-04-26 16:06:26 +00:00
|
|
|
y = DrawPatchOrText(y, finishedp, finishedPatch, "$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-02-20 23:35:27 +00:00
|
|
|
virtual void drawEL ()
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2019-07-30 08:52:24 +00:00
|
|
|
bool ispatch = TexMan.OkForLocalization(enteringPatch, "$WI_ENTERING");
|
2020-10-03 11:32:39 +00:00
|
|
|
int oldy = TITLEY * scaleFactorY;
|
2017-03-18 11:16:44 +00:00
|
|
|
|
2019-07-30 08:52:24 +00:00
|
|
|
if (!ispatch)
|
|
|
|
{
|
|
|
|
let asc = entering.mFont.GetMaxAscender("$WI_ENTERING");
|
|
|
|
if (asc > TITLEY - 2)
|
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
oldy = (asc+2) * scaleFactorY;
|
2019-07-30 08:52:24 +00:00
|
|
|
}
|
|
|
|
}
|
2019-07-14 10:44:42 +00:00
|
|
|
|
2019-07-30 08:52:24 +00:00
|
|
|
int y = DrawPatchOrText(oldy, entering, enteringPatch, "$WI_ENTERING");
|
|
|
|
|
|
|
|
// If the displayed info is made of patches we need some additional offsetting here.
|
|
|
|
|
|
|
|
if (ispatch)
|
2019-07-14 10:44:42 +00:00
|
|
|
{
|
2019-07-30 08:52:24 +00:00
|
|
|
int h1 = BigFont.GetHeight() - BigFont.GetDisplacement();
|
|
|
|
let size = TexMan.GetScaledSize(enteringPatch);
|
|
|
|
int h2 = int(size.Y);
|
|
|
|
let disp = min(h1, h2) / 4;
|
|
|
|
// The offset getting applied here must at least be as tall as the largest ascender in the following text to avoid overlaps.
|
|
|
|
if (!wbs.LName1.isValid())
|
|
|
|
{
|
|
|
|
disp += mapname.mFont.GetMaxAscender(lnametexts[1]);
|
|
|
|
}
|
2020-10-03 11:32:39 +00:00
|
|
|
y += disp * scaleFactorY;
|
2019-07-30 08:52:24 +00:00
|
|
|
}
|
|
|
|
|
2019-08-02 07:11:40 +00:00
|
|
|
y = DrawName(y, wbs.LName1, lnametexts[1]);
|
2019-08-07 10:09:47 +00:00
|
|
|
|
|
|
|
if (wbs.LName1.isValid() && authortexts[1].length() > 0)
|
|
|
|
{
|
|
|
|
// Consdider the ascender height of the following text.
|
2020-10-03 11:32:39 +00:00
|
|
|
y += author.mFont.GetMaxAscender(authortexts[1]) * scaleFactorY;
|
2019-08-07 10:09:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DrawAuthor(y, authortexts[1]);
|
2019-08-02 07:11:40 +00:00
|
|
|
|
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.
|
|
|
|
//
|
|
|
|
//====================================================================
|
2019-02-20 23:16:48 +00:00
|
|
|
int drawNum (Font fnt, int x, int y, int n, int digits, bool leadingzeros = true, int translation = Font.CR_UNTRANSLATED, bool nomove = false)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
int fntwidth = fnt.StringWidth("3");
|
|
|
|
String text;
|
|
|
|
int len;
|
|
|
|
|
2020-10-03 11:32:39 +00:00
|
|
|
if (nomove && scalemode == -1)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
fntwidth *= scaleFactorX;
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2019-02-20 23:16:48 +00:00
|
|
|
void drawPercent (Font fnt, int x, int y, int p, int b, bool show_total = true, int color = Font.CR_UNTRANSLATED, bool nomove = false)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
if (p < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (wi_percents)
|
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
if (nomove && scalemode == -1)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
x -= fnt.StringWidth("%") * scaleFactorX;
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
x -= fnt.StringWidth("%");
|
|
|
|
}
|
2020-10-03 11:32:39 +00:00
|
|
|
DrawText(fnt, color, x, y, "%", nomove);
|
2019-02-20 23:16:48 +00:00
|
|
|
if (nomove)
|
2017-03-18 11:16:44 +00:00
|
|
|
{
|
|
|
|
x -= 2*CleanXfac;
|
|
|
|
}
|
2020-10-03 11:32:39 +00:00
|
|
|
drawNum(fnt, x, y, b == 0 ? 100 : p * 100 / b, -1, false, color, nomove);
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (show_total)
|
|
|
|
{
|
2020-10-03 11:32:39 +00:00
|
|
|
x = drawNum(fnt, x, y, b, 2, false, color, nomove);
|
2017-03-18 11:16:44 +00:00
|
|
|
x -= fnt.StringWidth("/");
|
2020-10-03 11:32:39 +00:00
|
|
|
DrawText (fnt, color, x, y, "/", nomove);
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
2020-10-03 11:32:39 +00:00
|
|
|
drawNum (fnt, x, y, p, -1, false, color, nomove);
|
2017-03-18 11:16:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-03 11:32:39 +00:00
|
|
|
|
2019-03-17 19:28:12 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
2020-10-03 11:32:39 +00:00
|
|
|
// Display level completion time and par, or "sucks" message if overflow.
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
void drawTimeFont (Font printFont, int x, int y, int t, int color)
|
|
|
|
{
|
|
|
|
bool sucky;
|
|
|
|
|
|
|
|
if (t < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
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 = printFont.GetCharWidth("3");
|
|
|
|
int colon_spacing = printFont.GetCharWidth(":");
|
|
|
|
|
|
|
|
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, 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, Font.CR_UNTRANSLATED);
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// the 'scaled' drawers are for the multiplayer scoreboard
|
2019-03-17 19:28:12 +00:00
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
void drawTextScaled (Font fnt, double x, double y, String text, double scale, int translation = Font.CR_UNTRANSLATED)
|
|
|
|
{
|
|
|
|
screen.DrawText(fnt, translation, x / scale, y / scale, text, DTA_VirtualWidthF, screen.GetWidth() / scale, DTA_VirtualHeightF, screen.GetHeight() / scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
void drawNumScaled (Font fnt, int x, int y, double scale, int n, int digits, int translation = Font.CR_UNTRANSLATED)
|
|
|
|
{
|
|
|
|
String s = String.Format("%d", n);
|
|
|
|
drawTextScaled(fnt, x - fnt.StringWidth(s) * scale, y, s, scale, translation);
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
void drawPercentScaled (Font fnt, int x, int y, int p, int b, double scale, bool show_total = true, int color = Font.CR_UNTRANSLATED)
|
|
|
|
{
|
|
|
|
if (p < 0) return;
|
|
|
|
|
|
|
|
String s;
|
|
|
|
if (wi_percents)
|
|
|
|
{
|
|
|
|
s = String.Format("%d%%", b == 0 ? 100 : p * 100 / b);
|
|
|
|
}
|
|
|
|
else if (show_total)
|
|
|
|
{
|
|
|
|
s = String.Format("%d/%3d", p, b);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
s = String.Format("%d", p);
|
|
|
|
}
|
|
|
|
drawTextScaled(fnt, x - fnt.StringWidth(s) * scale, y, s, scale, color);
|
|
|
|
}
|
|
|
|
|
2020-08-30 00:53:05 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
// Display the completed time scaled
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
void drawTimeScaled (Font fnt, int x, int y, int t, double scale, int color = Font.CR_UNTRANSLATED)
|
|
|
|
{
|
|
|
|
if (t < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
int hours = t / 3600;
|
|
|
|
t -= hours * 3600;
|
|
|
|
int minutes = t / 60;
|
|
|
|
t -= minutes * 60;
|
|
|
|
int seconds = t;
|
|
|
|
|
2020-08-30 12:12:23 +00:00
|
|
|
String s = (hours > 0 ? String.Format("%d:", hours) : "") .. String.Format("%02d:%02d", minutes, seconds);
|
2020-08-30 00:53:05 +00:00
|
|
|
|
|
|
|
drawTextScaled(fnt, x - fnt.StringWidth(s) * scale, y, s, scale, color);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
bool autoSkip()
|
2017-03-18 14:42:34 +00:00
|
|
|
{
|
2020-10-04 18:26:37 +00:00
|
|
|
return wi_autoadvance > 0 && bcnt > (wi_autoadvance * GameTicRate);
|
2017-03-18 14:42:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
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!
|
2022-04-26 17:26:36 +00:00
|
|
|
jobstate = finished;
|
2017-03-18 14:42:34 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
CurState = ShowNextLoc;
|
|
|
|
acceleratestage = 0;
|
2020-10-04 18:26:37 +00:00
|
|
|
cnt = SHOWNEXTLOCDELAY * GameTicRate;
|
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)
|
|
|
|
{
|
2020-01-04 18:32:05 +00:00
|
|
|
S_StartSound(snd, CHAN_VOICE, CHANF_MAYBE_LOCAL|CHANF_UI, 1, ATTN_NONE);
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ====================================================================
|
2022-04-26 16:06:26 +00:00
|
|
|
//
|
2017-03-18 18:34:03 +00:00
|
|
|
// 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
|
|
|
|
//
|
|
|
|
// ====================================================================
|
|
|
|
|
2022-04-26 16:06:26 +00:00
|
|
|
override bool OnEvent(InputEvent evt)
|
2017-03-18 18:34:03 +00:00
|
|
|
{
|
2022-04-22 11:39:44 +00:00
|
|
|
if (evt.type == InputEvent.Type_KeyDown)
|
|
|
|
{
|
|
|
|
accelerateStage = 1;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
2022-04-22 11:39:44 +00:00
|
|
|
|
2022-04-26 16:06:26 +00:00
|
|
|
void nextStage()
|
|
|
|
{
|
|
|
|
accelerateStage = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// this one is no longer used, but still needed for old content referencing them.
|
|
|
|
deprecated("4.8") void checkForAccelerate()
|
2022-04-22 10:43:08 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
// ====================================================================
|
|
|
|
// Ticker
|
|
|
|
// Purpose: Do various updates every gametic, for stats, animation,
|
|
|
|
// checking that intermission music is running, etc.
|
|
|
|
// Args: none
|
|
|
|
// Returns: void
|
|
|
|
//
|
|
|
|
// ====================================================================
|
|
|
|
|
|
|
|
virtual void StartMusic()
|
|
|
|
{
|
2019-02-01 23:24:43 +00:00
|
|
|
Level.SetInterMusic(wbs.next);
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
//
|
2022-04-26 16:06:26 +00:00
|
|
|
// Two stage interface to allow redefining this class as a screen job
|
2017-03-18 18:34:03 +00:00
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2022-04-26 16:06:26 +00:00
|
|
|
protected virtual void Ticker()
|
2017-03-18 18:34:03 +00:00
|
|
|
{
|
|
|
|
// counter for general background animation
|
|
|
|
bcnt++;
|
|
|
|
|
|
|
|
if (bcnt == 1)
|
|
|
|
{
|
|
|
|
StartMusic();
|
|
|
|
}
|
|
|
|
|
|
|
|
bg.updateAnimatedBack();
|
|
|
|
|
|
|
|
switch (CurState)
|
|
|
|
{
|
|
|
|
case StatCount:
|
|
|
|
updateStats();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ShowNextLoc:
|
|
|
|
updateShowNextLoc();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NoState:
|
|
|
|
updateNoState();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LeavingIntermission:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-03-18 20:19:32 +00:00
|
|
|
|
2022-04-26 16:06:26 +00:00
|
|
|
override void OnTick()
|
|
|
|
{
|
|
|
|
Ticker();
|
|
|
|
if (CurState == StatusScreen.LeavingIntermission) jobstate = finished;
|
|
|
|
}
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
2022-04-26 16:06:26 +00:00
|
|
|
protected virtual void Drawer()
|
2017-03-18 18:34:03 +00:00
|
|
|
{
|
|
|
|
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:
|
2020-06-06 08:38:35 +00:00
|
|
|
case LeavingIntermission: // this must still draw the screen once more for the wipe code to pick up.
|
2017-03-18 18:34:03 +00:00
|
|
|
drawShowNextLoc();
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
drawNoState();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-26 16:06:26 +00:00
|
|
|
override void Draw(double smoothratio)
|
|
|
|
{
|
|
|
|
Drawer();
|
|
|
|
}
|
|
|
|
|
2017-03-18 18:34:03 +00:00
|
|
|
//====================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//====================================================================
|
|
|
|
|
|
|
|
virtual void Start (wbstartstruct wbstartstruct)
|
|
|
|
{
|
|
|
|
wbs = wbstartstruct;
|
|
|
|
acceleratestage = 0;
|
|
|
|
cnt = bcnt = 0;
|
|
|
|
me = wbs.pnum;
|
2020-08-30 13:34:53 +00:00
|
|
|
otherkills = wbs.totalkills;
|
|
|
|
for (int i = 0; i < MAXPLAYERS; i++)
|
|
|
|
{
|
|
|
|
Plrs[i] = wbs.plyr[i];
|
|
|
|
otherkills -= Plrs[i].skills;
|
|
|
|
}
|
2020-11-24 15:40:30 +00:00
|
|
|
|
|
|
|
if (gameinfo.mHideParTimes)
|
|
|
|
{
|
|
|
|
// par time and suck time are not displayed if zero.
|
|
|
|
wbs.partime = 0;
|
|
|
|
wbs.sucktime = 0;
|
|
|
|
}
|
2017-03-18 18:34:03 +00:00
|
|
|
|
2019-02-20 23:35:27 +00:00
|
|
|
entering.Init(gameinfo.mStatscreenEnteringFont);
|
2022-04-26 16:06:26 +00:00
|
|
|
finishedp.Init(gameinfo.mStatscreenFinishedFont);
|
2017-03-18 18:34:03 +00:00
|
|
|
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
|
|
|
|
2019-02-19 23:44:17 +00:00
|
|
|
Kills = TexMan.CheckForTexture("WIOSTK", TexMan.Type_MiscPatch); // "kills"
|
|
|
|
Secret = TexMan.CheckForTexture("WIOSTS", TexMan.Type_MiscPatch); // "scrt", not used
|
|
|
|
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"
|
2019-02-20 23:35:27 +00:00
|
|
|
enteringPatch = TexMan.CheckForTexture("WIENTER", TexMan.Type_MiscPatch); // "entering"
|
|
|
|
finishedPatch = TexMan.CheckForTexture("WIF", TexMan.Type_MiscPatch); // "finished"
|
2017-03-18 18:34:03 +00:00
|
|
|
|
2019-11-10 17:03:47 +00:00
|
|
|
lnametexts[0] = StringTable.Localize(wbstartstruct.thisname);
|
|
|
|
lnametexts[1] = StringTable.Localize(wbstartstruct.nextname);
|
|
|
|
authortexts[0] = StringTable.Localize(wbstartstruct.thisauthor);
|
|
|
|
authortexts[1] = StringTable.Localize(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();
|
2020-10-03 11:32:39 +00:00
|
|
|
|
|
|
|
wrapwidth = cwidth = screen.GetWidth();
|
|
|
|
cheight = screen.GetHeight();
|
|
|
|
scalemode = -1;
|
|
|
|
scaleFactorX = CleanXfac;
|
|
|
|
scaleFactorY = CleanYfac;
|
2017-03-18 18:34:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|