First pass horizontal menu for Goner Setup

This commit is contained in:
toaster 2023-12-01 22:50:03 +00:00
parent 30383ba82f
commit df85b5d625
3 changed files with 69 additions and 11 deletions

View file

@ -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);

View file

@ -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
//

View file

@ -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,