本文整理汇总了C#中Chummer.SkillControl.AddSpec方法的典型用法代码示例。如果您正苦于以下问题:C# SkillControl.AddSpec方法的具体用法?C# SkillControl.AddSpec怎么用?C# SkillControl.AddSpec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chummer.SkillControl
的用法示例。
在下文中一共展示了SkillControl.AddSpec方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: cmdAddExoticSkill_Click
private void cmdAddExoticSkill_Click(object sender, EventArgs e)
{
frmSelectExoticSkill frmPickExoticSkill = new frmSelectExoticSkill();
frmPickExoticSkill.ShowDialog(this);
if (frmPickExoticSkill.DialogResult == DialogResult.Cancel)
return;
XmlDocument objXmlDocument = XmlManager.Instance.Load("skills.xml");
XmlNode nodSkill = objXmlDocument.SelectSingleNode("/chummer/skills/skill[name = \"" + frmPickExoticSkill.SelectedExoticSkill + "\"]");
int i = panActiveSkills.Controls.Count;
Skill objSkill = new Skill(_objCharacter);
objSkill.Attribute = nodSkill["attribute"].InnerText;
objSkill.Specialization = frmPickExoticSkill.SelectedExoticSkillSpecialisation;
if (_objCharacter.MaxSkillRating > 0)
objSkill.RatingMaximum = _objCharacter.MaxSkillRating;
SkillControl objSkillControl = new SkillControl(_objCharacter);
objSkillControl.SkillObject = objSkill;
objSkillControl.Width = 510;
// Attach an EventHandler for the RatingChanged and SpecializationChanged Events.
objSkillControl.RatingChanged += objActiveSkill_RatingChanged;
objSkillControl.SpecializationChanged += objSkill_SpecializationChanged;
objSkillControl.SkillName = frmPickExoticSkill.SelectedExoticSkill;
objSkillControl.BuyWithKarmaChanged += objActiveSkill_BuyWithKarmaChanged;
objSkillControl.SkillSpec = frmPickExoticSkill.SelectedExoticSkillSpecialisation;
objSkillControl.SkillCategory = nodSkill["category"].InnerText;
if (nodSkill["default"].InnerText == "Yes")
objSkill.Default = true;
else
objSkill.Default = false;
objSkill.ExoticSkill = true;
_objCharacter.Skills.Add(objSkill);
// Populate the Skill's Specializations (if any).
foreach (XmlNode objXmlSpecialization in nodSkill.SelectNodes("specs/spec"))
{
if (objXmlSpecialization.Attributes["translate"] != null)
objSkillControl.AddSpec(objXmlSpecialization.Attributes["translate"].InnerText);
else
objSkillControl.AddSpec(objXmlSpecialization.InnerText);
}
// Look through the Weapons file and grab the names of items that are part of the appropriate Exotic Category or use the matching Exoctic Skill.
XmlDocument objXmlWeaponDocument = XmlManager.Instance.Load("weapons.xml");
XmlNodeList objXmlWeaponList = objXmlWeaponDocument.SelectNodes("/chummer/weapons/weapon[category = \"" + frmPickExoticSkill.SelectedExoticSkill + "s\" or useskill = \"" + frmPickExoticSkill.SelectedExoticSkill + "\"]");
foreach (XmlNode objXmlWeapon in objXmlWeaponList)
{
if (objXmlWeapon["translate"] != null)
objSkillControl.AddSpec(objXmlWeapon["translate"].InnerText);
else
objSkillControl.AddSpec(objXmlWeapon["name"].InnerText);
}
if (_objCharacter.IgnoreRules)
{
objSkillControl.SkillRatingMaximum = 12;
}
else
{
objSkillControl.SkillRatingMaximum = 6;
}
// Set the SkillControl's Location since scrolling the Panel causes it to actually change the child Controls' Locations.
objSkillControl.Location = new Point(0, objSkillControl.Height * i + panActiveSkills.AutoScrollPosition.Y);
panActiveSkills.Controls.Add(objSkillControl);
_blnIsDirty = true;
UpdateWindowTitle();
}
示例2: frmCreate_Load
//.........这里部分代码省略.........
// Load the Skills information.
objXmlDocument = XmlManager.Instance.Load("skills.xml");
// Populate the Skills Controls.
XmlNodeList objXmlNodeList = objXmlDocument.SelectNodes("/chummer/skills/skill[" + _objCharacter.Options.BookXPath() + "]");
// Counter to keep track of the number of Controls that have been added to the Panel so we can determine their vertical positioning.
int i = -1;
foreach (Skill objSkill in _objCharacter.Skills)
{
if (!objSkill.KnowledgeSkill && !objSkill.ExoticSkill)
{
i++;
SkillControl objSkillControl = new SkillControl();
objSkillControl.SkillObject = objSkill;
// Attach an EventHandler for the RatingChanged and SpecializationChanged Events.
objSkillControl.RatingChanged += objActiveSkill_RatingChanged;
objSkillControl.SpecializationChanged += objSkill_SpecializationChanged;
objSkillControl.BreakGroupClicked += objSkill_BreakGroupClicked;
objSkillControl.SkillName = objSkill.Name;
objSkillControl.SkillCategory = objSkill.SkillCategory;
objSkillControl.SkillGroup = objSkill.SkillGroup;
objSkillControl.SkillRatingMaximum = objSkill.RatingMaximum;
objSkillControl.SkillRating = objSkill.Rating;
objSkillControl.SkillSpec = objSkill.Specialization;
XmlNode objXmlSkill = objXmlDocument.SelectSingleNode("/chummer/skills/skill[name = \"" + objSkill.Name + "\"]");
// Populate the Skill's Specializations (if any).
foreach (XmlNode objXmlSpecialization in objXmlSkill.SelectNodes("specs/spec"))
{
if (objXmlSpecialization.Attributes["translate"] != null)
objSkillControl.AddSpec(objXmlSpecialization.Attributes["translate"].InnerText);
else
objSkillControl.AddSpec(objXmlSpecialization.InnerText);
}
// Set the control's vertical position and add it to the Skills Panel.
objSkillControl.Top = i * objSkillControl.Height;
objSkillControl.Width = 510;
objSkillControl.AutoScroll = false;
panActiveSkills.Controls.Add(objSkillControl);
}
}
// Exotic Skills.
foreach (Skill objSkill in _objCharacter.Skills)
{
if (objSkill.ExoticSkill)
{
i++;
SkillControl objSkillControl = new SkillControl();
objSkillControl.SkillObject = objSkill;
// Attach an EventHandler for the RatingChanged and SpecializationChanged Events.
objSkillControl.RatingChanged += objActiveSkill_RatingChanged;
objSkillControl.SpecializationChanged += objSkill_SpecializationChanged;
objSkillControl.BreakGroupClicked += objSkill_BreakGroupClicked;
objSkillControl.SkillName = objSkill.Name;
objSkillControl.SkillCategory = objSkill.SkillCategory;
objSkillControl.SkillGroup = objSkill.SkillGroup;
objSkillControl.SkillRatingMaximum = objSkill.RatingMaximum;
objSkillControl.SkillRating = objSkill.Rating;
objSkillControl.SkillSpec = objSkill.Specialization;
示例3: frmCreate_Load
//.........这里部分代码省略.........
if (_objCharacter.BuildMethod == CharacterBuildMethod.Karma)
{
label8.Visible = false;
label14.Visible = false;
}
foreach (Skill objSkill in _objCharacter.Skills)
{
if (!objSkill.KnowledgeSkill && !objSkill.ExoticSkill)
{
i++;
SkillControl objSkillControl = new SkillControl(_objCharacter);
objSkillControl.SkillObject = objSkill;
// Attach an EventHandler for the RatingChanged and SpecializationChanged Events.
objSkillControl.RatingChanged += objActiveSkill_RatingChanged;
objSkillControl.BuyWithKarmaChanged += objActiveSkill_BuyWithKarmaChanged;
objSkillControl.SpecializationChanged += objSkill_SpecializationChanged;
objSkillControl.BreakGroupClicked += objSkill_BreakGroupClicked;
objSkillControl.SkillName = objSkill.Name;
objSkillControl.SkillCategory = objSkill.SkillCategory;
objSkillControl.SkillGroup = objSkill.SkillGroup;
objSkillControl.SkillRatingMaximum = objSkill.RatingMaximum;
objSkillControl.SkillRating = objSkill.Rating;
objSkillControl.SkillBase = objSkill.Base;
objSkillControl.SkillKarma = objSkill.Karma;
objSkillControl.SkillSpec = objSkill.Specialization;
XmlNode objXmlSkill = objXmlDocument.SelectSingleNode("/chummer/skills/skill[name = \"" + objSkill.Name + "\"]");
// Populate the Skill's Specializations (if any).
foreach (XmlNode objXmlSpecialization in objXmlSkill.SelectNodes("specs/spec"))
{
if (objXmlSpecialization.Attributes["translate"] != null)
objSkillControl.AddSpec(objXmlSpecialization.Attributes["translate"].InnerText);
else
objSkillControl.AddSpec(objXmlSpecialization.InnerText);
}
// Set the control's vertical position and add it to the Skills Panel.
objSkillControl.Top = i * objSkillControl.Height;
objSkillControl.Width = 510;
objSkillControl.AutoScroll = false;
panActiveSkills.Controls.Add(objSkillControl);
}
}
// Exotic Skills.
foreach (Skill objSkill in _objCharacter.Skills)
{
if (objSkill.ExoticSkill)
{
i++;
SkillControl objSkillControl = new SkillControl(_objCharacter);
objSkillControl.SkillObject = objSkill;
// Attach an EventHandler for the RatingChanged and SpecializationChanged Events.
objSkillControl.RatingChanged += objActiveSkill_RatingChanged;
objSkillControl.SpecializationChanged += objSkill_SpecializationChanged;
objSkillControl.BreakGroupClicked += objSkill_BreakGroupClicked;
objSkillControl.BuyWithKarmaChanged += objActiveSkill_BuyWithKarmaChanged;
objSkillControl.SkillName = objSkill.Name;
objSkillControl.SkillCategory = objSkill.SkillCategory;
objSkillControl.SkillGroup = objSkill.SkillGroup;
objSkillControl.SkillRatingMaximum = objSkill.RatingMaximum;
objSkillControl.SkillBase = objSkill.Base;
示例4: frmCareer_Load
//.........这里部分代码省略.........
List<ListItem> lstComplexFormSkills = new List<ListItem>();
// Populate the Skills Controls.
XmlNodeList objXmlNodeList = objXmlDocument.SelectNodes("/chummer/skills/skill[" + _objCharacter.Options.BookXPath() + "]");
// Counter to keep track of the number of Controls that have been added to the Panel so we can determine their vertical positioning.
int i = -1;
foreach (Skill objSkill in _objCharacter.Skills)
{
if (!objSkill.KnowledgeSkill && !objSkill.ExoticSkill)
{
i++;
SkillControl objSkillControl = new SkillControl();
objSkillControl.SkillObject = objSkill;
// Attach an EventHandler for the RatingChanged and SpecializationChanged Events.
objSkillControl.RatingChanged += objActiveSkill_RatingChanged;
objSkillControl.SpecializationChanged += objSkill_SpecializationChanged;
objSkillControl.SpecializationLeave += objSkill_SpecializationLeave;
objSkillControl.SkillKarmaClicked += objSkill_KarmaClicked;
objSkillControl.DiceRollerClicked += objSkill_DiceRollerClicked;
objSkillControl.SkillName = objSkill.Name;
objSkillControl.SkillCategory = objSkill.SkillCategory;
objSkillControl.SkillGroup = objSkill.SkillGroup;
objSkillControl.SkillRatingMaximum = objSkill.RatingMaximum;
objSkillControl.SkillRating = objSkill.Rating;
objSkillControl.SkillSpec = objSkill.Specialization;
XmlNode objXmlSkill = objXmlDocument.SelectSingleNode("/chummer/skills/skill[name = \"" + objSkill.Name + "\"]");
// Populate the Skill's Specializations (if any).
foreach (XmlNode objXmlSpecialization in objXmlSkill.SelectNodes("specs/spec"))
{
if (objXmlSpecialization.Attributes["translate"] != null)
objSkillControl.AddSpec(objXmlSpecialization.Attributes["translate"].InnerText);
else
objSkillControl.AddSpec(objXmlSpecialization.InnerText);
}
// Set the control's vertical position and add it to the Skills Panel.
objSkillControl.Width = 510;
objSkillControl.AutoScroll = false;
panActiveSkills.Controls.Add(objSkillControl);
// Determine if this Skill should be added to the list of Skills for Comlex Form Tests.
bool blnAddSkill = true;
if (objSkill.Attribute == "MAG" || objSkill.SkillCategory == "Magical Active")
blnAddSkill = false;
if (blnAddSkill)
{
ListItem objItem = new ListItem();
objItem.Value = objSkill.Name;
objItem.Name = objSkill.DisplayName;
lstComplexFormSkills.Add(objItem);
}
}
}
// Exotic Skills.
foreach (Skill objSkill in _objCharacter.Skills)
{
if (objSkill.ExoticSkill)
{
i++;
SkillControl objSkillControl = new SkillControl();
objSkillControl.SkillObject = objSkill;