From 233d0b62b912018cab79c9d3b3d1e60d4810f991 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 25 May 2020 22:12:08 +0200 Subject: [PATCH] - fixed space calculations for oversized episode and skill menus. --- src/menu/menudef.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index db8d29a08..13f95583f 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -1154,7 +1154,7 @@ void M_StartupEpisodeMenu(FNewGameStartup *gs) if (totalheight < 190 || AllEpisodes.Size() == 1) { - int newtop = (200 - totalheight + topy) / 2; + int newtop = (200 - totalheight) / 2; int topdelta = newtop - topy; if (topdelta < 0) { @@ -1162,7 +1162,8 @@ void M_StartupEpisodeMenu(FNewGameStartup *gs) { ld->mItems[i]->OffsetPositionY(topdelta); } - posy -= topdelta; + posy += topdelta; + ld->mYpos += topdelta; } if (!isOld) ld->mSelectedItem = ld->mItems.Size(); @@ -1751,7 +1752,7 @@ void M_StartupSkillMenu(FNewGameStartup *gs) if (totalheight < 190 || MenuSkills.Size() == 1) { - int newtop = (200 - totalheight + topy) / 2; + int newtop = (200 - totalheight) / 2; int topdelta = newtop - topy; if (topdelta < 0) { @@ -1759,7 +1760,7 @@ void M_StartupSkillMenu(FNewGameStartup *gs) { ld->mItems[i]->OffsetPositionY(topdelta); } - ld->mYpos = y = posy - topdelta; + ld->mYpos = y = posy + topdelta; } } else