- Fixed: Redefining an existing skill would set that skills ACSReturn to be
the same as the next new skill defined, if neither definition explicitly set the value for ACSReturn. - Added a DefaultSkill property. Adding it to a skill will cause that skill to be the default one selected in the menu. If none is specified as the default, then the middle skill is the default. SVN r1731 (trunk)
This commit is contained in:
parent
dba34d0761
commit
8a2e03c9cb
10 changed files with 64 additions and 12 deletions
|
|
@ -418,19 +418,19 @@ static oldmenuitem_t SkillSelectMenu[]={
|
|||
static oldmenu_t SkillDef =
|
||||
{
|
||||
0,
|
||||
SkillSelectMenu, // oldmenuitem_t ->
|
||||
SkillSelectMenu, // oldmenuitem_t ->
|
||||
M_DrawNewGame, // drawing routine ->
|
||||
48,63, // x,y
|
||||
2 // lastOn
|
||||
-1 // lastOn
|
||||
};
|
||||
|
||||
static oldmenu_t HexenSkillMenu =
|
||||
{
|
||||
0,
|
||||
SkillSelectMenu, // oldmenuitem_t ->
|
||||
SkillSelectMenu,
|
||||
DrawHexenSkillMenu,
|
||||
120, 44,
|
||||
2
|
||||
-1
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -453,7 +453,7 @@ void M_StartupSkillMenu(const char *playerclass)
|
|||
}
|
||||
}
|
||||
SkillDef.numitems = HexenSkillMenu.numitems = 0;
|
||||
for(unsigned int i=0;i<AllSkills.Size() && i<8;i++)
|
||||
for(unsigned int i = 0; i < AllSkills.Size() && i < 8; i++)
|
||||
{
|
||||
FSkillInfo &skill = AllSkills[i];
|
||||
|
||||
|
|
@ -477,13 +477,30 @@ void M_StartupSkillMenu(const char *playerclass)
|
|||
SkillDef.numitems++;
|
||||
HexenSkillMenu.numitems++;
|
||||
}
|
||||
int defskill = DefaultSkill;
|
||||
if ((unsigned int)defskill >= AllSkills.Size())
|
||||
{
|
||||
defskill = (AllSkills.Size() - 1) / 2;
|
||||
}
|
||||
// The default skill is only set the first time the menu is opened.
|
||||
// After that, it opens on whichever skill you last selected.
|
||||
if (SkillDef.lastOn < 0)
|
||||
{
|
||||
SkillDef.lastOn = defskill;
|
||||
}
|
||||
if (HexenSkillMenu.lastOn < 0)
|
||||
{
|
||||
HexenSkillMenu.lastOn = defskill;
|
||||
}
|
||||
// Hexen needs some manual coordinate adjustments based on player class
|
||||
if (gameinfo.gametype == GAME_Hexen)
|
||||
{
|
||||
M_SetupNextMenu(&HexenSkillMenu);
|
||||
}
|
||||
else
|
||||
{
|
||||
M_SetupNextMenu(&SkillDef);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1629,7 +1646,6 @@ void M_NewGame(int choice)
|
|||
{
|
||||
M_StartupSkillMenu(NULL);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue