diff --git a/src/deh_soc.c b/src/deh_soc.c index 276700a9f..c44b158d0 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -1041,10 +1041,10 @@ void readlevelheader(MYFILE *f, char * name) continue; } - if (fastcmp(word, "SUBTITLE")) + if (fastcmp(word, "MENUTITLE")) { - deh_strlcpy(mapheaderinfo[num]->subttl, word2, - sizeof(mapheaderinfo[num]->subttl), va("Level header %d: subtitle", num)); + deh_strlcpy(mapheaderinfo[num]->menuttl, word2, + sizeof(mapheaderinfo[num]->menuttl), va("Level header %d: menutitle", num)); continue; } diff --git a/src/doomstat.h b/src/doomstat.h index f962aa8af..dcb29be47 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -466,7 +466,7 @@ struct mapheader_t // Titlecard information char lvlttl[22]; ///< Level name without "Zone". (21 character limit instead of 32, 21 characters can display on screen max anyway) - char subttl[33]; ///< Subtitle for level + char menuttl[22]; ///< Menu title for level char zonttl[22]; ///< "ZONE" replacement name UINT8 actnum; ///< Act number or 0 for none. diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 268db5e5b..0e18dd799 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -2744,16 +2744,22 @@ void M_DrawCupSelect(void) static void M_DrawHighLowLevelTitle(INT16 x, INT16 y, INT16 map) { char word1[22]; - char word2[22]; + char word2[22 + 2]; // actnum UINT8 word1len = 0; UINT8 word2len = 0; INT16 x2 = x; UINT8 i; - if (!mapheaderinfo[map] || !mapheaderinfo[map]->lvlttl[0]) + if (!mapheaderinfo[map] + || ( + !mapheaderinfo[map]->menuttl[0] + && !mapheaderinfo[map]->lvlttl[0] + ) + ) return; - if (mapheaderinfo[map]->zonttl[0]) + if (!mapheaderinfo[map]->menuttl[0] + && mapheaderinfo[map]->zonttl[0]) { boolean one = true; boolean two = true; @@ -2784,12 +2790,17 @@ static void M_DrawHighLowLevelTitle(INT16 x, INT16 y, INT16 map) { boolean donewithone = false; + char *ttlsource = + mapheaderinfo[map]->menuttl[0] + ? mapheaderinfo[map]->menuttl + : mapheaderinfo[map]->lvlttl; + for (i = 0; i < 22; i++) { - if (!mapheaderinfo[map]->lvlttl[i]) + if (!ttlsource[i]) break; - if (mapheaderinfo[map]->lvlttl[i] == ' ') + if (ttlsource[i] == ' ') { if (!donewithone) { @@ -2800,18 +2811,18 @@ static void M_DrawHighLowLevelTitle(INT16 x, INT16 y, INT16 map) if (donewithone) { - word2[word2len] = mapheaderinfo[map]->lvlttl[i]; + word2[word2len] = ttlsource[i]; word2len++; } else { - word1[word1len] = mapheaderinfo[map]->lvlttl[i]; + word1[word1len] = ttlsource[i]; word1len++; } } } - if (mapheaderinfo[map]->actnum) + if (!mapheaderinfo[map]->menuttl[0] && mapheaderinfo[map]->actnum) { word2[word2len] = ' '; word2len++; @@ -6187,6 +6198,11 @@ static void M_DrawStatsMaps(void) M_DrawMapMedals(mnum+1, 291, y); + if (mapheaderinfo[mnum]->menuttl[0]) + { + V_DrawThinString(24, y, V_FORCEUPPERCASE, mapheaderinfo[mnum]->menuttl); + } + else { char *title = G_BuildMapTitle(mnum+1); V_DrawThinString(24, y, V_FORCEUPPERCASE, title); diff --git a/src/lua_maplib.c b/src/lua_maplib.c index c9ae8fca0..b7926fcca 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -2487,8 +2487,8 @@ static int mapheaderinfo_get(lua_State *L) const char *field = luaL_checkstring(L, 2); if (fastcmp(field,"lvlttl")) lua_pushstring(L, header->lvlttl); - else if (fastcmp(field,"subttl")) - lua_pushstring(L, header->subttl); + else if (fastcmp(field,"menuttl")) + lua_pushstring(L, header->menuttl); else if (fastcmp(field,"zonttl")) lua_pushstring(L, header->zonttl); else if (fastcmp(field,"actnum")) diff --git a/src/p_setup.c b/src/p_setup.c index a886e1e93..ac1edeca0 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -406,7 +406,7 @@ void P_DeleteHeaderFollowers(UINT16 i) static void P_ClearSingleMapHeaderInfo(INT16 num) { mapheaderinfo[num]->lvlttl[0] = '\0'; - mapheaderinfo[num]->subttl[0] = '\0'; + mapheaderinfo[num]->menuttl[0] = '\0'; mapheaderinfo[num]->zonttl[0] = '\0'; mapheaderinfo[num]->actnum = 0; mapheaderinfo[num]->typeoflevel = 0;