Navigation Menu

Skip to content

Commit

Permalink
- removed the multiplayer scoreboard screens.
Browse files Browse the repository at this point in the history
Since there is no plan to keep them in case MP gets implemented there's no need to maintain them.
These should later be replaced by a generic screen using a better font and a layout that takes higher resolutions into account.
  • Loading branch information
coelckers committed May 27, 2021
1 parent fd97da0 commit d445008
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 265 deletions.
2 changes: 2 additions & 0 deletions source/common/utility/utf8.cpp
Expand Up @@ -354,6 +354,8 @@ int getAlternative(int code)
default:
return code;

case '{': return '(';
case '}': return ')';
case 0x17f: return 's'; // The 'long s' can be safely remapped to the regular variant, not that this gets used in any real text...
case 0x218: return 0x15e; // Romanian S with comma below may get remapped to S with cedilla.
case 0x219: return 0x15f;
Expand Down
3 changes: 3 additions & 0 deletions source/core/gamecontrol.cpp
Expand Up @@ -82,6 +82,9 @@ CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, autoloadwidescreen, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)

// Note: For the automap label there is a separate option "am_textfont".
CVARD(Bool, hud_textfont, false, CVAR_ARCHIVE, "Use the regular text font as replacement for the tiny 3x5 font for HUD messages whenever possible")

EXTERN_CVAR(Bool, ui_generic)

CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG)
Expand Down
2 changes: 2 additions & 0 deletions source/core/gamecontrol.h
Expand Up @@ -12,6 +12,8 @@
#include "i_time.h"
#include "palentry.h"

EXTERN_CVAR(Bool, hud_textfont)

extern bool sendsave;
extern FString savedescription;
extern FString savegamefile;
Expand Down
2 changes: 0 additions & 2 deletions source/games/sw/src/menus.h
Expand Up @@ -32,8 +32,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms

BEGIN_SW_NS

void MNU_DrawSmallString(int x, int y, const char* string, int shade, int pal, int align = -1, double alpha = 1);

END_SW_NS

#endif
25 changes: 13 additions & 12 deletions source/games/sw/src/sbar.cpp
Expand Up @@ -74,15 +74,6 @@ static void UpdateFrame(void)
//
//---------------------------------------------------------------------------

void DrawConString(int x, int y, const char* string, double alpha)
{
x = x * 2 - SmallFont->StringWidth(string) / 2;
y *= 2;
DrawText(twod, SmallFont, CR_TAN, x, y, string, DTA_FullscreenScale, FSMode_Fit640x400, DTA_Alpha, alpha, TAG_DONE);

}


void UpdateStatusBar()
{
if (hud_size <= Hud_Stbar)
Expand All @@ -105,13 +96,23 @@ void UpdateStatusBar()
{
const int MESSAGE_LINE = 142; // Used to be 164

if (!SmallFont2->CanPrint(pp->cookieQuote))
DrawConString(160, MESSAGE_LINE, pp->cookieQuote, clamp(pp->cookieTime / 60., 0., 1.));
if (hud_textfont || !SmallFont2->CanPrint(pp->cookieQuote))
{
int x = 320 - SmallFont->StringWidth(pp->cookieQuote) / 2;
DrawText(twod, SmallFont, CR_UNDEFINED, x, MESSAGE_LINE*2, pp->cookieQuote, DTA_FullscreenScale, FSMode_Fit640x400,
DTA_Alpha, clamp(pp->cookieTime / 60., 0., 1.), TAG_DONE);
}
else
MNU_DrawSmallString(160, MESSAGE_LINE, pp->cookieQuote, 0, 0, 0, clamp(pp->cookieTime / 60., 0., 1.));
{
int x = 160 - SmallFont2->StringWidth(pp->cookieQuote) / 2;
DrawText(twod, SmallFont2, CR_UNDEFINED, x, MESSAGE_LINE, pp->cookieQuote, DTA_FullscreenScale, FSMode_Fit320x200,
DTA_Alpha, clamp(pp->cookieTime / 60., 0., 1.), TAG_DONE);

}
}
}




END_SW_NS
19 changes: 0 additions & 19 deletions source/games/sw/src/text.cpp
Expand Up @@ -102,25 +102,6 @@ void InitFonts()
BigFont->SetKerning(1);
}

//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------

void MNU_DrawSmallString(int x, int y, const char* string, int shade, int pal, int align, double alpha)
{
if (align > -1)
{
int w = SmallFont2->StringWidth(string);
if (align == 0) x -= w / 2;
else x -= w;
}
DrawText(twod, SmallFont2, CR_UNDEFINED, x, y, string, DTA_FullscreenScale, FSMode_Fit320x200,
DTA_Color, shadeToLight(shade), DTA_TranslationIndex, TRANSLATION(Translation_Remap, pal), DTA_Alpha, alpha, TAG_DONE);

}

//---------------------------------------------------------------------------
//
// Notification messages. Native SW-style display should later be
Expand Down
56 changes: 18 additions & 38 deletions wadsrc/static/zscript/games/blood/ui/screens.zs
Expand Up @@ -123,6 +123,20 @@ struct BloodScreen

}

//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------

static void DrawLocalizedText(int x, int y, String text, int position = 1)
{
let text = StringTable.Localize(text);
if (hud_textfont || !SmallFont2.CanPrint(text))
DrawText(SmallFont, text, x, y, 1);
else
DrawText(SmallFont2, text, x, y, 1, shadow: true);
}
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -184,19 +198,15 @@ class BloodSummaryScreen : SummaryScreenBase
BloodScreen.DrawCaption("$TXTB_LEVELSTATS", 0, true);
if (stats.cheated)
{
let text = StringTable.Localize("$TXTB_CHEATED");
let font = SmallFont2.CanPrint(text)? SmallFont2 : SmallFont;
BloodScreen.DrawText(font, text, 160, 32, 1, shadow:font == SmallFont2);
BloodScreen.DrawLocalizedText(160, 32, "$TXTB_CHEATED");
}
DrawKills();
DrawSecrets();

int myclock = ticks * 120 / GameTicRate;
if ((myclock & 32))
{
let text = StringTable.Localize("$PRESSKEY");
let font = SmallFont2.CanPrint(text)? SmallFont2 : SmallFont;
BloodScreen.DrawText(font, text, 160, 134, 1, shadow:font == SmallFont2);
BloodScreen.DrawLocalizedText(160, 134, "$PRESSKEY");
}
}

Expand Down Expand Up @@ -227,37 +237,10 @@ class BloodMPSummaryScreen : SkippableScreenJob
Blood.sndStartSample(268, 128, -1, false, CHANF_UI);
}

void DrawKills()
{
String pBuffer;
BloodScreen.DrawText(SmallFont2, "#", 85, 35);
BloodScreen.DrawText(SmallFont2, "$NAME", 100, 35);
BloodScreen.DrawText(SmallFont2, "$FRAGS", 210, 35);

for (int i = 0; i < numplayers; i++)
{
pBuffer = String.Format( "%-2d", i);
BloodScreen.DrawText(SmallFont2, pBuffer, 85, 50 + 8 * i);
pBuffer = String.Format( "%s", Raze.PlayerName(i));
BloodScreen.DrawText(SmallFont2, pBuffer, 100, 50 + 8 * i);
pBuffer = String.Format( "%d", Raze.playerFrags(i, -1));
BloodScreen.DrawText(SmallFont2, pBuffer, 210, 50 + 8 * i);
}
}

override void Draw(double sr)
{
BloodScreen.DrawBackground();
BloodScreen.DrawCaption("$TXTB_FRAGSTATS", 0, true);
DrawKills();

int myclock = ticks * 120 / GameTicRate;
if ((myclock & 32))
{
let text = StringTable.Localize("$PRESSKEY");
let font = SmallFont2.CanPrint(text)? SmallFont2 : SmallFont;
BloodScreen.DrawText(font, text, 160, 134, 1, shadow:font == SmallFont2);
}
Raze.DrawScoreboard(60);
}
}

Expand Down Expand Up @@ -293,10 +276,7 @@ class BloodLoadScreen : ScreenJob
BloodScreen.DrawBackground();
BloodScreen.DrawCaption(loadtext, 0, true);
BloodScreen.DrawText(BigFont, rec.DisplayName(), 160, 50, 1);

let text = StringTable.Localize("$TXTB_PLSWAIT");
let font = SmallFont2.CanPrint(text)? SmallFont2 : SmallFont;
BloodScreen.DrawText(font, text, 160, 134, 1, shadow:font == SmallFont2);
BloodScreen.DrawLocalizedText(160, 134, "$TXTB_PLSWAIT");
}
}

Expand Down
15 changes: 0 additions & 15 deletions wadsrc/static/zscript/games/duke/dukegame.zs
Expand Up @@ -110,21 +110,6 @@ struct Duke native
if (align != -1) x -= SmallFont.StringWidth(t) * (align == 0 ? 0.5 : 1);
Screen.DrawText(SmallFont, Font.CR_UNDEFINED, x, y + 2, t, DTA_FullscreenScale, fsmode, DTA_TranslationIndex, Translation.MakeID(Translation_Remap, trans), DTA_Color, Raze.shadeToLight(shade));
}

static void MiniText(double x, double y, String t, int shade, int align = -1, int trans = 0)
{
int fsmode = FSMode_Fit320x200;
if (Raze.isRR())
{
x *= 2;
y *= 2;
fsmode = FSMode_Fit640x400;
}
if (align != -1) x -= SmallFont2.StringWidth(t) * (align == 0 ? 0.5 : 1);
Screen.DrawText(SmallFont2, Font.CR_UNDEFINED, x, y, t, DTA_FullscreenScale, fsmode, DTA_TranslationIndex, Translation.MakeID(Translation_Remap, trans), DTA_Color, Raze.shadeToLight(shade));
}


}

struct DukePlayer
Expand Down
70 changes: 1 addition & 69 deletions wadsrc/static/zscript/games/duke/ui/screens.zs
Expand Up @@ -473,75 +473,7 @@ class DukeMultiplayerBonusScreen : SkippableScreenJob
Screen.DrawTexture(TexMan.CheckForTexture("INGAMEDUKETHREEDEE"), true, 160, 34, DTA_FullscreenScale, FSMode_Fit320x200, DTA_CenterOffsetRel, true, DTA_ScaleX, titlescale, DTA_ScaleY, titlescale);
if (Raze.isPlutoPak()) Screen.DrawTexture(TexMan.CheckForTexture("MENUPLUTOPAKSPRITE"), true, 260, 36, DTA_FullscreenScale, FSMode_Fit320x200, DTA_CenterOffsetRel, true);

Duke.GameText(160, isRR? 58 : 58 + 2, "$Multiplayer Totals", 0, 0);
Duke.GameText(160, 58 + 10, currentLevel.DisplayName(), 0, 0);
Duke.GameText(160, 165, "$Presskey", 8 - int(sin(currentclock / 10.) * 8), 0);

int t = 0;

Duke.MiniText(38, 80, "$Name", 0, -1, isRR? 0 : 8);
Duke.MiniText(269+20, 80, "$Kills", 0, 1, isRR? 0: 8);

for (int i = 0; i < playerswhenstarted; i++)
{
tempbuf = String.Format("%-4d", i + 1);
Duke.MiniText(92 + (i * 23), 80, tempbuf, 0, -1, isRR? 0: 3);
}

for (int i = 0; i < playerswhenstarted; i++)
{
int xfragtotal = 0;
tempbuf = String.Format("%d", i + 1);

Duke.MiniText(30, 90 + t, tempbuf, 0);
Duke.MiniText(38, 90 + t, Raze.PlayerName(i), 0, -1, Raze.playerPalette(i));

for (int y = 0; y < playerswhenstarted; y++)
{
int frag = Raze.playerFrags(i, y);
if (i == y)
{
int fraggedself = Raze.playerFraggedSelf(y);
tempbuf = String.Format("%-4d", fraggedself);
Duke.MiniText(92 + (y * 23), 90 + t, tempbuf, 0, -1, isRR? 0: 2);
xfragtotal -= fraggedself;
}
else
{
tempbuf = String.Format("%-4d", frag);
Duke.MiniText(92 + (y * 23), 90 + t, tempbuf, 0);
xfragtotal += frag;
}
/*
if (myconnectindex == connecthead)
{
tempbuf = String.Format("stats %ld killed %ld %ld\n", i + 1, y + 1, frag);
sendscore(tempbuf);
}
*/
}

tempbuf = String.Format("%-4d", xfragtotal);
Duke.MiniText(101 + (8 * 23), 90 + t, tempbuf, 0, -1, isRR? 0: 2);

t += 7;
}

for (int y = 0; y < playerswhenstarted; y++)
{
int yfragtotal = 0;
for (int i = 0; i < playerswhenstarted; i++)
{
if (i == y)
yfragtotal += Raze.playerFraggedself(i);
int frag = Raze.playerFrags(i, y);
yfragtotal += frag;
}
tempbuf = String.Format("%-4d", yfragtotal);
Duke.MiniText(92 + (y * 23), 96 + (8 * 7), tempbuf, 0, -1, isRR? 0: 2);
}

Duke.MiniText(45, 96 + (8 * 7), "$Deaths", 0, -1, isRR? 0: 8);
Raze.DrawScoreboard(60);
}
}

Expand Down
15 changes: 0 additions & 15 deletions wadsrc/static/zscript/games/sw/swgame.zs
Expand Up @@ -137,21 +137,6 @@ struct SW native
Screen.DrawText(SmallFont, Font.CR_UNDEFINED, x, y, text, DTA_FullscreenScale, FSMode_Fit320x200,
DTA_Color, Raze.shadeToLight(shade), DTA_TranslationIndex, Translation.MakeID(Translation_Remap, pal));
}

//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------

static void DrawSmallString(int x, int y, String text, int shade, int pal, int align = -1, double alpha = 1.)
{
if (align != -1) x -= SmallFont2.StringWidth(text) * (align == 0 ? 0.5 : 1);
Screen.DrawText(SmallFont2, Font.CR_UNDEFINED, x, y, text, DTA_FullscreenScale, FSMode_Fit320x200,
DTA_Color, Raze.shadeToLight(shade), DTA_TranslationIndex, Translation.MakeID(Translation_Remap, pal), DTA_Alpha, alpha);
}


}


Expand Down

0 comments on commit d445008

Please sign in to comment.