mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
- 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
|
@ -1,4 +1,10 @@
|
|||
July 22, 2009
|
||||
- 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.
|
||||
- Slider controls in the options menu now display their values
|
||||
numerically next to the slider.
|
||||
- The minimum value for m_yaw, m_pitch, m_forward, and m_side from the
|
||||
|
|
|
@ -580,6 +580,7 @@ struct FSkillInfo
|
|||
};
|
||||
|
||||
extern TArray<FSkillInfo> AllSkills;
|
||||
extern int DefaultSkill;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1851,6 +1851,7 @@ void FMapInfoParser::ParseMapInfo (int lump, level_info_t &gamedefaults, level_i
|
|||
else if (sc.Compare("clearskills"))
|
||||
{
|
||||
AllSkills.Clear();
|
||||
DefaultSkill = -1;
|
||||
}
|
||||
else if (sc.Compare("gameinfo"))
|
||||
{
|
||||
|
@ -1908,7 +1909,7 @@ void G_ParseMapInfo (const char *basemapinfo)
|
|||
{
|
||||
I_FatalError ("You cannot use clearepisodes in a MAPINFO if you do not define any new episodes after it.");
|
||||
}
|
||||
if (AllSkills.Size()==0)
|
||||
if (AllSkills.Size() == 0)
|
||||
{
|
||||
I_FatalError ("You cannot use clearskills in a MAPINFO if you do not define any new skills after it.");
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "v_font.h"
|
||||
|
||||
TArray<FSkillInfo> AllSkills;
|
||||
int DefaultSkill = -1;
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
@ -52,6 +53,8 @@ TArray<FSkillInfo> AllSkills;
|
|||
void FMapInfoParser::ParseSkill ()
|
||||
{
|
||||
FSkillInfo skill;
|
||||
bool thisisdefault = false;
|
||||
bool acsreturnisset = false;
|
||||
|
||||
skill.AmmoFactor = FRACUNIT;
|
||||
skill.DoubleAmmoFactor = 2*FRACUNIT;
|
||||
|
@ -65,7 +68,7 @@ void FMapInfoParser::ParseSkill ()
|
|||
skill.RespawnLimit = 0;
|
||||
skill.Aggressiveness = FRACUNIT;
|
||||
skill.SpawnFilter = 0;
|
||||
skill.ACSReturn = AllSkills.Size();
|
||||
skill.ACSReturn = 0;
|
||||
skill.MenuNameIsLump = false;
|
||||
skill.MustConfirm = false;
|
||||
skill.Shortcut = 0;
|
||||
|
@ -163,6 +166,7 @@ void FMapInfoParser::ParseSkill ()
|
|||
ParseAssign();
|
||||
sc.MustGetNumber ();
|
||||
skill.ACSReturn = sc.Number;
|
||||
acsreturnisset = true;
|
||||
}
|
||||
else if (sc.Compare("ReplaceActor"))
|
||||
{
|
||||
|
@ -245,6 +249,14 @@ void FMapInfoParser::ParseSkill ()
|
|||
{
|
||||
skill.NoPain = true;
|
||||
}
|
||||
else if (sc.Compare("DefaultSkill"))
|
||||
{
|
||||
if (DefaultSkill >= 0)
|
||||
{
|
||||
sc.ScriptError("%s is already the default skill\n", AllSkills[DefaultSkill].Name.GetChars());
|
||||
}
|
||||
thisisdefault = true;
|
||||
}
|
||||
else if (!ParseCloseBrace())
|
||||
{
|
||||
// Unknown
|
||||
|
@ -261,10 +273,26 @@ void FMapInfoParser::ParseSkill ()
|
|||
{
|
||||
if (AllSkills[i].Name == skill.Name)
|
||||
{
|
||||
if (!acsreturnisset)
|
||||
{ // Use the ACS return for the skill we are overwriting.
|
||||
skill.ACSReturn = AllSkills[i].ACSReturn;
|
||||
}
|
||||
AllSkills[i] = skill;
|
||||
if (thisisdefault)
|
||||
{
|
||||
DefaultSkill = i;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!acsreturnisset)
|
||||
{
|
||||
skill.ACSReturn = AllSkills.Size();
|
||||
}
|
||||
if (thisisdefault)
|
||||
{
|
||||
DefaultSkill = AllSkills.Size();
|
||||
}
|
||||
AllSkills.Push(skill);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,6 @@
|
|||
|
||||
extern void LoadActors ();
|
||||
|
||||
extern TArray<FSkillInfo> AllSkills;
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
gameinfo
|
||||
{
|
||||
titlepage = "TITLEPIC"
|
||||
|
@ -59,6 +58,7 @@ skill normal
|
|||
SpawnFilter = Normal
|
||||
PicName = "M_HURT"
|
||||
Key = "h"
|
||||
DefaultSkill
|
||||
}
|
||||
|
||||
skill hard
|
||||
|
@ -79,4 +79,3 @@ skill nightmare
|
|||
MustConfirm
|
||||
Key = "n"
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ skill normal
|
|||
DoubleAmmoFactor = 1.5
|
||||
SpawnFilter = Normal
|
||||
Name = "$MNU_BRINGEST"
|
||||
DefaultSkill
|
||||
}
|
||||
|
||||
skill hard
|
||||
|
|
|
@ -67,6 +67,7 @@ skill normal
|
|||
playerclassname = "fighter", "$MNU_WARRIOR"
|
||||
playerclassname = "cleric", "$MNU_PRIEST"
|
||||
playerclassname = "mage", "$MNU_SORCERER"
|
||||
DefaultSkill
|
||||
}
|
||||
|
||||
skill hard
|
||||
|
|
|
@ -59,6 +59,7 @@ skill normal
|
|||
SpawnFilter = Normal
|
||||
PicName = "M_HURT"
|
||||
Key = "v"
|
||||
DefaultSkill
|
||||
}
|
||||
|
||||
skill hard
|
||||
|
|
Loading…
Reference in a new issue