- Blood: handle super secrets properly in the statistics display.

Fixes #198
This commit is contained in:
Christoph Oelckers 2020-11-26 07:48:34 +01:00
parent 1504e19cf8
commit 82d80f3f07
3 changed files with 11 additions and 5 deletions

View file

@ -252,8 +252,9 @@ private:
stats.kills = gKillMgr.Kills; stats.kills = gKillMgr.Kills;
stats.maxkills = gKillMgr.TotalKills; stats.maxkills = gKillMgr.TotalKills;
stats.frags = gGameOptions.nGameType == 3? pPlayer->fragCount : -1; stats.frags = gGameOptions.nGameType == 3? pPlayer->fragCount : -1;
stats.secrets = gSecretMgr.Founds + gSecretMgr.Super; stats.secrets = gSecretMgr.Founds;
stats.maxsecrets = gSecretMgr.Total; stats.supersecrets = gSecretMgr.Super;
stats.maxsecrets = max(gSecretMgr.Founds, gSecretMgr.Total); // If we found more than there are, increase the total. Some levels have a bugged counter.
DBaseStatusBar::PrintLevelStats(stats); DBaseStatusBar::PrintLevelStats(stats);
} }

View file

@ -76,7 +76,7 @@ struct FLevelStats
int time; // in milliseconds int time; // in milliseconds
int frags; int frags;
int kills, maxkills; // set maxkills to -1 to ignore, or to -2 to only print kills int kills, maxkills; // set maxkills to -1 to ignore, or to -2 to only print kills
int secrets, maxsecrets; // set maxsecrets to -1 to ignore int secrets, maxsecrets, supersecrets; // set maxsecrets to -1 to ignore
int spacing; // uses fontheight if 0 or less. int spacing; // uses fontheight if 0 or less.
EColorRange letterColor, standardColor, completeColor; EColorRange letterColor, standardColor, completeColor;
double fontscale; double fontscale;

View file

@ -192,8 +192,13 @@ void DBaseStatusBar::PrintLevelStats(FLevelStats &stats)
if (stats.maxsecrets > 0) // don't bother if there are no secrets. if (stats.maxsecrets > 0) // don't bother if there are no secrets.
{ {
text.Format(TEXTCOLOR_ESCAPESTR "%cS: " TEXTCOLOR_ESCAPESTR "%c%d/%d", if (stats.supersecrets <= 0)
stats.letterColor + 'A', stats.secrets == stats.maxsecrets ? stats.completeColor + 'A' : stats.standardColor + 'A', stats.secrets, stats.maxsecrets); text.Format(TEXTCOLOR_ESCAPESTR "%cS: " TEXTCOLOR_ESCAPESTR "%c%d/%d",
stats.letterColor + 'A', stats.secrets >= stats.maxsecrets ? stats.completeColor + 'A' : stats.standardColor + 'A', stats.secrets, stats.maxsecrets);
else
text.Format(TEXTCOLOR_ESCAPESTR "%cS: " TEXTCOLOR_ESCAPESTR "%c%d/%d+%d",
stats.letterColor + 'A', stats.secrets >= stats.maxsecrets ? stats.completeColor + 'A' : stats.standardColor + 'A', stats.secrets, stats.maxsecrets, stats.supersecrets);
DrawText(twod, stats.font, CR_UNTRANSLATED, 2 * hud_statscale + scale, y1 + scale, text, DTA_FullscreenScale, FSMode_ScaleToHeight, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DrawText(twod, stats.font, CR_UNTRANSLATED, 2 * hud_statscale + scale, y1 + scale, text, DTA_FullscreenScale, FSMode_ScaleToHeight, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200,
DTA_KeepRatio, true, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_LegacyRenderStyle, STYLE_TranslucentStencil, DTA_Color, black, TAG_DONE); DTA_KeepRatio, true, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_LegacyRenderStyle, STYLE_TranslucentStencil, DTA_Color, black, TAG_DONE);