From 9eb7ae3cff39e16686ef3c8696fe83bd5c59c518 Mon Sep 17 00:00:00 2001 From: SinnamonLat Date: Tue, 24 May 2022 00:57:35 +0200 Subject: [PATCH] Fix ONLINE menus --- src/k_menudef.c | 5 ++++- src/k_menudraw.c | 14 ++++++------ src/k_menufunc.c | 57 ++++++++++++++++++------------------------------ 3 files changed, 32 insertions(+), 44 deletions(-) diff --git a/src/k_menudef.c b/src/k_menudef.c index cbeb1599e..0188f7b34 100644 --- a/src/k_menudef.c +++ b/src/k_menudef.c @@ -311,9 +311,12 @@ menuitem_t PLAY_MP_JoinIP[] = { //{IT_NOTHING | IT_KEYHANDLER, NULL, NULL, NULL, M_MPOptSelect, 0, 0}, - {IT_STRING | IT_CVAR | IT_CV_STRING, "IP: ", "Type the IPv4 address of the server then press enter to attempt connection.", + {IT_STRING | IT_CVAR | IT_CV_STRING, "IP: ", "Type the IPv4 address of the server.", NULL, {.cvar = &cv_dummyip}, 0, 0}, + {IT_STRING, "CONNECT ", "Attempt to connect to the server you entered the IP for.", + NULL, NULL, 0, 0}, + {IT_STRING | IT_SPACE, "LAST IPs JOINED:", "Kanade best waifu :)", NULL, {NULL}, 0, 0}, diff --git a/src/k_menudraw.c b/src/k_menudraw.c index e443e88cc..da7d99a8f 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -2149,12 +2149,12 @@ void M_DrawMPHost(void) void M_DrawMPJoinIP(void) { - patch_t *minibutt = W_CachePatchName("M_SBUTT", PU_CACHE); + //patch_t *minibutt = W_CachePatchName("M_SBUTT", PU_CACHE); // There is no such things as mini butts, only thick thighs to rest your head on. - patch_t *minigo = W_CachePatchName("M_SGO", PU_CACHE); + //patch_t *minigo = W_CachePatchName("M_SGO", PU_CACHE); patch_t *typebar = W_CachePatchName("M_TYPEB", PU_CACHE); - UINT8 *colormap = NULL; + //UINT8 *colormap = NULL; UINT8 *colormapc = NULL; INT32 xp = 73, yp = 133, i = 0; // Starting position for the text drawing. @@ -2185,7 +2185,7 @@ void M_DrawMPJoinIP(void) strcpy(str, "---"); // If that fails too then there's nothing! } - V_DrawString(xp, yp, V_ALLOWLOWERCASE | (i == itemOn ? highlightflags : 0), str); + V_DrawString(xp, yp, V_ALLOWLOWERCASE | ((i == itemOn || currentMenu->menuitems[i].status & IT_SPACE) ? highlightflags : 0), str); // Cvar specific handling switch (currentMenu->menuitems[i].status & IT_TYPE) @@ -2197,7 +2197,7 @@ void M_DrawMPJoinIP(void) { case IT_CV_STRING: - colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_MOSS, GTC_CACHE); + //colormap = R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_MOSS, GTC_CACHE); colormapc = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_PLAGUE, GTC_CACHE); V_DrawFixedPatch((xp + 20)<string, 0), yp, '_' | 0x80, false); - // On this specific menu the only time we'll ever see this is for the connect by IP typefield. + /*// On this specific menu the only time we'll ever see this is for the connect by IP typefield. // Draw the small GO button here (and the text which is a separate graphic) V_DrawFixedPatch((xp + 20 + typebar->width -4)<width -4 + (minibutt->width/2))<width -4 + (minibutt->width/2))< copy paste! - else if (ctrldown && (ch == 'v' || ch == 'V')) - { - const char *paste = I_ClipboardPaste(); - UINT16 i; - for (i=0; i < strlen(paste); i++) - M_ChangeStringCvar(paste[i]); // We can afford to do this since we're currently on that cvar. - - return true; // Don't input the V obviously lol. - } - } - else if (currentMenu->numitems - itemOn <= NUMLOGIP && ch == KEY_ENTER) // On one of the last 3 options for IP rejoining + else if (currentMenu->numitems - itemOn <= NUMLOGIP && M_MenuConfirmPressed(pid)) // On one of the last 3 options for IP rejoining { UINT8 index = NUMLOGIP - (currentMenu->numitems - itemOn); + M_SetMenuDelay(pid); // Is there an address at this part of the table? if (joinedIPlist[index][0] && strlen(joinedIPlist[index][0])) @@ -3788,29 +3783,19 @@ boolean M_JoinIPInputs(INT32 ch) void M_MPRoomSelect(INT32 choice) { + const UINT8 pid = 0; + (void) choice; - switch (choice) + if (menucmd[pid].dpad_lr) { - - case KEY_LEFTARROW: - case KEY_RIGHTARROW: - { - - mpmenu.room = (!mpmenu.room) ? 1 : 0; - S_StartSound(NULL, sfx_s3k5b); - - break; - } - - case KEY_ESCAPE: - { - if (currentMenu->prevMenu) - M_SetupNextMenu(currentMenu->prevMenu, false); - else - M_ClearMenus(true); - break; - } - + mpmenu.room = (!mpmenu.room) ? 1 : 0; + S_StartSound(NULL, sfx_s3k5b); + M_SetMenuDelay(pid); + } + else if (M_MenuBackPressed(pid)) + { + M_GoBack(0); + M_SetMenuDelay(pid); } }