Skip to content

Commit

Permalink
- fixed space calculations for oversized episode and skill menus.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed May 25, 2020
1 parent 3b65b0c commit 233d0b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/menu/menudef.cpp
Expand Up @@ -1154,15 +1154,16 @@ 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)
{
for(unsigned i = 0; i < ld->mItems.Size(); i++)
{
ld->mItems[i]->OffsetPositionY(topdelta);
}
posy -= topdelta;
posy += topdelta;
ld->mYpos += topdelta;
}

if (!isOld) ld->mSelectedItem = ld->mItems.Size();
Expand Down Expand Up @@ -1751,15 +1752,15 @@ 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)
{
for(unsigned i = 0; i < ld->mItems.Size(); i++)
{
ld->mItems[i]->OffsetPositionY(topdelta);
}
ld->mYpos = y = posy - topdelta;
ld->mYpos = y = posy + topdelta;
}
}
else
Expand Down

0 comments on commit 233d0b6

Please sign in to comment.