From e7c15955318b81407af063c6f23535c000286218 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 24 Aug 2020 00:05:36 +0200 Subject: [PATCH] - allow using a better font for the map name on the automap. - allow displaying the map label on the automap. So far only for Duke and related games, the rest will follow. --- source/core/gamecvars.cpp | 19 ++++--------------- source/core/gamecvars.h | 3 +++ source/games/duke/src/game_misc.cpp | 17 ++++++++++++++--- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/source/core/gamecvars.cpp b/source/core/gamecvars.cpp index c03630f3e..b761d1e8b 100644 --- a/source/core/gamecvars.cpp +++ b/source/core/gamecvars.cpp @@ -473,6 +473,10 @@ CUSTOM_CVAR(Int, playergender, 0, CVAR_USERINFO|CVAR_ARCHIVE) } +CVAR(Bool, am_textfont, false, CVAR_ARCHIVE) +CVAR(Bool, am_showlabel, 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. CVAR(Int, m_recstat, false, CVAR_NOSET) CVAR(Int, m_coop, 0, CVAR_NOSET) @@ -492,23 +496,8 @@ CVAR(String, m_netport, "19014", CVAR_NOSET) // Currently unavailable due to dependency on an obsolete OpenGL feature { "deliriumblur", "enable/disable delirium blur effect(polymost)", (void *)&gDeliriumBlur, CVAR_BOOL, 0, 1 }, - // This one gets changed at run time by the game code, so making it persistent does not work - - // This option is not really useful anymore - { "r_camrefreshdelay", "minimum delay between security camera sprite updates, 120 = 1 second", (void *)&ud.camera_time, CVAR_INT, 1, 240 }, - // This requires a different approach, because it got used like a CCMD, not a CVAR. { "skill","changes the game skill setting", (void *)&ud.m_player_skill, CVAR_INT|CVAR_FUNCPTR|CVAR_NOSAVE/*|CVAR_NOMULTI*/, 0, 5 }, - // just as a reminder: - /* - else if (!Bstrcasecmp(parm->name, "vid_gamma")) - { - } - else if (!Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast")) - { - } - */ - #endif diff --git a/source/core/gamecvars.h b/source/core/gamecvars.h index 8e68e06fb..7dd9be2b5 100644 --- a/source/core/gamecvars.h +++ b/source/core/gamecvars.h @@ -70,6 +70,9 @@ EXTERN_CVAR(Int, althud_numberpal) EXTERN_CVAR(Int, althud_shadows) EXTERN_CVAR(Int, althud_flashing) +EXTERN_CVAR(Bool, am_textfont) +EXTERN_CVAR(Bool, am_showlabel) + EXTERN_CVAR(Int, r_fov) EXTERN_CVAR(Bool, r_horizcenter) diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index e1e114630..cdec97b5c 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -656,12 +656,23 @@ void drawoverheadmap(int cposx, int cposy, int czoom, int cang) 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.; - int top = isRR() ? 0 : (hud_size != Hud_Nothing ? 147 : 179); + 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, SmallFont2, CR_UNDEFINED, 5, top+6, GStrings.localize(gVolumeNames[volfromlevelnum(currentLevel->levelNumber)]), + 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, SmallFont2, CR_UNDEFINED, 5, top + 12, currentLevel->DisplayName(), + 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); }