From 0305249a365275110c0b1e7f2c97f1791f0a5a88 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 31 Jan 2023 15:54:19 +0000 Subject: [PATCH] PLAY_MP_OptSelectDef: Adjust the unwinding boxes - Make them open in a snappier fashion, not a leisurely step - Fix the open box missing an entire row of pixels at the top --- src/k_menudraw.c | 4 ++-- src/menus/play-online-1.c | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 3abf54bc3..140e0bb4a 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -2364,11 +2364,11 @@ static void M_MPOptDrawer(menu_t *m, INT16 extend[3][3]) if (extend[i][2]) { - for (j=0; j < extend[i][2]/2; j++) + for (j=0; j <= extend[i][2]/2; j++) { // Draw rectangles that look like the current selected item starting from the top of the actual selection graphic and going up to where it's supposed to go. // With colour 169 (that's the index of the shade of black the plague colourization gives us. ...No I don't like using a magic number either. - V_DrawFill(x + (extend[i][2]/2) - j - (buttback->width/2), (y + extend[i][2]) - (2*j), 225, 2, 169); + V_DrawFill((x-1) + (extend[i][2]/2) - j - (buttback->width/2), (y + extend[i][2]) - (2*j), 226, 2, 169); } } V_DrawFixedPatch((x + (extend[i][2]/2)) *FRACUNIT, (y + extend[i][2])*FRACUNIT, FRACUNIT, 0, buttback, colormap); diff --git a/src/menus/play-online-1.c b/src/menus/play-online-1.c index 18bea191f..8146cacc3 100644 --- a/src/menus/play-online-1.c +++ b/src/menus/play-online-1.c @@ -71,12 +71,26 @@ void M_MPOptSelectTick(void) // 3 Because we have 3 options in the menu for (; i < 3; i++) { - if (mpmenu.modewinextend[i][0]) - mpmenu.modewinextend[i][2] += 8; + if (mpmenu.modewinextend[i][0] != 0) + { + if (mpmenu.modewinextend[i][2] < (mpmenu.modewinextend[i][1] - 8)) + { + mpmenu.modewinextend[i][2] = (((2*mpmenu.modewinextend[i][1]) + mpmenu.modewinextend[i][2])/3); + mpmenu.modewinextend[i][2] -= (mpmenu.modewinextend[i][2] & 1); // prevent jitter, bias closed + } + else + { + mpmenu.modewinextend[i][2] = mpmenu.modewinextend[i][1]; + } + } + else if (mpmenu.modewinextend[i][2] > 8) + { + mpmenu.modewinextend[i][2] /= 3; + mpmenu.modewinextend[i][2] += (mpmenu.modewinextend[i][2] & 1); // prevent jitter, bias open + } else - mpmenu.modewinextend[i][2] -= 8; - - mpmenu.modewinextend[i][2] = min(mpmenu.modewinextend[i][1], max(0, mpmenu.modewinextend[i][2])); - //CONS_Printf("%d - %d,%d,%d\n", i, mpmenu.modewinextend[i][0], mpmenu.modewinextend[i][1], mpmenu.modewinextend[i][2]); + { + mpmenu.modewinextend[i][2] = 0; + } } }