From 9de675165fc46c5b84b2f2f1c3fe87c895cca8af Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 2 Dec 2022 21:42:17 +0000 Subject: [PATCH] Roughest layout from cup grid --- src/k_menudef.c | 2 +- src/k_menudraw.c | 49 ++++++++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/k_menudef.c b/src/k_menudef.c index f355a3e34..53c55a415 100644 --- a/src/k_menudef.c +++ b/src/k_menudef.c @@ -1756,7 +1756,7 @@ menu_t MISC_ChallengesDef = { &MainDef, 0, MISC_ChallengesMenu, - 48, 80, + 14, 32, 0, 0, 98, 0, M_DrawChallenges, diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 1b1577f40..922c4d662 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -4463,8 +4463,10 @@ void M_DrawAddons(void) void M_DrawChallenges(void) { - INT32 x = 20, y = 20; + INT32 x = currentMenu->x, y = currentMenu->y; UINT8 i, j, id, num, work; + const char *str; + INT16 offset; unlockable_t *ref = NULL; { @@ -4472,30 +4474,10 @@ void M_DrawChallenges(void) V_DrawFixedPatch(0, 0, FRACUNIT, 0, bg, NULL); } - if (challengesmenu.currentunlock < MAXUNLOCKABLES) - { - const char *str = unlockables[challengesmenu.currentunlock].name; - if (!gamedata->unlocked[challengesmenu.currentunlock]) - { - str = "???"; //M_CreateSecretMenuOption(str); - } - V_DrawThinString(x, y, V_ALLOWLOWERCASE, str); - } - else - { - V_DrawThinString(x, y, V_ALLOWLOWERCASE, "---"); - } - - if (challengesmenu.unlockanim >= UNLOCKTIME) - V_DrawThinString(x, y + 10, V_ALLOWLOWERCASE, va("Press (%c)", challengesmenu.pending ? 'A' : 'B')); - - x = currentMenu->x; - y = currentMenu->y; - if (!gamedata->challengegrid) { V_DrawString(x, y, V_REDMAP, "No challenges available!?"); - return; + goto challengedesc; } for (i = 0; i < gamedata->challengegridwidth; i++) @@ -4575,4 +4557,27 @@ drawborder: } M_DrawCharSelectExplosions(false, currentMenu->x, currentMenu->y); + +challengedesc: + y = 120; + V_DrawScaledPatch(0, y, 0, W_CachePatchName("MENUHINT", PU_CACHE)); + + if (challengesmenu.currentunlock < MAXUNLOCKABLES) + { + str = unlockables[challengesmenu.currentunlock].name; + if (!gamedata->unlocked[challengesmenu.currentunlock]) + { + str = "???"; //M_CreateSecretMenuOption(str); + } + } + else + { + str = "---"; + } + + offset = V_LSTitleLowStringWidth(str, 0) / 2; + V_DrawLSTitleLowString(BASEVIDWIDTH/2 - offset, y+6, 0, str); + + if (challengesmenu.unlockanim >= UNLOCKTIME) + V_DrawThinString(20, 120 + 60, V_ALLOWLOWERCASE, va("Press (%c)", challengesmenu.pending ? 'A' : 'B')); }