Small continuation of the MP menus, this allows us to reach CORE/MODDED split

This commit is contained in:
SinnamonLat 2021-11-13 19:32:12 +01:00
parent 04bd3efd5b
commit feb0868292
4 changed files with 66 additions and 8 deletions

View file

@ -360,7 +360,7 @@ void M_LevelSelectTick(void);
// We'll add more stuff here as we need em... // We'll add more stuff here as we need em...
extern struct mpmenu_s { extern struct mpmenu_s {
UINT8 modechoice; UINT8 modechoice;
UINT8 room; UINT8 room;

View file

@ -174,7 +174,15 @@ menu_t PLAY_BattleGamemodesDef = KARTGAMEMODEMENU(PLAY_BattleGamemodesMenu, &PLA
// MULTIPLAYER OPTION SELECT // MULTIPLAYER OPTION SELECT
menuitem_t PLAY_MP_OptSelect[] = menuitem_t PLAY_MP_OptSelect[] =
{ {
{IT_NOTHING | IT_KEYHANDLER, NULL, NULL, NULL, M_MPOptSelect, 0, 0}, //{IT_NOTHING | IT_KEYHANDLER, NULL, NULL, NULL, M_MPOptSelect, 0, 0},
{IT_STRING | IT_CALL, "Host Game", "Start your own online game!",
NULL, NULL, 0, 0},
{IT_STRING | IT_CALL, "Join by IP", "Join an online game by its IP address.",
NULL, NULL, 0, 0},
{IT_STRING | IT_CALL, "Server Browser", "Search for game servers to play in.",
NULL, M_MPRoomSelectInit, 0, 0},
}; };
menu_t PLAY_MP_OptSelectDef = { menu_t PLAY_MP_OptSelectDef = {

View file

@ -1305,14 +1305,64 @@ void M_DrawTimeAttack(void)
} }
} }
// This draws the options of a given menu in a fashion specific to the multiplayer option select screen (host game / server browser etc)
// TODO: Add 2nd argument that lets us "expand" a given option via an array
static void M_MPOptDrawer(menu_t *m)
{
// This is a copypaste of the generic gamemode menu code with a few changes.
// TODO: Allow specific options to "expand" into smaller ones.
patch_t *buttback = W_CachePatchName("M_PLAT2", PU_CACHE);
UINT8 n = m->numitems-1;
INT32 i, x = 142, y = 32; // Dirty magic numbers for now but they work out.
if (menutransition.tics)
{
x += 24 * menutransition.tics;
}
for (i = 0; i < m->numitems; i++)
{
switch (m->menuitems[i].status & IT_DISPLAY)
{
case IT_STRING:
{
UINT8 *colormap = NULL;
if (i == itemOn)
{
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE);
}
else
{
colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_MOSS, GTC_CACHE);
}
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, FRACUNIT, 0, buttback, colormap);
V_DrawCenteredGamemodeString(x, y - 3, V_ALLOWLOWERCASE, colormap, m->menuitems[i].text);
}
break;
}
x += GM_XOFFSET;
y += GM_YOFFSET;
}
}
// Multiplayer mode option select // Multiplayer mode option select
void M_DrawMPOptSelect(void) void M_DrawMPOptSelect(void)
{ {
patch_t *background = W_CachePatchName("M_EGGACH", PU_CACHE); patch_t *background = W_CachePatchName("M_EGGACH", PU_CACHE);
V_DrawFill(0, 0, 999, 999, 25); V_DrawFill(0, 0, 999, 999, 25);
V_DrawFixedPatch(160<<FRACBITS, 100<<FRACBITS, FRACUNIT, 0, background, NULL); V_DrawFixedPatch(160<<FRACBITS, 104<<FRACBITS, FRACUNIT, 0, background, NULL);
M_DrawMenuTooltips();
M_MPOptDrawer(currentMenu);
} }
// Multiplayer room select // Multiplayer room select

View file

@ -2611,20 +2611,20 @@ struct mpmenu_s mpmenu;
// MULTIPLAYER OPTION SELECT // MULTIPLAYER OPTION SELECT
void M_MPOptSelect(INT32 choice) void M_MPOptSelect(INT32 choice)
{ {
} }
void M_MPOptSelectInit(INT32 chocie) void M_MPOptSelectInit(INT32 chocie)
{ {
mpmenu.modechoice = 0; mpmenu.modechoice = 0;
mpmenu.ticker = 0; mpmenu.ticker = 0;
M_SetupNextMenu(&PLAY_MP_OptSelectDef, false); M_SetupNextMenu(&PLAY_MP_OptSelectDef, false);
} }
void M_MPOptSelectTick(void) void M_MPOptSelectTick(void)
{ {
} }
// MULTIPLAYER ROOM SELECT MENU // MULTIPLAYER ROOM SELECT MENU