diff --git a/src/am_map.cpp b/src/am_map.cpp index a317c1190f..c3d04320f5 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -189,6 +189,10 @@ CVAR(Bool, am_portaloverlay, true, CVAR_ARCHIVE) CVAR(Bool, am_showgrid, false, CVAR_ARCHIVE) CVAR(Float, am_zoomdir, 0, CVAR_ARCHIVE) +static const char *const DEFAULT_FONT_NAME = "AMMNUMx"; +CVAR(String, am_markfont, DEFAULT_FONT_NAME, CVAR_ARCHIVE) +CVAR(Int, am_markcolor, CR_GREY, CVAR_ARCHIVE) + CCMD(am_togglefollow) { am_followplayer = !am_followplayer; @@ -1128,7 +1132,9 @@ void DAutomap::restoreScaleAndLoc () int DAutomap::addMark () { - if (marknums[0].isValid()) + // Add a mark when default font is selected and its textures (AMMNUM?) + // are loaded. Mark is always added when custom font is selected + if (stricmp(*am_markfont, DEFAULT_FONT_NAME) != 0 || marknums[0].isValid()) { auto m = markpointnum; markpoints[markpointnum].x = m_x + m_w/2; @@ -3032,12 +3038,29 @@ void DAutomap::DrawMarker (FTexture *tex, double x, double y, int yadjust, void DAutomap::drawMarks () { + FFont* font; + bool fontloaded = false; + for (int i = 0; i < AM_NUMMARKPOINTS; i++) { if (markpoints[i].x != -1) { - DrawMarker (TexMan.GetTexture(marknums[i], true), markpoints[i].x, markpoints[i].y, -3, 0, - 1, 1, 0, 1, 0, LegacyRenderStyles[STYLE_Normal]); + if (!fontloaded) + { + font = stricmp(*am_markfont, DEFAULT_FONT_NAME) == 0 ? nullptr : V_GetFont(am_markfont); + fontloaded = true; + } + + if (font == nullptr) + { + DrawMarker(TexMan.GetTexture(marknums[i], true), markpoints[i].x, markpoints[i].y, -3, 0, + 1, 1, 0, 1, 0, LegacyRenderStyles[STYLE_Normal]); + } + else + { + char numstr[2] = { char('0' + i), 0 }; + screen->DrawText(font, am_markcolor, CXMTOF(markpoints[i].x), CYMTOF(markpoints[i].y), numstr, TAG_DONE); + } } } } diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index e49759b6a3..14f7aa74b6 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2003,6 +2003,8 @@ AUTOMAPMNU_SHOWTRIGGERLINES = "Show trigger lines"; AUTOMAPMNU_SHOWTHINGSPRITES = "Show things as sprites"; AUTOMAPMNU_PTOVERLAY = "Overlay portals"; AUTOMAPMNU_EMPTYSPACEMARGIN = "Empty space margin"; +AUTOMAPMNU_MARKFONT = "Mark font"; +AUTOMAPMNU_MARKCOLOR = "Mark color"; // Automap Controls MAPCNTRLMNU_TITLE = "CUSTOMIZE MAP CONTROLS"; @@ -2503,6 +2505,9 @@ OPTVAL_VTAVANILLA = "Auto (Vanilla Preferred)"; OPTVAL_SCALENEAREST = "Scaled (Nearest)"; OPTVAL_SCALELINEAR = "Scaled (Linear)"; OPTVAL_LETTERBOX = "Letterbox"; +OPTVAL_SMALL = "Small"; +OPTVAL_LARGE = "Large"; +OPTVAL_CONSOLE = "Console"; // Colors C_BRICK = "\cabrick"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 2a6fe6a655..d90160f928 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1077,6 +1077,14 @@ OptionValue MapTriggers 2, "$OPTVAL_ON" } +OptionString MapMarkFont +{ + "AMMNUMx", "$OPTVAL_DEFAULT" + "SmallFont", "$OPTVAL_SMALL" + "BigFont", "$OPTVAL_LARGE" + "ConsoleFont", "$OPTVAL_CONSOLE" +} + OptionMenu AutomapOptions protected { Title "$AUTOMAPMNU_TITLE" @@ -1103,6 +1111,9 @@ OptionMenu AutomapOptions protected Option "$AUTOMAPMNU_SHOWKEYS", "am_showkeys", "OnOff" Option "$AUTOMAPMNU_SHOWTRIGGERLINES", "am_showtriggerlines", "MapTriggers" Option "$AUTOMAPMNU_SHOWTHINGSPRITES", "am_showthingsprites", "STSTypes" + StaticText " " + Option "$AUTOMAPMNU_MARKFONT", "am_markfont", "MapMarkFont" + Option "$AUTOMAPMNU_MARKCOLOR", "am_markcolor", "TextColors" } //-------------------------------------------------------------------------------------------