Minimum mergeable work to finish off branch

- Seperate into "This Profile only" and "For all Profiles"
- Move screen tilting and reducevfx from Video Options to Accessibility submenu, under "For all Profiles"
- Adjust spacing on menu
This commit is contained in:
toaster 2023-12-29 14:32:37 +00:00
parent 595d078a83
commit c65c45dcf9
2 changed files with 46 additions and 18 deletions

View file

@ -5,6 +5,7 @@
#include "../command.h" #include "../command.h"
#include "../k_menu.h" #include "../k_menu.h"
#include "../p_local.h" // cv_tilting
extern "C" consvar_t cv_mindelay; extern "C" consvar_t cv_mindelay;
@ -23,27 +24,43 @@ void draw_routine()
{ {
const menuitem_t& it = currentMenu->menuitems[i]; const menuitem_t& it = currentMenu->menuitems[i];
bool selected = i == itemOn; if (it.status & IT_DISPLAY)
Draw h = row.flags(selected ? highlightflags : 0);
if ((it.status & IT_TYPE) == IT_CVAR)
{ {
auto val = Draw::TextElement(it.itemaction.cvar->string).font(Draw::Font::kConsole); bool selected = i == itemOn;
h.x(currentMenu->x).text(it.text); Draw h = row.x(currentMenu->x);
h = h.x(BASEVIDWIDTH - 16); if ((it.status & IT_HEADERTEXT) == IT_HEADERTEXT)
h.align(Draw::Align::kRight).text(val);
if (selected)
{ {
int ofs = skullAnimCounter / 5; h
h.x(-val.width() - 10 - ofs).text("\x1C"); .x(-4)
h.x(2 + ofs).text("\x1D"); .flags(V_GRAYMAP)
.text(it.text);
}
else
{
h
.flags(selected ? highlightflags : 0)
.text(it.text);
}
if ((it.status & IT_TYPE) == IT_CVAR)
{
auto val = Draw::TextElement(it.itemaction.cvar->string).font(Draw::Font::kConsole);
h = row.x(BASEVIDWIDTH - 16).flags(highlightflags);
h.align(Draw::Align::kRight).text(val);
if (selected)
{
int ofs = skullAnimCounter / 5;
h.x(-val.width() - 10 - ofs).text("\x1C");
h.x(2 + ofs).text("\x1D");
}
} }
} }
row = row.y(12); row = row.y(11);
} }
// Finally, draw the card ontop // Finally, draw the card ontop
@ -57,12 +74,12 @@ void draw_routine()
menuitem_t OPTIONS_ProfileAccessibility[] = { menuitem_t OPTIONS_ProfileAccessibility[] = {
{IT_HEADER, "This Profile only:", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Rumble", "For gamepad users - should your device rumble?", {IT_STRING | IT_CVAR, "Rumble", "For gamepad users - should your device rumble?",
NULL, {.cvar = &cv_dummyprofilerumble}, 0, 0}, NULL, {.cvar = &cv_dummyprofilerumble}, 0, 0},
{IT_SPACE | IT_NOTHING, NULL, NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Auto Roulette", "Item roulette auto-stops on a random result.", {IT_STRING | IT_CVAR, "Auto Roulette", "Item roulette auto-stops on a random result.",
NULL, {.cvar = &cv_dummyprofileautoroulette}, 0, 0}, NULL, {.cvar = &cv_dummyprofileautoroulette}, 0, 0},
@ -75,8 +92,17 @@ menuitem_t OPTIONS_ProfileAccessibility[] = {
{IT_SPACE | IT_NOTHING, NULL, NULL, {IT_SPACE | IT_NOTHING, NULL, NULL,
NULL, {NULL}, 0, 0}, NULL, {NULL}, 0, 0},
{IT_HEADER, "For all Profiles:", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Minimum Input Delay", "Practice for online play! 0 = instant response.", {IT_STRING | IT_CVAR, "Minimum Input Delay", "Practice for online play! 0 = instant response.",
NULL, {.cvar = &cv_mindelay}, 0, 0}, NULL, {.cvar = &cv_mindelay}, 0, 0},
{IT_STRING | IT_CVAR, "Screen Tilting", "View rotation on inclines.",
NULL, {.cvar = &cv_tilting}, 0, 0},
{IT_STRING | IT_CVAR, "Reduce Effects", "If overwhelmed, hide less-important particle cues.",
NULL, {.cvar = &cv_reducevfx}, 0, 0},
}; };
menu_t OPTIONS_ProfileAccessibilityDef = { menu_t OPTIONS_ProfileAccessibilityDef = {
@ -84,7 +110,7 @@ menu_t OPTIONS_ProfileAccessibilityDef = {
&OPTIONS_EditProfileDef, &OPTIONS_EditProfileDef,
0, 0,
OPTIONS_ProfileAccessibility, OPTIONS_ProfileAccessibility,
145, 72, 145, 52,
SKINCOLOR_ULTRAMARINE, 0, SKINCOLOR_ULTRAMARINE, 0,
MBF_DRAWBGWHILEPLAYING, MBF_DRAWBGWHILEPLAYING,
"FILE", "FILE",

View file

@ -27,11 +27,13 @@ menuitem_t OPTIONS_Video[] =
{IT_NOTHING|IT_SPACE, NULL, NULL, {IT_NOTHING|IT_SPACE, NULL, NULL,
NULL, {NULL}, 0, 0}, NULL, {NULL}, 0, 0},
#if 0 // See Profiles/Accessibility
{IT_STRING | IT_CVAR, "Screen Tilting", "The view rotatation on inclines can be disabled to reduce motion sickness.", {IT_STRING | IT_CVAR, "Screen Tilting", "The view rotatation on inclines can be disabled to reduce motion sickness.",
NULL, {.cvar = &cv_tilting}, 0, 0}, NULL, {.cvar = &cv_tilting}, 0, 0},
{IT_STRING | IT_CVAR, "Reduce Visual Effects", "If on, some less-important particle cues will be hidden.", {IT_STRING | IT_CVAR, "Reduce Visual Effects", "If on, some less-important particle cues will be hidden.",
NULL, {.cvar = &cv_reducevfx}, 0, 0}, NULL, {.cvar = &cv_reducevfx}, 0, 0},
#endif
{IT_STRING | IT_CVAR | IT_CV_SLIDER, "Gamma", "Adjusts the overall brightness of the game.", {IT_STRING | IT_CVAR | IT_CV_SLIDER, "Gamma", "Adjusts the overall brightness of the game.",
NULL, {.cvar = &cv_globalgamma}, 0, 0}, NULL, {.cvar = &cv_globalgamma}, 0, 0},