mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- 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:
parent
09da387689
commit
4da5ce74ca
3 changed files with 10 additions and 6 deletions
|
@ -233,7 +233,7 @@ void G_DeferedInitNew (const char *mapname, int newskill)
|
|||
|
||||
void G_DeferedInitNew (FGameStartup *gs)
|
||||
{
|
||||
playerclass = gs->PlayerClass;
|
||||
if (gs->PlayerClass != NULL) playerclass = gs->PlayerClass;
|
||||
d_mapname = AllEpisodes[gs->Episode].mEpisodeMap;
|
||||
d_skill = gs->Skill;
|
||||
CheckWarpTransMap (d_mapname, true);
|
||||
|
|
|
@ -350,6 +350,7 @@ void M_SetMenu(FName menu, int param)
|
|||
GameStartupInfo.Skill = -1;
|
||||
GameStartupInfo.Episode = -1;
|
||||
GameStartupInfo.PlayerClass =
|
||||
param == -1000? NULL :
|
||||
param == -1? "Random" : PlayerClasses[param].Type->Meta.GetMetaString (APMETA_DisplayName);
|
||||
break;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue