diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 2388da789..a7c3aabb1 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -779,6 +779,10 @@ int RunGame() cl_weaponswitch.SetGenericRepDefault(1, CVAR_Int); if (cl_weaponswitch > 1) cl_weaponswitch = 1; } + if (g_gameType & (GAMEFLAG_BLOOD|GAMEFLAG_RR)) + { + am_nameontop.SetGenericRepDefault(true, CVAR_Bool); // Blood and RR show the map name on the top of the screen by default. + } G_ReadConfig(currentGame); diff --git a/source/core/gamecvars.cpp b/source/core/gamecvars.cpp index b761d1e8b..bfe5f94a9 100644 --- a/source/core/gamecvars.cpp +++ b/source/core/gamecvars.cpp @@ -475,6 +475,7 @@ CUSTOM_CVAR(Int, playergender, 0, CVAR_USERINFO|CVAR_ARCHIVE) CVAR(Bool, am_textfont, false, CVAR_ARCHIVE) CVAR(Bool, am_showlabel, false, CVAR_ARCHIVE) +CVAR(Bool, am_nameontop, false, CVAR_ARCHIVE) // Internal settings for demo recording and the multiplayer menu. These won't get saved and only are CVARs so that the menu code can use them. diff --git a/source/core/gamecvars.h b/source/core/gamecvars.h index 7dd9be2b5..e6dc812c9 100644 --- a/source/core/gamecvars.h +++ b/source/core/gamecvars.h @@ -72,6 +72,7 @@ EXTERN_CVAR(Int, althud_flashing) EXTERN_CVAR(Bool, am_textfont) EXTERN_CVAR(Bool, am_showlabel) +EXTERN_CVAR(Bool, am_nameontop) EXTERN_CVAR(Int, r_fov) diff --git a/source/core/statusbar.cpp b/source/core/statusbar.cpp index 5312f66db..7f27f8787 100644 --- a/source/core/statusbar.cpp +++ b/source/core/statusbar.cpp @@ -92,10 +92,6 @@ CVAR (Color, crosshaircolor, 0xff0000, CVAR_ARCHIVE); CVAR (Int, crosshairhealth, 1, CVAR_ARCHIVE); CVAR (Float, crosshairscale, 1.0, CVAR_ARCHIVE); CVAR (Bool, crosshairgrow, false, CVAR_ARCHIVE); -CUSTOM_CVAR(Int, am_showmaplabel, 2, CVAR_ARCHIVE) -{ - if (self < 0 || self > 2) self = 2; -} CVAR (Bool, idmypos, false, 0); diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index cdec97b5c..cf8353f99 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -653,29 +653,6 @@ void drawoverheadmap(int cposx, int cposy, int czoom, int cang) DTA_Color, shadeToLight(sprite[pp.i].shade), DTA_ScaleX, j / 65536., DTA_ScaleY, j/65536., TAG_DONE); } } - - if (/*textret == 0 &&*/ ud.overhead_on == 2) - { - FString mapname; - if (am_showlabel) mapname.Format(TEXTCOLOR_GOLD "%s: %s%s", currentLevel->LabelName(), (am_textfont && isNamWW2GI()) ? TEXTCOLOR_ORANGE : TEXTCOLOR_UNTRANSLATED, currentLevel->DisplayName()); - else mapname = currentLevel->DisplayName(); - double scale = isRR() ? 0.5 : 1.; - FFont* font = SmallFont2; - int color = CR_UNTRANSLATED; - if (am_textfont) - { - scale *= 0.66; - font = isNamWW2GI()? ConFont : SmallFont; - if (isNamWW2GI()) color = CR_ORANGE; - } - int top = (isRR() && !am_textfont) ? 0 : (hud_size != Hud_Nothing ? 147 : 179); - if (!(currentLevel->flags & MI_USERMAP)) - DrawText(twod, font, color, 5, top+6, GStrings.localize(gVolumeNames[volfromlevelnum(currentLevel->levelNumber)]), - DTA_FullscreenScale, FSMode_ScaleToFit43, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_KeepRatio, true, TAG_DONE); - DrawText(twod, font, color, 5, top + ((isRR() && am_textfont)? 15:12), mapname, - DTA_FullscreenScale, FSMode_ScaleToFit43, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_KeepRatio, true, TAG_DONE); - } - } //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/sbar.cpp b/source/games/duke/src/sbar.cpp index ed5834fa5..3c809b184 100644 --- a/source/games/duke/src/sbar.cpp +++ b/source/games/duke/src/sbar.cpp @@ -39,6 +39,8 @@ source as it is released. #include "sbar.h" #include "v_draw.h" #include "texturemanager.h" +#include "mapinfo.h" + BEGIN_DUKE_NS //========================================================================== @@ -177,9 +179,31 @@ PalEntry DDukeCommonStatusBar::LightForShade(int shade) void DDukeCommonStatusBar::PrintLevelStats(int bottomy) { - // JBF 20040124: display level stats in screen corner - if (ud.overhead_on != 2 && hud_stats) + if (ud.overhead_on == 2) { + // Automap label printer moved here so that it is on top of the screen border. + FString mapname; + if (am_showlabel) mapname.Format(TEXTCOLOR_GOLD "%s: %s%s", currentLevel->LabelName(), (am_textfont && isNamWW2GI()) ? TEXTCOLOR_ORANGE : TEXTCOLOR_UNTRANSLATED, currentLevel->DisplayName()); + else mapname = currentLevel->DisplayName(); + double scale = isRR() ? 0.5 : 1.; + FFont* font = SmallFont2; + int color = CR_UNTRANSLATED; + if (am_textfont) + { + scale *= 0.66; + font = isNamWW2GI() ? ConFont : SmallFont; + if (isNamWW2GI()) color = CR_ORANGE; + } + int top = am_nameontop ? 0 : 200 - Scale(bottomy < 0 ? RelTop : bottomy, hud_scale, 100) - isRR()? 25 : 20; + if (!(currentLevel->flags & MI_USERMAP)) + DrawText(twod, font, color, 5, top + 6, GStrings.localize(gVolumeNames[volfromlevelnum(currentLevel->levelNumber)]), + DTA_FullscreenScale, FSMode_ScaleToFit43, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_KeepRatio, true, TAG_DONE); + DrawText(twod, font, color, 5, top + ((isRR() && am_textfont) ? 15 : 12), mapname, + DTA_FullscreenScale, FSMode_ScaleToFit43, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_ScaleX, scale, DTA_ScaleY, scale, DTA_KeepRatio, true, TAG_DONE); + } + else if (hud_stats) + { + // JBF 20040124: display level stats in screen corner FLevelStats stats{}; auto pp = &ps[myconnectindex];