From df85b5d625773802a166f791dd380c7bf5594d28 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Dec 2023 22:50:03 +0000 Subject: [PATCH] First pass horizontal menu for Goner Setup --- src/k_menu.h | 1 + src/k_menudraw.c | 54 ++++++++++++++++++++++++++++++++++++++++++ src/menus/main-goner.c | 25 ++++++++++--------- 3 files changed, 69 insertions(+), 11 deletions(-) diff --git a/src/k_menu.h b/src/k_menu.h index eec2a59c1..f5e414930 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1168,6 +1168,7 @@ void M_DrawMenuForeground(void); void M_Drawer(void); void M_DrawGenericMenu(void); void M_DrawKartGamemodeMenu(void); +void M_DrawHorizontalMenu(void); void M_DrawTextBox(INT32 x, INT32 y, INT32 width, INT32 boxlines); void M_DrawMessageMenu(void); void M_DrawImageDef(void); diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 9a5a6b035..558e016c3 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -1116,6 +1116,60 @@ void M_DrawKartGamemodeMenu(void) } } +void M_DrawHorizontalMenu(void) +{ + INT32 x = BASEVIDWIDTH/2, y = currentMenu->y, i; + + const INT32 width = 80; + + i = itemOn; + + do + { + if (i == 0) + break; + i--; + x -= width; + } + while (x > -width/2); + + while (x < BASEVIDWIDTH + (width/2)) + { + V_DrawCenteredThinString( + x, y, + (i == itemOn) ? highlightflags : 0, + currentMenu->menuitems[i].text + ); + + if (++i == currentMenu->numitems) + break; + x += width; + } + + y++; // thin string means better to bottom-align these + + if (itemOn != 0) + V_DrawCharacter((BASEVIDWIDTH - width)/2 + 3 - (skullAnimCounter/5), y, + '\x1C' | highlightflags, false); // left arrow + + if (itemOn != currentMenu->numitems-1) + V_DrawCharacter((BASEVIDWIDTH + width)/2 - 10 + (skullAnimCounter/5), y, + '\x1D' | highlightflags, false); // right arrow + + x = (BASEVIDWIDTH - 8*(currentMenu->numitems-1))/2; + for (i = 0; i < currentMenu->numitems; i++, x += 8) + { + if (i == itemOn) + { + V_DrawFill(x-2, y + 15, 4, 4, 0); + } + else + { + V_DrawFill(x-1, y + 16, 2, 2, 16); + } + } +} + #define MAXMSGLINELEN 256 // diff --git a/src/menus/main-goner.c b/src/menus/main-goner.c index d5531d65d..581be98f9 100644 --- a/src/menus/main-goner.c +++ b/src/menus/main-goner.c @@ -5,18 +5,21 @@ menuitem_t MAIN_Goner[] = { + {IT_STRING | IT_CVAR | IT_CV_STRING, "Password", + "ATTEMPT ADMINISTRATOR ACCESS.", NULL, + {.cvar = &cv_dummyextraspassword}, 0, 0}, + {IT_STRING | IT_CALL, "Quit", "CONCLUDE OBSERVATIONS NOW.", NULL, {.routine = M_QuitSRB2}, 0, 0}, - {IT_STRING | IT_CVAR | IT_CV_STRING, "Password", "ATTEMPT ADMINISTRATOR ACCESS.", - NULL, {.cvar = &cv_dummyextraspassword}, 0, 0}, + {IT_STRING | IT_CALL, "Video Options", + "CONFIGURE OCULAR PATHWAYS.", NULL, + ={.routine = M_VideoOptions}, 0, 0}, - {IT_STRING | IT_CALL, "Video Options", "CONFIGURE OCULAR PATHWAYS.", - NULL, {.routine = M_VideoOptions}, 0, 0}, - - {IT_STRING | IT_CALL, "Sound Options", "CALIBRATE AURAL DATASTREAM.", - NULL, {.routine = M_SoundOptions}, 0, 0}, + {IT_STRING | IT_CALL, "Sound Options", + "CALIBRATE AURAL DATASTREAM.", NULL, + {.routine = M_SoundOptions}, 0, 0}, {IT_STRING | IT_CALL, "Profile Setup", "ASSIGN VEHICLE INPUTS.", NULL, @@ -34,12 +37,12 @@ menu_t MAIN_GonerDef = { NULL, 0, MAIN_Goner, - 32, 80, + 32, 160, 0, 0, - 0, - "_OCEAN", + MBF_UD_LR_FLIPPED, + "_GONER", 0, 0, - M_DrawGenericMenu, + M_DrawHorizontalMenu, M_GonerTick, NULL, NULL,