From 3a21bee9378fbc7ee13cfde26b6877116ba41264 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 29 Dec 2023 19:21:43 -0800 Subject: [PATCH] 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