From ad52f80627327a8164fbcfb447eff8cd9171f1e0 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 14 Apr 2019 23:17:12 -0500 Subject: [PATCH] Add scroll bar to replay hut --- src/m_menu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index c6a93bc4..6d9ccaf1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5497,7 +5497,7 @@ static void M_DrawReplayHut(void) V_DrawString(x, localy, V_SNAPTOTOP|V_SNAPTOLEFT|highlightflags, currentMenu->menuitems[i].text); } - y += currentMenu->menuitems[currentMenu->numitems-1].alphaKey; + y += currentMenu->menuitems[replaylistitem].alphaKey; for (i = 0; i < (INT16)sizedirmenu; i++) { @@ -5554,6 +5554,14 @@ static void M_DrawReplayHut(void) V_DrawString(localx, localy, V_SNAPTOTOP|V_SNAPTOLEFT|V_ALLOWLOWERCASE, demolist[i].title); } + // Draw scrollbar + y = sizedirmenu*10 + currentMenu->menuitems[replaylistitem].alphaKey + 30; + if (y > SCALEDVIEWHEIGHT-80) + { + V_DrawFill(BASEVIDWIDTH-4, 75, 4, SCALEDVIEWHEIGHT-80, V_SNAPTOTOP|V_SNAPTORIGHT|239); + V_DrawFill(BASEVIDWIDTH-3, 76 + (SCALEDVIEWHEIGHT-80) * replayhutmenuy / y, 2, (((SCALEDVIEWHEIGHT-80) * (SCALEDVIEWHEIGHT-80))-1) / y - 1, V_SNAPTOTOP|V_SNAPTORIGHT|229); + } + // Draw the cursor V_DrawScaledPatch(currentMenu->x - 24, cursory, V_SNAPTOTOP|V_SNAPTOLEFT, W_CachePatchName("M_CURSOR", PU_CACHE));