Ejemplo n.º 1
0
        private void frmSelectCyberwareSuite_Load(object sender, EventArgs e)
        {
            foreach (Label objLabel in Controls.OfType <Label>())
            {
                if (objLabel.Text.StartsWith('['))
                {
                    objLabel.Text = string.Empty;
                }
            }

            if (_objCharacter.DEPEnabled)
            {
                return;
            }

            XmlNodeList   objXmlSuiteList = _objXmlDocument.SelectNodes("/chummer/suites/suite");
            IList <Grade> lstGrades       = CommonFunctions.GetGradeList(_objSource, _objCharacter.Options);

            foreach (XmlNode objXmlSuite in objXmlSuiteList)
            {
                string strGrade = objXmlSuite["grade"]?.InnerText ?? string.Empty;
                if (string.IsNullOrEmpty(strGrade) && (!lstGrades.Any(x => x.Name == strGrade) ||
                                                       _objCharacter.Improvements.Any(x => ((_objSource == Improvement.ImprovementSource.Cyberware && x.ImproveType == Improvement.ImprovementType.DisableBiowareGrade) || (_objSource == Improvement.ImprovementSource.Bioware && x.ImproveType == Improvement.ImprovementType.DisableCyberwareGrade)) &&
                                                                                      strGrade.Contains(x.ImprovedName) && x.Enabled)))
                {
                    continue;
                }
                lstCyberware.Items.Add(objXmlSuite["name"].InnerText);
            }
        }