From 514616c546777ca20e833d40c0a2488d10ef6add Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 5 Dec 2019 19:09:41 +0000 Subject: [PATCH 1/2] Allow for 10 emblem hints on a map by poking the drawer a bit. This is a very small diff, but I can understand if you'd not feel comfortable having this until after 2.2.0. --- src/m_menu.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index bd96b5d0d..b5a28d0f7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6955,11 +6955,23 @@ static void M_EmblemHints(INT32 choice) static void M_DrawEmblemHints(void) { - INT32 i, j = 0; - UINT32 collected = 0; + INT32 i, j = 0, x, y; + UINT32 collected = 0, local = 0; emblem_t *emblem; const char *hint; + for (i = 0; i < numemblems; i++) + { + emblem = &emblemlocations[i]; + if (emblem->level != gamemap || emblem->type > ET_SKIN) + continue; + if (++local >= NUMHINTS*2) + break; + } + + x = (local > NUMHINTS ? 4 : 12); + y = 8; + for (i = 0; i < numemblems; i++) { emblem = &emblemlocations[i]; @@ -6969,13 +6981,13 @@ static void M_DrawEmblemHints(void) if (emblem->collected) { collected = V_GREENMAP; - V_DrawMappedPatch(12, 12+(28*j), 0, W_CachePatchName(M_GetEmblemPatch(emblem, false), PU_CACHE), + V_DrawMappedPatch(x, y+4, 0, W_CachePatchName(M_GetEmblemPatch(emblem, false), PU_CACHE), R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE)); } else { collected = 0; - V_DrawScaledPatch(12, 12+(28*j), 0, W_CachePatchName("NEEDIT", PU_CACHE)); + V_DrawScaledPatch(x, y+4, 0, W_CachePatchName("NEEDIT", PU_CACHE)); } if (emblem->hint[0]) @@ -6983,9 +6995,19 @@ static void M_DrawEmblemHints(void) else hint = M_GetText("No hints available."); hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint); - V_DrawString(40, 8+(28*j), V_RETURN8|V_ALLOWLOWERCASE|collected, hint); + if (local > NUMHINTS) + V_DrawThinString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint); + else + V_DrawString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint); - if (++j >= NUMHINTS) + y += 28; + + if (++j == NUMHINTS) + { + x = 4+(BASEVIDWIDTH/2); + y = 8; + } + else if (j >= NUMHINTS*2) break; } if (!j) From b76a1d3df733754d2c56ac12e91cde10cceb82fe Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 5 Dec 2019 19:26:31 +0000 Subject: [PATCH 2/2] * Don't iterate through the list twice to print "No hidden emblems on this map". * Make it "No hint available for this emblem" instead of "No hints available", which people may confuse as the first message (I know I did!) --- src/m_menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index b5a28d0f7..061ea1e96 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6972,7 +6972,9 @@ static void M_DrawEmblemHints(void) x = (local > NUMHINTS ? 4 : 12); y = 8; - for (i = 0; i < numemblems; i++) + if (!local) + V_DrawCenteredString(160, 48, V_YELLOWMAP, "No hidden emblems on this map."); + else for (i = 0; i < numemblems; i++) { emblem = &emblemlocations[i]; if (emblem->level != gamemap || emblem->type > ET_SKIN) @@ -6993,7 +6995,7 @@ static void M_DrawEmblemHints(void) if (emblem->hint[0]) hint = emblem->hint; else - hint = M_GetText("No hints available."); + hint = M_GetText("No hint available for this emblem."); hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint); if (local > NUMHINTS) V_DrawThinString(x+28, y, V_RETURN8|V_ALLOWLOWERCASE|collected, hint); @@ -7010,8 +7012,6 @@ static void M_DrawEmblemHints(void) else if (j >= NUMHINTS*2) break; } - if (!j) - V_DrawCenteredString(160, 48, V_YELLOWMAP, "No hidden emblems on this map."); M_DrawGenericMenu(); }