- fixed: The menu should not override the user's player class if there is no player class menu.

SVN r2798 (trunk)
This commit is contained in:
Christoph Oelckers 2010-09-16 16:20:39 +00:00
commit 4da5ce74ca
3 changed files with 10 additions and 6 deletions

View file

@ -1006,7 +1006,14 @@ static void BuildPlayerclassMenu()
// center the menu on the screen if the top space is larger than the bottom space
int totalheight = posy + (numclassitems+1) * ld->mLinespacing - topy;
if (totalheight <= 190 || numclassitems == 1)
if (numclassitems <= 1)
{
// create a dummy item that auto-chooses the default class.
FListMenuItemText *it = new FListMenuItemText(0, 0, 0, 'p', "player",
ld->mFont,ld->mFontColor, NAME_Episodemenu, -1000);
ld->mAutoselect = 0;
}
else if (totalheight <= 190)
{
int newtop = (200 - totalheight + topy) / 2;
int topdelta = newtop - topy;
@ -1051,10 +1058,6 @@ static void BuildPlayerclassMenu()
ld->mItems.Push(it);
}
}
if (n < 2)
{
ld->mAutoselect = ld->mSelectedItem;
}
success = true;
}
}