From 6d929b6be9a07ed16010ccec3bf28202d60a7c71 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 28 Dec 2023 04:42:31 -0800 Subject: [PATCH 01/17] V_GetFontSpecification: bunch menu font --- src/v_video.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/v_video.cpp b/src/v_video.cpp index 4d4984a38..e49e07a24 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -2175,6 +2175,20 @@ static inline fixed_t BunchedCharacterDim( return 0; } +static inline fixed_t MenuCharacterDim( + fixed_t scale, + fixed_t chw, + INT32 hchw, + INT32 dupx, + fixed_t * cwp) +{ + (void)chw; + (void)hchw; + (void)dupx; + (*cwp) = FixedMul(std::max(1, (*cwp) - 2) << FRACBITS, scale); + return 0; +} + static inline fixed_t GamemodeCharacterDim( fixed_t scale, fixed_t chw, @@ -2352,6 +2366,12 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result) else result->dim_fn = BunchedCharacterDim; break; + case MENU_FONT: + if (result->chw) + result->dim_fn = CenteredCharacterDim; + else + result->dim_fn = MenuCharacterDim; + break; case KART_FONT: if (result->chw) result->dim_fn = FixedCharacterDim; From 1c056acc2cb2927a855f2080b029bf94a264b902 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 28 Dec 2023 04:42:52 -0800 Subject: [PATCH 02/17] srb2::Draw: add menu font --- src/v_draw.cpp | 3 +++ src/v_draw.hpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 3aa074ed1..0f869e653 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -172,6 +172,9 @@ int Draw::font_to_fontno(Font font) case Font::kTimer: return TIMER_FONT; + + case Font::kMenu: + return MENU_FONT; } return TINY_FONT; diff --git a/src/v_draw.hpp b/src/v_draw.hpp index c75f3816e..8e04cc1c7 100644 --- a/src/v_draw.hpp +++ b/src/v_draw.hpp @@ -37,6 +37,7 @@ public: kZVote, kPing, kTimer, + kMenu, }; enum class Align From 3e7d377de56a03ba45d8bf01ece4060204469126 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 28 Dec 2023 04:56:25 -0800 Subject: [PATCH 03/17] Menus: use menu font Small adjustments made in various places to account for new font being 1px taller. Some options menus may be too densely packed and will need adjustment. User input (virtual keyboard, addons menu) remains console font. I also did not touch Replay HUD or Online menu. --- src/k_menudraw.c | 215 +++++++++++++++---------------- src/menus/class-egg-tv/EggTV.cpp | 16 +-- src/menus/options-sound.cpp | 6 +- 3 files changed, 118 insertions(+), 119 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index b1b4c0ecd..9fcea2e81 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -99,9 +99,9 @@ fixed_t M_DueFrac(tic_t start, tic_t duration) #define SKULLXOFF -32 #define LINEHEIGHT 16 -#define STRINGHEIGHT 8 +#define STRINGHEIGHT 9 #define FONTBHEIGHT 20 -#define SMALLLINEHEIGHT 8 +#define SMALLLINEHEIGHT 9 #define SLIDER_RANGE 10 #define SLIDER_WIDTH (8*SLIDER_RANGE+6) #define SERVERS_PER_PAGE 11 @@ -112,8 +112,8 @@ static void M_CentreText(INT32 xoffs, INT32 y, const char *string) { INT32 x; //added : 02-02-98 : centre on 320, because V_DrawString centers on vid.width... - x = ((BASEVIDWIDTH - V_StringWidth(string, V_OLDSPACING))>>1) + xoffs; - V_DrawString(x,y,V_OLDSPACING,string); + x = ((BASEVIDWIDTH - V_MenuStringWidth(string, 0))>>1) + xoffs; + V_DrawMenuString(x,y,0,string); } @@ -130,10 +130,10 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop) if (ontop) { - V_DrawCharacter(x - 16 - (skullAnimCounter/5), y, - '\x1C' | highlightflags, false); // left arrow - V_DrawCharacter(x+(SLIDER_RANGE*8) + 8 + (skullAnimCounter/5), y, - '\x1D' | highlightflags, false); // right arrow + V_DrawMenuString(x - 16 - (skullAnimCounter/5), y, + highlightflags, "\x1C"); // left arrow + V_DrawMenuString(x+(SLIDER_RANGE*8) + 8 + (skullAnimCounter/5), y, + highlightflags, "\x1D"); // right arrow } if ((range = atoi(cv->defaultvalue)) != cv->value) @@ -894,7 +894,7 @@ void M_DrawMenuMessage(void) } V_DrawString((BASEVIDWIDTH - V_StringWidth(string, 0))/2, y, 0, string); - y += 8; + y += 9; } } @@ -1083,9 +1083,9 @@ void M_DrawGenericMenu(void) cursory = y; if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING) - V_DrawString(x, y, 0, currentMenu->menuitems[i].text); + V_DrawMenuString(x, y, 0, currentMenu->menuitems[i].text); else - V_DrawString(x, y, highlightflags, currentMenu->menuitems[i].text); + V_DrawMenuString(x, y, highlightflags, currentMenu->menuitems[i].text); // Cvar specific handling switch (currentMenu->menuitems[i].status & IT_TYPE) @@ -1109,7 +1109,7 @@ void M_DrawGenericMenu(void) if (itemOn == i) { xoffs += 8; - V_DrawString(x + (skullAnimCounter/5) + 6, y + 12, highlightflags, "\x1D"); + V_DrawMenuString(x + (skullAnimCounter/5) + 6, y + 12, highlightflags, "\x1D"); } V_DrawString(x + xoffs + 8, y + 12, 0, cv->string); @@ -1118,15 +1118,15 @@ void M_DrawGenericMenu(void) } break; default: - w = V_StringWidth(cv->string, 0); - V_DrawString(BASEVIDWIDTH - x - w, y, + w = V_MenuStringWidth(cv->string, 0); + V_DrawMenuString(BASEVIDWIDTH - x - w, y, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string); if (i == itemOn) { - V_DrawCharacter(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y, - '\x1C' | highlightflags, false); // left arrow - V_DrawCharacter(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y, - '\x1D' | highlightflags, false); // right arrow + V_DrawMenuString(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y, + highlightflags, "\x1C"); // left arrow + V_DrawMenuString(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y, + highlightflags, "\x1D"); // right arrow } break; } @@ -1135,7 +1135,7 @@ void M_DrawGenericMenu(void) y += STRINGHEIGHT; break; case IT_STRING2: - V_DrawString(x, y, 0, currentMenu->menuitems[i].text); + V_DrawMenuString(x, y, 0, currentMenu->menuitems[i].text); /* FALLTHRU */ case IT_DYLITLSPACE: y += SMALLLINEHEIGHT; @@ -1151,21 +1151,21 @@ void M_DrawGenericMenu(void) y = currentMenu->y+currentMenu->menuitems[i].mvar1; /* FALLTHRU */ case IT_TRANSTEXT2: - V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); + V_DrawMenuString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); y += SMALLLINEHEIGHT; break; case IT_QUESTIONMARKS: if (currentMenu->menuitems[i].mvar1) y = currentMenu->y+currentMenu->menuitems[i].mvar1; - V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); + V_DrawMenuString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); y += SMALLLINEHEIGHT; break; case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text if (currentMenu->menuitems[i].mvar1) y = currentMenu->y+currentMenu->menuitems[i].mvar1; - V_DrawString(x-16, y, highlightflags, currentMenu->menuitems[i].text); + V_DrawMenuString(x-16, y, highlightflags, currentMenu->menuitems[i].text); y += SMALLLINEHEIGHT; break; } @@ -1185,7 +1185,7 @@ void M_DrawGenericMenu(void) { V_DrawScaledPatch(currentMenu->x - 24, cursory, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); - V_DrawString(currentMenu->x, cursory, highlightflags, currentMenu->menuitems[itemOn].text); + V_DrawMenuString(currentMenu->x, cursory, highlightflags, currentMenu->menuitems[itemOn].text); } } @@ -1354,12 +1354,12 @@ void M_DrawHorizontalMenu(void) } if (itemOn != 0) - V_DrawCharacter((BASEVIDWIDTH - width)/2 + 3 - (skullAnimCounter/5), y + 1, - '\x1C' | highlightflags, false); // left arrow + V_DrawMenuString((BASEVIDWIDTH - width)/2 + 3 - (skullAnimCounter/5), y + 1, + highlightflags, "\x1C"); // left arrow if (itemOn != currentMenu->numitems-1) - V_DrawCharacter((BASEVIDWIDTH + width)/2 - 10 + (skullAnimCounter/5), y + 1, - '\x1D' | highlightflags, false); // right arrow + V_DrawMenuString((BASEVIDWIDTH + width)/2 - 10 + (skullAnimCounter/5), y + 1, + highlightflags, "\x1D"); // right arrow } #define MAXMSGLINELEN 256 @@ -1434,7 +1434,7 @@ void M_DrawMessageMenu(void) } } - V_DrawString((BASEVIDWIDTH - V_StringWidth(string, 0))/2,y,0,string); + V_DrawMenuString((BASEVIDWIDTH - V_MenuStringWidth(string, 0))/2,y,0,string); y += 8; //SHORT(hu_font[0]->height); } } @@ -2548,7 +2548,7 @@ void M_DrawRaceDifficulty(void) INT32 f = (i == itemOn) ? highlightflags : 0; - V_DrawString(140 + tx + (i == itemOn ? 1 : 0), y, f, currentMenu->menuitems[i].text); + V_DrawMenuString(140 + tx + (i == itemOn ? 1 : 0), y, f, currentMenu->menuitems[i].text); if (currentMenu->menuitems[i].status & IT_CVAR) { @@ -2556,15 +2556,15 @@ void M_DrawRaceDifficulty(void) INT32 cx = 260 + tx; consvar_t *cv = currentMenu->menuitems[i].itemaction.cvar; - V_DrawCenteredString(cx, y, f, cv->string); + V_DrawCenteredMenuString(cx, y, f, cv->string); if (i == itemOn) { - INT32 w = V_StringWidth(cv->string, 0)/2; + INT32 w = V_MenuStringWidth(cv->string, 0)/2; - V_DrawCharacter(cx - 10 - w - (skullAnimCounter/5), y, '\x1C' | highlightflags, false); // left arrow - V_DrawCharacter(cx + w + 2 + (skullAnimCounter/5), y, '\x1D' | highlightflags, false); // right arrow + V_DrawMenuString(cx - 10 - w - (skullAnimCounter/5), y, highlightflags, "\x1C"); // left arrow + V_DrawMenuString(cx + w + 2 + (skullAnimCounter/5), y, highlightflags, "\x1D"); // right arrow } } @@ -3352,7 +3352,7 @@ void M_DrawTimeAttack(void) if (!mapheaderinfo[map]) { - V_DrawRightAlignedString(rightedge-12, opty, 0, "No map!?"); + V_DrawRightAlignedMenuString(rightedge-12, opty, 0, "No map!?"); return; } @@ -3438,7 +3438,7 @@ void M_DrawTimeAttack(void) if ((gametypes[levellist.newgametype]->rules & GTR_CIRCUIT) && (mapheaderinfo[map]->numlaps != 1)) { - V_DrawRightAlignedString(rightedge-12, timeheight, highlightflags, "BEST LAP:"); + V_DrawRightAlignedMenuString(rightedge-12, timeheight, highlightflags, "BEST LAP:"); K_drawKartTimestamp(laprec, 162+t, timeheight+6, 0, 2); timeheight += 30; } @@ -3447,7 +3447,7 @@ void M_DrawTimeAttack(void) timeheight += 15; } - V_DrawRightAlignedString(rightedge-12, timeheight, highlightflags, "BEST TIME:"); + V_DrawRightAlignedMenuString(rightedge-12, timeheight, highlightflags, "BEST TIME:"); K_drawKartTimestamp(timerec, 162+t, timeheight+6, 0, 1); // SPB Attack control hint + menu overlay @@ -3480,16 +3480,16 @@ void M_DrawTimeAttack(void) case IT_HEADERTEXT: - V_DrawString(leftedge, opty, highlightflags, currentMenu->menuitems[i].text); + V_DrawMenuString(leftedge, opty, highlightflags, currentMenu->menuitems[i].text); opty += 10; break; case IT_STRING: if (i >= currentMenu->numitems-1) - V_DrawRightAlignedString(rightedge, opty, f, currentMenu->menuitems[i].text); + V_DrawRightAlignedMenuString(rightedge, opty, f, currentMenu->menuitems[i].text); else - V_DrawString(leftedge, opty, f, currentMenu->menuitems[i].text); + V_DrawMenuString(leftedge, opty, f, currentMenu->menuitems[i].text); opty += 10; // Cvar specific handling @@ -3533,12 +3533,12 @@ void M_DrawTimeAttack(void) if (str) { - w = V_StringWidth(str, optflags); - V_DrawString(leftedge+12, opty, optflags, str); + w = V_MenuStringWidth(str, optflags); + V_DrawMenuString(leftedge+12, opty, optflags, str); if (drawarrows) { - V_DrawCharacter(leftedge+12 - 10 - (skullAnimCounter/5), opty, '\x1C' | f, false); // left arrow - V_DrawCharacter(leftedge+12 + w + 2+ (skullAnimCounter/5), opty, '\x1D' | f, false); // right arrow + V_DrawMenuString(leftedge+12 - 10 - (skullAnimCounter/5), opty, f, "\x1C"); // left arrow + V_DrawMenuString(leftedge+12 + w + 2+ (skullAnimCounter/5), opty, f, "\x1D"); // right arrow } opty += 10; } @@ -4250,9 +4250,9 @@ void M_DrawGenericOptions(void) cursory = y; if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING) - V_DrawString(x + (i == itemOn ? 1 : 0), y, 0, currentMenu->menuitems[i].text); + V_DrawMenuString(x + (i == itemOn ? 1 : 0), y, 0, currentMenu->menuitems[i].text); else - V_DrawString(x, y, highlightflags, currentMenu->menuitems[i].text); + V_DrawMenuString(x, y, highlightflags, currentMenu->menuitems[i].text); // Cvar specific handling switch (currentMenu->menuitems[i].status & IT_TYPE) @@ -4274,7 +4274,7 @@ void M_DrawGenericOptions(void) if (itemOn == i) { xoffs += 8; - V_DrawString(x + (skullAnimCounter/5) + 6, y + 12, highlightflags, "\x1D"); + V_DrawMenuString(x + (skullAnimCounter/5) + 6, y + 11, highlightflags, "\x1D"); } V_DrawString(x + xoffs + 8, y + 12, 0, cv->string); @@ -4284,19 +4284,19 @@ void M_DrawGenericOptions(void) break; default: { boolean isDefault = CV_IsSetToDefault(cv); - w = V_StringWidth(cv->string, 0); - V_DrawString(BASEVIDWIDTH - x - w, y, + w = V_MenuStringWidth(cv->string, 0); + V_DrawMenuString(BASEVIDWIDTH - x - w, y, (!isDefault ? warningflags : highlightflags), cv->string); if (i == itemOn) { - V_DrawCharacter(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y, - '\x1C' | highlightflags, false); // left arrow - V_DrawCharacter(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y, - '\x1D' | highlightflags, false); // right arrow + V_DrawMenuString(BASEVIDWIDTH - x - 10 - w - (skullAnimCounter/5), y - 1, + highlightflags, "\x1C"); // left arrow + V_DrawMenuString(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y - 1, + highlightflags, "\x1D"); // right arrow } if (!isDefault) { - V_DrawCharacter(BASEVIDWIDTH - x + (i == itemOn ? 13 : 5), y - 2, '.' | warningflags, false); + V_DrawMenuString(BASEVIDWIDTH - x + (i == itemOn ? 13 : 5), y - 2, warningflags, "."); } break; } @@ -4306,7 +4306,7 @@ void M_DrawGenericOptions(void) y += STRINGHEIGHT; break; case IT_STRING2: - V_DrawString(x, y, 0, currentMenu->menuitems[i].text); + V_DrawMenuString(x, y, 0, currentMenu->menuitems[i].text); /* FALLTHRU */ case IT_DYLITLSPACE: case IT_SPACE: @@ -4323,21 +4323,21 @@ void M_DrawGenericOptions(void) y = currentMenu->y+currentMenu->menuitems[i].mvar1; /* FALLTHRU */ case IT_TRANSTEXT2: - V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); + V_DrawMenuString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); y += SMALLLINEHEIGHT; break; case IT_QUESTIONMARKS: if (currentMenu->menuitems[i].mvar1) y = currentMenu->y+currentMenu->menuitems[i].mvar1; - V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); + V_DrawMenuString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); y += SMALLLINEHEIGHT; break; case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text if (currentMenu->menuitems[i].mvar1) y = currentMenu->y+currentMenu->menuitems[i].mvar1; - V_DrawString(x-16, y, highlightflags, currentMenu->menuitems[i].text); + V_DrawMenuString(x-16, y, highlightflags, currentMenu->menuitems[i].text); y += SMALLLINEHEIGHT; break; } @@ -4354,7 +4354,7 @@ void M_DrawGenericOptions(void) { V_DrawScaledPatch(x - 24, cursory, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); - V_DrawString(x + 1, cursory, highlightflags, currentMenu->menuitems[itemOn].text); + V_DrawMenuString(x + 1, cursory, highlightflags, currentMenu->menuitems[itemOn].text); } } @@ -4378,7 +4378,7 @@ void M_DrawProfileErase(void) V_DrawScaledPatch(x - 24, cursory, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); } - V_DrawString(x, y, + V_DrawMenuString(x, y, (i == optionsmenu.eraseprofilen ? highlightflags : 0), va("%sPRF%03d - %s (%s)", (cv_currprofile.value == i) ? "[In use] " : "", @@ -4462,8 +4462,7 @@ void M_DrawEditProfile(void) { colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE); - V_DrawCharacter(x - 10 - (skullAnimCounter/5), y+1, - '\x1C' | highlightflags, false); // left arrow + V_DrawMenuString(x - 10 - (skullAnimCounter/5), y+1, highlightflags, "\x1C"); // left arrow } // Text @@ -4597,13 +4596,13 @@ void M_DrawProfileControls(void) switch (currentMenu->menuitems[i].status & IT_DISPLAY) { case IT_HEADERTEXT: - V_DrawFill(0, y+17, 124, 1, 0); // underline - V_DrawString(x, y+8, 0, currentMenu->menuitems[i].text); + V_DrawFill(0, y+18, 124, 1, 0); // underline + V_DrawMenuString(x, y+8, 0, currentMenu->menuitems[i].text); y += spacing; break; case IT_STRING: - V_DrawString(x, y+1, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text); + V_DrawMenuString(x, y+2, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text); y += spacing; break; @@ -4617,19 +4616,19 @@ void M_DrawProfileControls(void) drawnpatch = true; } else - V_DrawString(x, y+1, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text); + V_DrawMenuString(x, y+2, (i == itemOn ? highlightflags : 0), currentMenu->menuitems[i].text); if (currentMenu->menuitems[i].status & IT_CVAR) // not the proper way to check but this menu only has normal onoff cvars. { INT32 w; consvar_t *cv = currentMenu->menuitems[i].itemaction.cvar; - w = V_StringWidth(cv->string, 0); - V_DrawString(x + 12, y + 12, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string); + w = V_MenuStringWidth(cv->string, 0); + V_DrawMenuString(x + 12, y + 13, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string); if (i == itemOn) { - V_DrawCharacter(x - (skullAnimCounter/5), y+12, '\x1C' | highlightflags, false); // left arrow - V_DrawCharacter(x + 12 + w + 2 + (skullAnimCounter/5) , y+12, '\x1D' | highlightflags, false); // right arrow + V_DrawMenuString(x - (skullAnimCounter/5), y+12, highlightflags, "\x1C"); // left arrow + V_DrawMenuString(x + 12 + w + 2 + (skullAnimCounter/5) , y+13, highlightflags, "\x1D"); // right arrow } } else if (currentMenu->menuitems[i].status & IT_CONTROL) @@ -4774,7 +4773,7 @@ void M_DrawVideoModes(void) M_DrawMenuTooltips(); M_DrawOptionsMovingButton(); - V_DrawCenteredString(BASEVIDWIDTH/2 + t, currentMenu->y, + V_DrawCenteredMenuString(BASEVIDWIDTH/2 + t, currentMenu->y, highlightflags, "Choose mode, reselect to change default"); row = 41 + t; @@ -4782,12 +4781,12 @@ void M_DrawVideoModes(void) for (i = 0; i < optionsmenu.vidm_nummodes; i++) { if (i == optionsmenu.vidm_selected) - V_DrawString(row, col, highlightflags, optionsmenu.modedescs[i].desc); + V_DrawMenuString(row, col, highlightflags, optionsmenu.modedescs[i].desc); // Show multiples of 320x200 as green. else - V_DrawString(row, col, (optionsmenu.modedescs[i].goodratio) ? recommendedflags : 0, optionsmenu.modedescs[i].desc); + V_DrawMenuString(row, col, (optionsmenu.modedescs[i].goodratio) ? recommendedflags : 0, optionsmenu.modedescs[i].desc); - col += 8; + col += 9; if ((i % optionsmenu.vidm_column_size) == (optionsmenu.vidm_column_size-1)) { row += 7*13; @@ -4803,11 +4802,11 @@ void M_DrawVideoModes(void) va("Previewing mode %c%dx%d", (SCR_IsAspectCorrect(vid.width, vid.height)) ? 0x83 : 0x80, vid.width, vid.height)); - M_CentreText(t, currentMenu->y + 75+8, + M_CentreText(t, currentMenu->y + 75+9, "Press ENTER again to keep this mode"); - M_CentreText(t, currentMenu->y + 75+16, + M_CentreText(t, currentMenu->y + 75+18, va("Wait %d second%s", testtime, (testtime > 1) ? "s" : "")); - M_CentreText(t, currentMenu->y + 75+24, + M_CentreText(t, currentMenu->y + 75+27, "or press ESC to return"); } @@ -4817,12 +4816,12 @@ void M_DrawVideoModes(void) va("Current mode is %c%dx%d", (SCR_IsAspectCorrect(vid.width, vid.height)) ? 0x83 : 0x80, vid.width, vid.height)); - M_CentreText(t, currentMenu->y + 75+8, + M_CentreText(t, currentMenu->y + 75+9, va("Default mode is %c%dx%d", (SCR_IsAspectCorrect(cv_scr_width.value, cv_scr_height.value)) ? 0x83 : 0x80, cv_scr_width.value, cv_scr_height.value)); - V_DrawCenteredString(BASEVIDWIDTH/2 + t, currentMenu->y + 75+24, + V_DrawCenteredMenuString(BASEVIDWIDTH/2 + t, currentMenu->y + 75+24, recommendedflags, "Modes marked in GREEN are recommended."); /* V_DrawCenteredString(BASEVIDWIDTH/2 + t, currentMenu->y + 75+16, @@ -4834,7 +4833,7 @@ void M_DrawVideoModes(void) // Draw the cursor for the VidMode menu i = 41 - 10 + ((optionsmenu.vidm_selected / optionsmenu.vidm_column_size)*7*13) + t; - j = currentMenu->y + 14 + ((optionsmenu.vidm_selected % optionsmenu.vidm_column_size)*8); + j = currentMenu->y + 14 + ((optionsmenu.vidm_selected % optionsmenu.vidm_column_size)*9); V_DrawScaledPatch(i - 8, j, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); @@ -5203,8 +5202,8 @@ void M_DrawPause(void) INT32 w = V_LSTitleLowStringWidth(selectabletext, selectableflags)/2; V_DrawLSTitleLowString(220-w + offset*2, 103, selectableflags, selectabletext); - V_DrawCharacter(220-w + offset*2 - 8 - (skullAnimCounter/5), 103+6, '\x1C' | selectableflags, false); // left arrow - V_DrawCharacter(220+w + offset*2 + (skullAnimCounter/5), 103+6, '\x1D' | selectableflags, false); // right arrow + V_DrawMenuString(220-w + offset*2 - 8 - (skullAnimCounter/5), 103+6, selectableflags, "\1C"); // left arrow + V_DrawMenuString(220+w + offset*2 + (skullAnimCounter/5), 103+6, selectableflags, "\1D"); // right arrow } if (maintext != NULL) @@ -5517,9 +5516,9 @@ void M_DrawAddons(void) M_CacheAddonPatches(); if (Playing()) - V_DrawCenteredString(BASEVIDWIDTH/2, 4, warningflags, "Adding files mid-game may cause problems."); + V_DrawCenteredMenuString(BASEVIDWIDTH/2, 4, warningflags, "Adding files mid-game may cause problems."); else - V_DrawCenteredString(BASEVIDWIDTH/2, 4, 0, + V_DrawCenteredMenuString(BASEVIDWIDTH/2, 4, 0, LOCATIONSTRING1); // DRAW MENU @@ -5544,7 +5543,7 @@ void M_DrawAddons(void) if (itemOn == 0) { xoffs += 8; - V_DrawString(x + (skullAnimCounter/5) - 20, y+8, highlightflags, "\x1D"); + V_DrawMenuString(x + (skullAnimCounter/5) - 20, y+8, highlightflags, "\x1D"); } V_DrawString(x + xoffs - 18, y+8, tflag, str); } @@ -5588,7 +5587,7 @@ void M_DrawAddons(void) i = m - (2*numaddonsshown + 1); if (i != 0) - V_DrawString(19, y+4 - (skullAnimCounter/5), highlightflags, "\x1A"); + V_DrawMenuString(19, y+4 - (skullAnimCounter/5), highlightflags, "\x1A"); if (skullAnimCounter < 4) flashcol = V_GetStringColormap(highlightflags); @@ -5629,7 +5628,7 @@ void M_DrawAddons(void) } if (m != (ssize_t)sizedirmenu) - V_DrawString(19, y-12 + (skullAnimCounter/5), highlightflags, "\x1B"); + V_DrawMenuString(19, y-12 + (skullAnimCounter/5), highlightflags, "\x1B"); if (m < (2*numaddonsshown + 1)) { @@ -5644,7 +5643,7 @@ void M_DrawAddons(void) m = numwadfiles-(mainwads+musicwads+1); - V_DrawCenteredString(BASEVIDWIDTH/2, y+4, (majormods ? highlightflags : V_TRANSLUCENT), va("%ld ADD-ON%s LOADED", (long)m, (m == 1) ? "" : "S")); //+2 for music, sounds, +1 for bios.pk3 + V_DrawCenteredMenuString(BASEVIDWIDTH/2, y+4, (majormods ? highlightflags : V_TRANSLUCENT), va("%ld ADD-ON%s LOADED", (long)m, (m == 1) ? "" : "S")); //+2 for music, sounds, +1 for bios.pk3 } #undef addonsseperation @@ -6620,7 +6619,7 @@ void M_DrawChallenges(void) if (gamedata->challengegrid == NULL || challengesmenu.extradata == NULL) { - V_DrawCenteredString(x, y, V_REDMAP, "No challenges available!?"); + V_DrawCenteredMenuString(x, y, V_REDMAP, "No challenges available!?"); goto challengedesc; } @@ -6969,8 +6968,8 @@ static void M_DrawStatsMaps(void) } if (location) - V_DrawCharacter(10, 80-(skullAnimCounter/5), - '\x1A' | highlightflags, false); // up arrow + V_DrawMenuString(10, 80-(skullAnimCounter/5), + highlightflags, "\x1A"); // up arrow i = -1; @@ -7136,8 +7135,8 @@ static void M_DrawStatsMaps(void) } bottomarrow: if (dobottomarrow) - V_DrawCharacter(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5), - '\x1B' | highlightflags, false); // down arrow + V_DrawMenuString(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5), + highlightflags, "\x1B"); // down arrow } #undef STATSSTEP @@ -7157,8 +7156,8 @@ static void M_DrawStatsChars(void) } if (location) - V_DrawCharacter(10, y-(skullAnimCounter/5), - '\x1A' | highlightflags, false); // up arrow + V_DrawMenuString(10, y-(skullAnimCounter/5), + highlightflags, "\x1A"); // up arrow i = -1; @@ -7191,8 +7190,8 @@ static void M_DrawStatsChars(void) bottomarrow: if (dobottomarrow) - V_DrawCharacter(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5), - '\x1B' | highlightflags, false); // down arrow + V_DrawMenuString(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5), + highlightflags, "\x1B"); // down arrow UINT32 x = BASEVIDWIDTH - 20 - 90; y = 88; @@ -7244,8 +7243,8 @@ static void M_DrawStatsGP(void) } if (location) - V_DrawCharacter(10, y-(skullAnimCounter/5), - '\x1A' | highlightflags, false); // up arrow + V_DrawMenuString(10, y-(skullAnimCounter/5), + highlightflags, "\x1A"); // up arrow const INT32 width = 53; @@ -7321,8 +7320,8 @@ static void M_DrawStatsGP(void) bottomarrow: if (dobottomarrow) - V_DrawCharacter(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5), - '\x1B' | highlightflags, false); // down arrow + V_DrawMenuString(10, BASEVIDHEIGHT-20 + (skullAnimCounter/5), + highlightflags, "\x1B"); // down arrow } #undef STATSSTEP @@ -7374,11 +7373,11 @@ void M_DrawStatistics(void) V_DrawThinString((BASEVIDWIDTH - pagenamewidth)/2, 12, 0, pagename); } - V_DrawCharacter((BASEVIDWIDTH - pagenamewidth)/2 - 10 - (skullAnimCounter/5), 12, - '\x1C', false); // left arrow + V_DrawMenuString((BASEVIDWIDTH - pagenamewidth)/2 - 10 - (skullAnimCounter/5), 12, + 0, "\x1C"); // left arrow - V_DrawCharacter((BASEVIDWIDTH + pagenamewidth)/2 + 2 + (skullAnimCounter/5), 12, - '\x1D', false); // right arrow + V_DrawMenuString((BASEVIDWIDTH + pagenamewidth)/2 + 2 + (skullAnimCounter/5), 12, + 0, "\x1D"); // right arrow } beststr[0] = 0; @@ -7600,7 +7599,7 @@ void M_DrawSoundTest(void) { UINT32 currenttime = min(Music_Elapsed(tune), Music_TotalDuration(tune)); - V_DrawRightAlignedString(x + 272-1, 18+32, 0, + V_DrawRightAlignedMenuString(x + 272-1, 18+32, 0, va("%02u:%02u", G_TicsToMinutes(currenttime, true), G_TicsToSeconds(currenttime) @@ -7614,7 +7613,7 @@ void M_DrawSoundTest(void) { UINT32 exittime = Music_TotalDuration(tune); - V_DrawRightAlignedString(x + 272-1, 18+32+10, 0, + V_DrawRightAlignedMenuString(x + 272-1, 18+32+10, 0, va("%02u:%02u", G_TicsToMinutes(exittime, true), G_TicsToSeconds(exittime) @@ -7797,8 +7796,8 @@ void M_DrawSoundTest(void) x += 25; } - V_DrawCharacter(cursorx - 4, currentMenu->y - 8 - (skullAnimCounter/5), - '\x1B' | V_SNAPTOTOP|highlightflags, false); // up arrow + V_DrawMenuString(cursorx - 4, currentMenu->y - 8 - (skullAnimCounter/5), + V_SNAPTOTOP|highlightflags, "\x1B"); // up arrow } #ifdef HAVE_DISCORDRPC diff --git a/src/menus/class-egg-tv/EggTV.cpp b/src/menus/class-egg-tv/EggTV.cpp index a2cd99e42..ec894d017 100644 --- a/src/menus/class-egg-tv/EggTV.cpp +++ b/src/menus/class-egg-tv/EggTV.cpp @@ -983,14 +983,14 @@ void EggTV::draw_replay(const Replay& replay) const { Draw row = box.xy(39, 104).align(Draw::Align::kLeft); - auto pair = [&row](int x, auto label, auto text) + auto pair = [&row](int x, int y, auto label, auto text) { row = row.y(10); - row.y(-1).flags(V_AQUAMAP).font(Draw::Font::kThin).text(label); - row.x(x).font(Draw::Font::kConsole).text(text); + row.flags(V_AQUAMAP).font(Draw::Font::kThin).text(label); + row.xy(x, y).font(Draw::Font::kMenu).text(text); }; - Draw gametype = row.font(Draw::Font::kConsole); + Draw gametype = row.font(Draw::Font::kMenu); if (race) { @@ -1003,15 +1003,15 @@ void EggTV::draw_replay(const Replay& replay) const if (winner) { - pair(38, "WINNER", winner->name); + pair(38, 1, "WINNER", winner->name); if (replay.gametype().ranks_time()) { - pair(32, "TIME", player_time_string(*winner)); + pair(32, 0, "TIME", player_time_string(*winner)); } else if (replay.gametype().ranks_points()) { - pair(32, "SCORE", player_points_string(*winner)); + pair(32, 0, "SCORE", player_points_string(*winner)); } } } @@ -1115,7 +1115,7 @@ void EggTV::draw_standings(const Replay& replay) const ); Draw row = Draw(StandingsOffsets::kLeft - x, StandingsOffsets::kTop + y) - .clipx(StandingsOffsets::kLeft, StandingsOffsets::kRight).font(Draw::Font::kConsole).align(Draw::Align::kRight); + .clipx(StandingsOffsets::kLeft, StandingsOffsets::kRight).font(Draw::Font::kMenu).align(Draw::Align::kRight); std::size_t start = standingsRow_.pos(); diff --git a/src/menus/options-sound.cpp b/src/menus/options-sound.cpp index bf3840483..91e2298d2 100644 --- a/src/menus/options-sound.cpp +++ b/src/menus/options-sound.cpp @@ -55,7 +55,7 @@ struct Slider if (selected) { int ofs = skullAnimCounter / 5; - Draw arrows = h.font(Draw::Font::kConsole).align(Draw::Align::kLeft).flags(highlightflags); + Draw arrows = h.font(Draw::Font::kMenu).align(Draw::Align::kLeft).flags(highlightflags); arrows.x(-10 - ofs).text("\x1C"); arrows.x(kWidth + 2 + ofs).text("\x1D"); @@ -88,7 +88,7 @@ struct Slider { h .x(kWidth / 2) - .font(Draw::Font::kConsole) + .font(Draw::Font::kMenu) .align(Draw::Align::kCenter) .flags(V_40TRANS) .text("S I L E N T"); @@ -191,7 +191,7 @@ void draw_routine() ); } - y += 8; + y += 9; } } From 72f885e6ba36492e1b9e067b8f22ce75ce4a6ee3 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 13:21:06 -0800 Subject: [PATCH 04/17] Menus: draw headers in orange --- src/k_menu.h | 2 ++ src/k_menudraw.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/k_menu.h b/src/k_menu.h index bf26bcbbb..e4455d966 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1202,6 +1202,8 @@ void M_HandleImageDef(INT32 choice); #define recommendedflags V_GREENMAP #define warningflags V_ORANGEMAP +#define M_ALTCOLOR V_ORANGEMAP + // For some menu highlights UINT16 M_GetCvPlayerColor(UINT8 pnum); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 9fcea2e81..3b70befef 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -3438,7 +3438,7 @@ void M_DrawTimeAttack(void) if ((gametypes[levellist.newgametype]->rules & GTR_CIRCUIT) && (mapheaderinfo[map]->numlaps != 1)) { - V_DrawRightAlignedMenuString(rightedge-12, timeheight, highlightflags, "BEST LAP:"); + V_DrawRightAlignedMenuString(rightedge-12, timeheight, M_ALTCOLOR, "BEST LAP:"); K_drawKartTimestamp(laprec, 162+t, timeheight+6, 0, 2); timeheight += 30; } @@ -3447,7 +3447,7 @@ void M_DrawTimeAttack(void) timeheight += 15; } - V_DrawRightAlignedMenuString(rightedge-12, timeheight, highlightflags, "BEST TIME:"); + V_DrawRightAlignedMenuString(rightedge-12, timeheight, M_ALTCOLOR, "BEST TIME:"); K_drawKartTimestamp(timerec, 162+t, timeheight+6, 0, 1); // SPB Attack control hint + menu overlay @@ -3480,7 +3480,7 @@ void M_DrawTimeAttack(void) case IT_HEADERTEXT: - V_DrawMenuString(leftedge, opty, highlightflags, currentMenu->menuitems[i].text); + V_DrawMenuString(leftedge, opty, M_ALTCOLOR, currentMenu->menuitems[i].text); opty += 10; break; @@ -4337,7 +4337,7 @@ void M_DrawGenericOptions(void) if (currentMenu->menuitems[i].mvar1) y = currentMenu->y+currentMenu->menuitems[i].mvar1; - V_DrawMenuString(x-16, y, highlightflags, currentMenu->menuitems[i].text); + V_DrawMenuString(x-16, y, M_ALTCOLOR, currentMenu->menuitems[i].text); y += SMALLLINEHEIGHT; break; } From 6fdea9c1ba7d573555611633e655e34ab95ccc7e Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 13:22:36 -0800 Subject: [PATCH 05/17] Menus/Time Attack: add cursor hand --- src/k_menudraw.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 3b70befef..84bfe86c5 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -173,6 +173,11 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop) V_DrawScaledPatch(x - 4 + (((SLIDER_RANGE)*8 + 4)*range)/100, y, 0, p); } +static void M_DrawCursorHand(INT32 x, INT32 y) +{ + V_DrawScaledPatch(x - 24, y, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); +} + static patch_t *addonsp[NUM_EXT+5]; static patch_t *bgMapImage; @@ -3487,9 +3492,19 @@ void M_DrawTimeAttack(void) case IT_STRING: if (i >= currentMenu->numitems-1) + { V_DrawRightAlignedMenuString(rightedge, opty, f, currentMenu->menuitems[i].text); + + if (i == itemOn) + M_DrawCursorHand(rightedge - V_MenuStringWidth(currentMenu->menuitems[i].text, 0), opty); + } else + { V_DrawMenuString(leftedge, opty, f, currentMenu->menuitems[i].text); + + if (i == itemOn) + M_DrawCursorHand(leftedge, opty); + } opty += 10; // Cvar specific handling From 53f686f79783eb793f5b594565d8e2b87caa4faa Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 13:23:49 -0800 Subject: [PATCH 06/17] Menus: for settings lists, draw underline for selected option --- src/k_menudraw.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 84bfe86c5..e82ef4b88 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -178,6 +178,12 @@ static void M_DrawCursorHand(INT32 x, INT32 y) V_DrawScaledPatch(x - 24, y, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); } +static void M_DrawUnderline(INT32 left, INT32 right, INT32 y) +{ + if (menutransition.tics == menutransition.dest) + V_DrawFill(left - 1, y + 5, (right - left) + 11, 2, 31); +} + static patch_t *addonsp[NUM_EXT+5]; static patch_t *bgMapImage; @@ -2553,26 +2559,28 @@ void M_DrawRaceDifficulty(void) INT32 f = (i == itemOn) ? highlightflags : 0; - V_DrawMenuString(140 + tx + (i == itemOn ? 1 : 0), y, f, currentMenu->menuitems[i].text); - if (currentMenu->menuitems[i].status & IT_CVAR) { // implicitely we'll only take care of normal cvars INT32 cx = 260 + tx; consvar_t *cv = currentMenu->menuitems[i].itemaction.cvar; - V_DrawCenteredMenuString(cx, y, f, cv->string); - if (i == itemOn) { INT32 w = V_MenuStringWidth(cv->string, 0)/2; + M_DrawUnderline(140, 260 + w, y); + V_DrawMenuString(cx - 10 - w - (skullAnimCounter/5), y, highlightflags, "\x1C"); // left arrow V_DrawMenuString(cx + w + 2 + (skullAnimCounter/5), y, highlightflags, "\x1D"); // right arrow } + + V_DrawCenteredMenuString(cx, y, f, cv->string); } + V_DrawMenuString(140 + tx + (i == itemOn ? 1 : 0), y, f, currentMenu->menuitems[i].text); + if (i == itemOn) { V_DrawScaledPatch(140 + tx - 24, y, 0, @@ -4230,7 +4238,10 @@ void M_DrawGenericOptions(void) for (i = 0; i < currentMenu->numitems; i++) { if (i == itemOn) + { cursory = y; + M_DrawUnderline(x, BASEVIDWIDTH - x, y); + } switch (currentMenu->menuitems[i].status & IT_DISPLAY) { case IT_PATCH: From 58f5952ddc0cc292ab137c5c53b76d1a60da0ae9 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 13:24:25 -0800 Subject: [PATCH 07/17] Menus: replace slider with simpler construct --- src/k_menudraw.c | 57 +++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index e82ef4b88..d9b61b8ff 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -116,17 +116,22 @@ static void M_CentreText(INT32 xoffs, INT32 y, const char *string) V_DrawMenuString(x,y,0,string); } +static INT32 M_SliderX(INT32 range) +{ + if (range < 0) + range = 0; + if (range > 100) + range = 100; + + return -4 + (((SLIDER_RANGE)*8 + 4)*range)/100; +} // A smaller 'Thermo', with range given as percents (0-100) static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop) { - INT32 i; - INT32 range; - patch_t *p; - - for (i = 0; cv->PossibleValue[i+1].strvalue; i++); - x = BASEVIDWIDTH - x - SLIDER_WIDTH; + V_DrawFill(x - 5, y + 3, SLIDER_WIDTH + 3, 5, 31); + V_DrawFill(x - 4, y + 4, SLIDER_WIDTH, 2, orangemap[0]); if (ontop) { @@ -136,41 +141,19 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop) highlightflags, "\x1D"); // right arrow } - if ((range = atoi(cv->defaultvalue)) != cv->value) - { - range = ((range - cv->PossibleValue[0].value) * 100 / - (cv->PossibleValue[1].value - cv->PossibleValue[0].value)); + INT32 range = cv->PossibleValue[1].value - cv->PossibleValue[0].value; + INT32 val = atoi(cv->defaultvalue); - if (range < 0) - range = 0; - if (range > 100) - range = 100; + val = (val - cv->PossibleValue[0].value) * 100 / range; + // draw the default tick + V_DrawFill(x + M_SliderX(val), y + 2, 3, 4, 31); - // draw the default - p = W_CachePatchName("M_SLIDEC", PU_CACHE); - V_DrawScaledPatch(x - 4 + (((SLIDER_RANGE)*8 + 4)*range)/100, y, 0, p); - } - - V_DrawScaledPatch(x - 8, y, 0, W_CachePatchName("M_SLIDEL", PU_CACHE)); - - p = W_CachePatchName("M_SLIDEM", PU_CACHE); - for (i = 0; i < SLIDER_RANGE; i++) - V_DrawScaledPatch (x+i*8, y, 0,p); - - p = W_CachePatchName("M_SLIDER", PU_CACHE); - V_DrawScaledPatch(x+SLIDER_RANGE*8, y, 0, p); - - range = ((cv->value - cv->PossibleValue[0].value) * 100 / - (cv->PossibleValue[1].value - cv->PossibleValue[0].value)); - - if (range < 0) - range = 0; - if (range > 100) - range = 100; + val = (cv->value - cv->PossibleValue[0].value) * 100 / range; + INT32 px = x + M_SliderX(val); // draw the slider cursor - p = W_CachePatchName("M_SLIDEC", PU_CACHE); - V_DrawScaledPatch(x - 4 + (((SLIDER_RANGE)*8 + 4)*range)/100, y, 0, p); + V_DrawFill(px - 1, y - 1, 5, 11, 31); + V_DrawFill(px, y, 2, 8, aquamap[0]); } static void M_DrawCursorHand(INT32 x, INT32 y) From de4e68f6f4718b93c075c09eb48d938362cc1655 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 15:50:12 -0800 Subject: [PATCH 08/17] M_DrawGenericOptions: use IT_HEADER to create "drawers" (boxes) that collapse items - IT_HEADER marks the start of a drawer - The next IT_HEADER (which also starts another drawer) or IT_DYBIGSPACE marks the end of the drawer - Every item within the drawer is hidden by default and does not take any space - Navigating the cursor into the drawer opens it and shows all the items inside --- src/k_menudraw.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index d9b61b8ff..331a28846 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -4211,20 +4211,94 @@ void M_DrawOptions(void) } +static void M_DrawOptionsBoxTerm(INT32 x, INT32 top, INT32 bottom) +{ + INT32 px = x - 20; + + V_DrawFill(px, top + 4, 2, bottom - top, orangemap[0]); + V_DrawFill(px + 1, top + 5, 2, bottom - top, 31); + + V_DrawFill(BASEVIDWIDTH - px - 2, top + 4, 2, bottom - top, orangemap[0]); + V_DrawFill(BASEVIDWIDTH - px, top + 5, 1, bottom - top, 31); + + V_DrawFill(px, bottom + 2, BASEVIDWIDTH - (2 * px), 2, orangemap[0]); + V_DrawFill(px, bottom + 3, BASEVIDWIDTH - (2 * px), 2, 31); +} + void M_DrawGenericOptions(void) { INT32 x = currentMenu->x - M_EaseWithTransition(Easing_Linear, 5 * 48), y = currentMenu->y, w, i, cursory = 0; + INT32 expand = -1; + INT32 boxy = 0; + boolean collapse = false; M_DrawMenuTooltips(); M_DrawOptionsMovingButton(); + for (i = itemOn; i >= 0; --i) + { + switch (currentMenu->menuitems[i].status & IT_DISPLAY) + { + case IT_DYBIGSPACE: + goto box_found; + + case IT_HEADERTEXT: + expand = i; + goto box_found; + } + } +box_found: + for (i = 0; i < currentMenu->numitems; i++) { + boolean term = false; + + switch (currentMenu->menuitems[i].status & IT_DISPLAY) + { + case IT_DYBIGSPACE: + collapse = false; + term = (boxy != 0); + break; + + case IT_HEADERTEXT: + collapse = (i != expand); + + if (collapse) + { + term = (boxy != 0); + } + else + { + if (menutransition.tics == menutransition.dest) + { + INT32 px = x - 20; + V_DrawFill(px, y + 6, BASEVIDWIDTH - (2 * px), 2, orangemap[0]); + V_DrawFill(px + 1, y + 7, BASEVIDWIDTH - (2 * px), 2, 31); + } + + y += 2; + boxy = y; + } + break; + + default: + if (collapse) + continue; + } + + if (term) + { + M_DrawOptionsBoxTerm(x, boxy, y); + y += SMALLLINEHEIGHT; + boxy = 0; + } + if (i == itemOn) { cursory = y; M_DrawUnderline(x, BASEVIDWIDTH - x, y); } + switch (currentMenu->menuitems[i].status & IT_DISPLAY) { case IT_PATCH: @@ -4346,12 +4420,15 @@ void M_DrawGenericOptions(void) if (currentMenu->menuitems[i].mvar1) y = currentMenu->y+currentMenu->menuitems[i].mvar1; - V_DrawMenuString(x-16, y, M_ALTCOLOR, currentMenu->menuitems[i].text); - y += SMALLLINEHEIGHT; + V_DrawMenuString(x - (collapse ? 0 : 16), y, M_ALTCOLOR, currentMenu->menuitems[i].text); + y += SMALLLINEHEIGHT + 1; break; } } + if (boxy) + M_DrawOptionsBoxTerm(x, boxy, y); + // DRAW THE SKULL CURSOR if (((currentMenu->menuitems[itemOn].status & IT_DISPLAY) == IT_PATCH) || ((currentMenu->menuitems[itemOn].status & IT_DISPLAY) == IT_NOTHING)) From 15b34a96acad5b3c35042bcbae9825ee939f59df Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 15:53:38 -0800 Subject: [PATCH 09/17] M_DrawGenericOptions: draw arrow next to submenu options Arrow automatically takes color from first character of item label string --- src/k_menudraw.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 331a28846..7e7a6eb03 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -4328,19 +4328,39 @@ box_found: break; #endif case IT_STRING: - case IT_WHITESTRING: + case IT_WHITESTRING: { + INT32 px = x + ((currentMenu->menuitems[i].status & IT_TYPE) == IT_SUBMENU ? 8 : 0); + if (i == itemOn) cursory = y; if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING) - V_DrawMenuString(x + (i == itemOn ? 1 : 0), y, 0, currentMenu->menuitems[i].text); + { + if (i == itemOn) + V_DrawMenuString(px + 1, y, highlightflags, currentMenu->menuitems[i].text); + else + V_DrawMenuString(px, y, 0, currentMenu->menuitems[i].text); + } else - V_DrawMenuString(x, y, highlightflags, currentMenu->menuitems[i].text); + V_DrawMenuString(px, y, highlightflags, currentMenu->menuitems[i].text); // Cvar specific handling switch (currentMenu->menuitems[i].status & IT_TYPE) - case IT_CVAR: - { + { + case IT_SUBMENU: { + UINT8 ch = currentMenu->menuitems[i].text[0]; + + V_DrawMenuString( + x + (i == itemOn ? 1 + skullAnimCounter/5 : 0), + y - 1, + // Use color of first character in text label + i == itemOn ? highlightflags : (((max(ch, 0x80) - 0x80) & 15) << V_CHARCOLORSHIFT), + "\x1D" + ); + break; + } + + case IT_CVAR: { consvar_t *cv = currentMenu->menuitems[i].itemaction.cvar; switch (currentMenu->menuitems[i].status & IT_CVARTYPE) { @@ -4386,8 +4406,11 @@ box_found: } break; } - y += STRINGHEIGHT; - break; + } + + y += STRINGHEIGHT; + break; + } case IT_STRING2: V_DrawMenuString(x, y, 0, currentMenu->menuitems[i].text); /* FALLTHRU */ @@ -4440,7 +4463,6 @@ box_found: { V_DrawScaledPatch(x - 24, cursory, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); - V_DrawMenuString(x + 1, cursory, highlightflags, currentMenu->menuitems[itemOn].text); } } From e226369d0634587e36c9fb4888d99a746069c310 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 15:54:46 -0800 Subject: [PATCH 10/17] Menus/Server Options: make some quick n dirty drawers No special care taken to fully polish this. Just doing it so "Advanced options" is visible again. --- src/menus/options-server-1.c | 16 ++++++++++++++-- src/menus/options-server-advanced.c | 13 +++++++++++-- src/menus/options-video-gl.c | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/menus/options-server-1.c b/src/menus/options-server-1.c index 2b85ab610..2333c5e43 100644 --- a/src/menus/options-server-1.c +++ b/src/menus/options-server-1.c @@ -6,9 +6,16 @@ menuitem_t OPTIONS_Server[] = { + {IT_HEADER, "Advertising...", NULL, + NULL, {NULL}, 0, 0}, + {IT_STRING | IT_CVAR | IT_CV_STRING, "Server Name", "Change the name of your server.", NULL, {.cvar = &cv_servername}, 0, 0}, + + {IT_HEADER, "Progression...", NULL, + NULL, {NULL}, 0, 0}, + {IT_STRING | IT_CVAR, "Intermission", "Set how long to stay on the result screen.", NULL, {.cvar = &cv_inttime}, 0, 0}, @@ -19,7 +26,7 @@ menuitem_t OPTIONS_Server[] = NULL, {.cvar = &cv_votetime}, 0, 0}, - {IT_SPACE | IT_NOTHING, NULL, NULL, + {IT_HEADER, "Joining...", NULL, NULL, {NULL}, 0, 0}, {IT_STRING | IT_CVAR, "Maximum Players", "How many players can play at once.", @@ -37,13 +44,18 @@ menuitem_t OPTIONS_Server[] = {IT_STRING | IT_CVAR, "Pause Permissions", "Sets who can pause the game.", NULL, {.cvar = &cv_pause}, 0, 0}, + + {IT_HEADER, "Chat...", NULL, + NULL, {NULL}, 0, 0}, + {IT_STRING | IT_CVAR, "Mute Chat", "Prevents non-admins from sending chat messages.", NULL, {.cvar = &cv_mute}, 0, 0}, {IT_STRING | IT_CVAR, "Chat Spam Protection", "Prevents too many message from a single player.", NULL, {.cvar = &cv_chatspamprotection}, 0, 0}, - {IT_SPACE | IT_NOTHING, NULL, NULL, + + {IT_SPACE | IT_DYBIGSPACE, NULL, NULL, NULL, {NULL}, 0, 0}, {IT_STRING | IT_SUBMENU, "Advanced...", "Advanced options. Be careful when messing with these!", diff --git a/src/menus/options-server-advanced.c b/src/menus/options-server-advanced.c index 321dcddf1..055954e94 100644 --- a/src/menus/options-server-advanced.c +++ b/src/menus/options-server-advanced.c @@ -6,9 +6,16 @@ menuitem_t OPTIONS_ServerAdvanced[] = { + {IT_HEADER, "Master Server", NULL, + NULL, {NULL}, 0, 0}, + {IT_STRING | IT_CVAR | IT_CV_STRING, "Server Browser Address", "Default is \'https://ms.kartkrew.org/ms/api\'", NULL, {.cvar = &cv_masterserver}, 0, 0}, + + {IT_HEADER, "Network Connection", NULL, + NULL, {NULL}, 0, 0}, + {IT_STRING | IT_CVAR, "Resynch. Attempts", "How many times to attempt sending data to desynchronized players.", NULL, {.cvar = &cv_resynchattempts}, 0, 0}, @@ -24,7 +31,8 @@ menuitem_t OPTIONS_ServerAdvanced[] = {IT_STRING | IT_CVAR, "Join Timeout (tics)", "Players taking too long to join are kicked.", NULL, {.cvar = &cv_jointimeout}, 0, 0}, - {IT_SPACE | IT_NOTHING, NULL, NULL, + + {IT_HEADER, "Addon Downloading", NULL, NULL, {NULL}, 0, 0}, {IT_STRING | IT_CVAR, "Max File Transfer", "Maximum size of the files that can be downloaded from joining clients. (KB)", @@ -33,7 +41,8 @@ menuitem_t OPTIONS_ServerAdvanced[] = {IT_STRING | IT_CVAR, "File Transfer Speed", "File transfer packet rate. Larger values send more data.", NULL, {.cvar = &cv_downloadspeed}, 0, 0}, - {IT_SPACE | IT_NOTHING, NULL, NULL, + + {IT_HEADER, "Logging", NULL, NULL, {NULL}, 0, 0}, {IT_STRING | IT_CVAR, "Log Joiner IPs", "Shows the IP of connecting players.", diff --git a/src/menus/options-video-gl.c b/src/menus/options-video-gl.c index 739f646ba..06fbcc8ac 100644 --- a/src/menus/options-video-gl.c +++ b/src/menus/options-video-gl.c @@ -51,7 +51,7 @@ menu_t OPTIONS_VideoOGLDef = { &OPTIONS_VideoDef, 0, OPTIONS_VideoOGL, - 32, 80, + 48, 80, SKINCOLOR_PLAGUE, 0, MBF_DRAWBGWHILEPLAYING, NULL, From de6e1ab5c9a495cb6689c031b84eb335c136878b Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 17:02:29 -0800 Subject: [PATCH 11/17] M_DrawGenericOptions: animate drawer opening --- src/k_menu.h | 1 + src/k_menudraw.c | 34 +++++++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/k_menu.h b/src/k_menu.h index e4455d966..8ae10530a 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -965,6 +965,7 @@ extern struct optionsmenu_s { tic_t ticker; // How long the menu's been open for menu_anim_t offset; // To make the icons move smoothly when we transition! + menu_anim_t box; // For moving the button when we get into a submenu. it's smooth and cool! (normal x/y and target x/y.) // this is only used during menu transitions. diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 7e7a6eb03..930769238 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -4227,10 +4227,12 @@ static void M_DrawOptionsBoxTerm(INT32 x, INT32 top, INT32 bottom) void M_DrawGenericOptions(void) { - INT32 x = currentMenu->x - M_EaseWithTransition(Easing_Linear, 5 * 48), y = currentMenu->y, w, i, cursory = 0; + INT32 x = currentMenu->x - M_EaseWithTransition(Easing_Linear, 5 * 48), y = currentMenu->y, w, i, cursory = -100; INT32 expand = -1; INT32 boxy = 0; boolean collapse = false; + boolean opening = false; + fixed_t boxt = 0; M_DrawMenuTooltips(); M_DrawOptionsMovingButton(); @@ -4248,6 +4250,11 @@ void M_DrawGenericOptions(void) } } box_found: + if (optionsmenu.box.dist != expand) + { + optionsmenu.box.dist = expand; + optionsmenu.box.start = I_GetTime(); + } for (i = 0; i < currentMenu->numitems; i++) { @@ -4278,6 +4285,9 @@ box_found: y += 2; boxy = y; + + boxt = optionsmenu.box.dist == expand ? M_DueFrac(optionsmenu.box.start, 5) : FRACUNIT; + opening = boxt < FRACUNIT; } break; @@ -4288,12 +4298,15 @@ box_found: if (term) { - M_DrawOptionsBoxTerm(x, boxy, y); + if (menutransition.tics == menutransition.dest) + M_DrawOptionsBoxTerm(x, boxy, Easing_Linear(boxt, boxy, y)); + y += SMALLLINEHEIGHT; boxy = 0; + opening = false; } - if (i == itemOn) + if (i == itemOn && !opening) { cursory = y; M_DrawUnderline(x, BASEVIDWIDTH - x, y); @@ -4329,6 +4342,17 @@ box_found: #endif case IT_STRING: case IT_WHITESTRING: { + if (opening) + { + if ((currentMenu->menuitems[i].status & IT_TYPE) == IT_CVAR && + (currentMenu->menuitems[i].status & IT_CVARTYPE) == IT_CV_STRING) + { + y += 16; + } + y += STRINGHEIGHT; + break; + } + INT32 px = x + ((currentMenu->menuitems[i].status & IT_TYPE) == IT_SUBMENU ? 8 : 0); if (i == itemOn) @@ -4449,8 +4473,8 @@ box_found: } } - if (boxy) - M_DrawOptionsBoxTerm(x, boxy, y); + if (boxy && menutransition.tics == menutransition.dest) + M_DrawOptionsBoxTerm(x, boxy, Easing_Linear(boxt, boxy, y)); // DRAW THE SKULL CURSOR if (((currentMenu->menuitems[itemOn].status & IT_DISPLAY) == IT_PATCH) From 95ff48f8a44698d83d85157b48bd0a15250e3f9d Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 17:37:15 -0800 Subject: [PATCH 12/17] Menus: draw hand cursor consistently --- src/k_menudraw.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 930769238..2e4011de2 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -158,7 +158,7 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop) static void M_DrawCursorHand(INT32 x, INT32 y) { - V_DrawScaledPatch(x - 24, y, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); + V_DrawScaledPatch(x - 24 - (I_GetTime() % 16 < 8), y, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); } static void M_DrawUnderline(INT32 left, INT32 right, INT32 y) @@ -2026,7 +2026,7 @@ static void M_DrawCharSelectPreview(UINT8 num) UINT8 cy = ypos+16 + (i*10); if (p->changeselect == i) - V_DrawScaledPatch(xpos, cy, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); + M_DrawCursorHand(xpos + 20, cy); V_DrawThinString(xpos+16, cy, (p->changeselect == i ? highlightflags : 0), choices[i]); } @@ -2566,8 +2566,7 @@ void M_DrawRaceDifficulty(void) if (i == itemOn) { - V_DrawScaledPatch(140 + tx - 24, y, 0, - W_CachePatchName("M_CURSOR", PU_CACHE)); + M_DrawCursorHand(140 + tx, y); } y += 10; @@ -4485,8 +4484,7 @@ box_found: } else { - V_DrawScaledPatch(x - 24, cursory, 0, - W_CachePatchName("M_CURSOR", PU_CACHE)); + M_DrawCursorHand(x, cursory); } } @@ -4507,7 +4505,7 @@ void M_DrawProfileErase(void) if (i == optionsmenu.eraseprofilen) { cursory = y; - V_DrawScaledPatch(x - 24, cursory, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); + M_DrawCursorHand(x, cursory); } V_DrawMenuString(x, y, @@ -4967,8 +4965,7 @@ void M_DrawVideoModes(void) i = 41 - 10 + ((optionsmenu.vidm_selected / optionsmenu.vidm_column_size)*7*13) + t; j = currentMenu->y + 14 + ((optionsmenu.vidm_selected % optionsmenu.vidm_column_size)*9); - V_DrawScaledPatch(i - 8, j, 0, - W_CachePatchName("M_CURSOR", PU_CACHE)); + M_DrawCursorHand(i + 14, j); } // Gameplay Item Tggles: From 07afa214c73212673da3c75f0fae49edbcfa879c Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 17:42:41 -0800 Subject: [PATCH 13/17] Menus/Video Options: shrink menu width --- src/menus/options-video-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menus/options-video-1.c b/src/menus/options-video-1.c index 3d2aaa503..660ae9fec 100644 --- a/src/menus/options-video-1.c +++ b/src/menus/options-video-1.c @@ -65,7 +65,7 @@ menu_t OPTIONS_VideoDef = { &OPTIONS_MainDef, 0, OPTIONS_Video, - 32, 80-8, + 48, 80-8, SKINCOLOR_PLAGUE, 0, MBF_DRAWBGWHILEPLAYING, NULL, From 700df854dc9b1f749f90db24f53417cd4e013d19 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 17:51:43 -0800 Subject: [PATCH 14/17] Menus: fix/tweak option text box - Fixed width to match new font spacing - Adjusted arrow position --- src/k_menudraw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 2e4011de2..fec52f3c4 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -98,7 +98,7 @@ fixed_t M_DueFrac(tic_t start, tic_t duration) } #define SKULLXOFF -32 -#define LINEHEIGHT 16 +#define LINEHEIGHT 17 #define STRINGHEIGHT 9 #define FONTBHEIGHT 20 #define SMALLLINEHEIGHT 9 @@ -1365,7 +1365,7 @@ void M_DrawHorizontalMenu(void) void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines) { // Solid color textbox. - V_DrawFill(x+5, y+5, width*8+6, boxlines*8+6, 159); + V_DrawFill(x+5, y+5, width*7+6, boxlines*9+6, 159); //V_DrawFill(x+8, y+8, width*8, boxlines*8, 31); } @@ -4346,7 +4346,7 @@ box_found: if ((currentMenu->menuitems[i].status & IT_TYPE) == IT_CVAR && (currentMenu->menuitems[i].status & IT_CVARTYPE) == IT_CV_STRING) { - y += 16; + y += LINEHEIGHT; } y += STRINGHEIGHT; break; @@ -4400,12 +4400,12 @@ box_found: if (itemOn == i) { xoffs += 8; - V_DrawMenuString(x + (skullAnimCounter/5) + 6, y + 11, highlightflags, "\x1D"); + V_DrawMenuString(x + (skullAnimCounter/5) + 7, y + 11, highlightflags, "\x1D"); } V_DrawString(x + xoffs + 8, y + 12, 0, cv->string); - y += 16; + y += LINEHEIGHT; } break; default: { From 41155fd81b538be666272d8ee4735859132e6c3d Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 18:14:47 -0800 Subject: [PATCH 15/17] Menus: press C to reset text box options to default --- src/k_menufunc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 29b91e6b5..dad86d197 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -980,6 +980,15 @@ static void M_HandleMenuInput(void) M_OpenVirtualKeyboard(thisMenuKey == -1); // If we entered this menu by pressing a menu Key, default to keyboard typing, otherwise use controller. return; } + else if (M_MenuExtraPressed(pid)) + { + if (!(currentMenu->behaviourflags & MBF_SOUNDLESS)) + S_StartSound(NULL, sfx_s3k5b); + + M_ChangeCvar(-1); + M_SetMenuDelay(pid); + return; + } } else From a7db45c73b3e4d10510ecc50f894407bd57a37f6 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 19:21:08 -0800 Subject: [PATCH 16/17] M_DrawCursorHand, M_DrawUnderline: extern in k_menu.h --- src/k_menu.h | 3 +++ src/k_menudraw.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/k_menu.h b/src/k_menu.h index 8ae10530a..a83088868 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1205,6 +1205,9 @@ void M_HandleImageDef(INT32 choice); #define M_ALTCOLOR V_ORANGEMAP +void M_DrawCursorHand(INT32 x, INT32 y); +void M_DrawUnderline(INT32 left, INT32 right, INT32 y); + // For some menu highlights UINT16 M_GetCvPlayerColor(UINT8 pnum); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index fec52f3c4..5afa960a4 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -156,12 +156,12 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop) V_DrawFill(px, y, 2, 8, aquamap[0]); } -static void M_DrawCursorHand(INT32 x, INT32 y) +void M_DrawCursorHand(INT32 x, INT32 y) { V_DrawScaledPatch(x - 24 - (I_GetTime() % 16 < 8), y, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); } -static void M_DrawUnderline(INT32 left, INT32 right, INT32 y) +void M_DrawUnderline(INT32 left, INT32 right, INT32 y) { if (menutransition.tics == menutransition.dest) V_DrawFill(left - 1, y + 5, (right - left) + 11, 2, 31); From 3a21bee9378fbc7ee13cfde26b6877116ba41264 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 19:21:43 -0800 Subject: [PATCH 17/17] Menus/Profiles Accessibility: use menu font, underlines and hand --- .../options-profiles-edit-accessibility.cpp | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/menus/options-profiles-edit-accessibility.cpp b/src/menus/options-profiles-edit-accessibility.cpp index 2d167fdd1..5c99a31d3 100644 --- a/src/menus/options-profiles-edit-accessibility.cpp +++ b/src/menus/options-profiles-edit-accessibility.cpp @@ -16,10 +16,15 @@ namespace void draw_routine() { - Draw row = Draw(0, currentMenu->y).font(Draw::Font::kConsole); + Draw row = Draw(0, currentMenu->y).font(Draw::Font::kMenu); M_DrawEditProfileTooltips(); + if (optionsmenu.profile != NULL) + { + M_DrawProfileCard(optionsmenu.optx, optionsmenu.opty, false, optionsmenu.profile); + } + for (int i = 0; i < currentMenu->numitems; ++i) { const menuitem_t& it = currentMenu->menuitems[i]; @@ -30,6 +35,12 @@ void draw_routine() Draw h = row.x(currentMenu->x); + if (selected) + { + M_DrawUnderline(h.x(), BASEVIDWIDTH - 18, h.y()); + M_DrawCursorHand(h.x(), h.y()); + } + if ((it.status & IT_HEADERTEXT) == IT_HEADERTEXT) { h @@ -46,28 +57,29 @@ void draw_routine() if ((it.status & IT_TYPE) == IT_CVAR) { - auto val = Draw::TextElement(it.itemaction.cvar->string).font(Draw::Font::kConsole); + bool isDefault = CV_IsSetToDefault(it.itemaction.cvar); + auto val = Draw::TextElement(it.itemaction.cvar->string).font(Draw::Font::kMenu); - h = row.x(BASEVIDWIDTH - 16).flags(highlightflags); - h.align(Draw::Align::kRight).text(val); + h = row.x(BASEVIDWIDTH - 18); + h.align(Draw::Align::kRight).flags(isDefault ? highlightflags : warningflags).text(val); if (selected) { + Draw ar = h.flags(highlightflags); int ofs = skullAnimCounter / 5; - h.x(-val.width() - 10 - ofs).text("\x1C"); - h.x(2 + ofs).text("\x1D"); + ar.x(-val.width() - 10 - ofs).text("\x1C"); + ar.x(2 + ofs).text("\x1D"); + } + + if (!isDefault) + { + h.x(selected ? 12 : 5).y(-1).flags(warningflags).text("."); } } } row = row.y(11); } - - // Finally, draw the card ontop - if (optionsmenu.profile != NULL) - { - M_DrawProfileCard(optionsmenu.optx, optionsmenu.opty, false, optionsmenu.profile); - } } }; // namespace