- Added Gez's actor replacement per skill submission.

SVN r1681 (trunk)
This commit is contained in:
Christoph Oelckers 2009-06-26 17:17:52 +00:00
commit 5a80938b11
5 changed files with 103 additions and 9 deletions

View file

@ -70,6 +70,8 @@ void FMapInfoParser::ParseSkill ()
skill.MustConfirm = false;
skill.Shortcut = 0;
skill.TextColor = "";
skill.Replace.Clear();
skill.Replaced.Clear();
sc.MustGetString();
skill.Name = sc.String;
@ -159,6 +161,17 @@ void FMapInfoParser::ParseSkill ()
sc.MustGetNumber ();
skill.ACSReturn = sc.Number;
}
else if (sc.Compare("ReplaceActor"))
{
ParseAssign();
sc.MustGetString();
FName replaced = sc.String;
ParseComma();
sc.MustGetString();
FName replacer = sc.String;
skill.SetReplacement(replaced, replacer);
skill.SetReplacedBy(replacer, replaced);
}
else if (sc.Compare("Name"))
{
ParseAssign();
@ -338,6 +351,8 @@ FSkillInfo &FSkillInfo::operator=(const FSkillInfo &other)
MustConfirmText = other.MustConfirmText;
Shortcut = other.Shortcut;
TextColor = other.TextColor;
Replace = other.Replace;
Replaced = other.Replaced;
return *this;
}
@ -363,3 +378,48 @@ int FSkillInfo::GetTextColor() const
return color;
}
//==========================================================================
//
// FSkillInfo::SetReplacement
//
//==========================================================================
void FSkillInfo::SetReplacement(FName a, FName b)
{
Replace[a] = b;
}
//==========================================================================
//
// FSkillInfo::GetReplacement
//
//==========================================================================
FName FSkillInfo::GetReplacement(FName a)
{
if (Replace.CheckKey(a)) return Replace[a];
else return NAME_None;
}
//==========================================================================
//
// FSkillInfo::SetReplaced
//
//==========================================================================
void FSkillInfo::SetReplacedBy(FName b, FName a)
{
Replaced[b] = a;
}
//==========================================================================
//
// FSkillInfo::GetReplaced
//
//==========================================================================
FName FSkillInfo::GetReplacedBy(FName b)
{
if (Replaced.CheckKey(b)) return Replaced[b];
else return NAME_None;
}