示例#1
0
 private void PopulateRaceListBox()
 {
     RaceNames = RaceModel.GetNames();
     foreach (string name in RaceNames)
     {
         RaceListBox.Items.Add(name);
     }
 }
示例#2
0
 /// <summary>
 /// On initialization, preload the class names and set up an entry in the dictionary
 /// </summary>
 private void LoadRaceName()
 {
     RaceNames = RaceModel.GetNames();
     Races     = new SortedDictionary <string, RaceDataClass>();
     foreach (string name in RaceNames)
     {
         Races.Add(name, new RaceDataClass(name));
     }
 }
        private void comboCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            string categoryName;

            categoryName = comboCategory.SelectedItem.ToString();

            ApplyToNames.Clear();
            comboApplyTo.Items.Clear();
            comboTree.Items.Clear();
            //resize our form
            this.Size = new Size(DefaultWidth, DefaultHeight);
            //hide our optional controls
            labelTree.Visible = false;
            comboTree.Visible = false;
            labelSlot.Visible = false;
            comboSlot.Visible = false;

            if (categoryName == "Ability")
            {
                ApplyToNames      = AbilityModel.GetNames();
                labelApplyTo.Text = "Select an Ability";
            }

            else if (categoryName == "Alignments")
            {
                ApplyToNames      = AlignmentModel.GetNames();
                labelApplyTo.Text = "Select an Alignment";
            }
            else if (categoryName == "Attribute")
            {
                ApplyToNames      = AttributeModel.GetNames();
                labelApplyTo.Text = "Select an Attribute";
            }

            else if (categoryName == "Character")
            {
                ApplyToNames.Add("Level");
                labelApplyTo.Text = "Select Character Property";
            }

            else if (categoryName == "Class")
            {
                ApplyToNames      = ClassModel.GetNames();
                labelApplyTo.Text = "Select a Class";
            }

            else if (categoryName == "Enhancement")
            {
                //lets resie our form to make room for other controls
                this.Size         = new Size(DefaultWidth, DefaultHeight + 99);
                labelTree.Visible = true;
                comboTree.Visible = true;
                labelSlot.Visible = true;
                comboSlot.Visible = true;
                TreeNames         = EnhancementTreeModel.GetNames();
                foreach (string name in TreeNames)
                {
                    comboTree.Items.Add(name);
                }
                labelApplyTo.Text = "Select an Enhancement";
                buttonOk.Enabled  = false;
                return;
            }

            else if (categoryName == "EnhancementSlot")
            {
                //lets resize our form to make room for other controls
                this.Size         = new Size(DefaultWidth, DefaultHeight + 47);
                labelTree.Visible = true;
                comboTree.Visible = true;
                TreeNames         = EnhancementTreeModel.GetNames();
                foreach (string name in TreeNames)
                {
                    comboTree.Items.Add(name);
                }
                labelApplyTo.Text = "Select an Enhancement Slot";
                buttonOk.Enabled  = false;
                return;
            }

            else if (categoryName == "Feat")
            {
                ApplyToNames      = FeatModel.GetNames();
                labelApplyTo.Text = "Select a Feat";
            }

            else if (categoryName == "Race")
            {
                ApplyToNames      = RaceModel.GetNames();
                labelApplyTo.Text = "Select a Race";
            }

            else if (categoryName == "Skill")
            {
                ApplyToNames      = SkillModel.GetNames();
                labelApplyTo.Text = "Select a Skill";
            }

            else
            {
                Debug.WriteLine("Error: No category exists for the one selected. RequirementDialogClass : comboCategory_SelectedIndexChanged()");
                return;
            }

            foreach (string name in ApplyToNames)
            {
                comboApplyTo.Items.Add(name);
            }
            buttonOk.Enabled = false;
        }
示例#4
0
        private void CategoryComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string category;

            category = CategoryComboBox.SelectedItem.ToString();

            ApplyToNames.Clear();
            ApplyToComboBox.Items.Clear();
            TreeComboBox.Items.Clear();
            //Lets set the default size of our form
            this.Size = new Size(DefaultWidth, DefaultHeight);
            //Hide our optional controls
            TreeLabel.Visible    = false;
            TreeComboBox.Visible = false;
            SlotLabel.Visible    = false;
            SlotComboBox.Visible = false;

            if (category == "Ability")
            {
                ApplyToNames      = AbilityModel.GetNames();
                ApplyToLabel.Text = "Select an Ability";
            }

            else if (category == "Attribute")
            {
                ApplyToNames      = AttributeModel.GetNames();
                ApplyToLabel.Text = "Select an Attribute";
            }

            else if (category == "Class")
            {
                ApplyToNames      = ClassModel.GetNames();
                ApplyToLabel.Text = "Select a Class";
            }

            else if (category == "Enhancement")
            {
                //Lets resize our form to make room for other controls
                this.Size            = new Size(DefaultWidth + 100, DefaultHeight + 94);
                TreeLabel.Visible    = true;
                TreeComboBox.Visible = true;
                SlotLabel.Visible    = true;
                SlotComboBox.Visible = true;
                TreeNames            = EnhancementTreeModel.GetNames();
                foreach (string name in TreeNames)
                {
                    TreeComboBox.Items.Add(name);
                }
                ApplyToLabel.Text = "Select an Enhancement";
                UpdateNameField();
                return;
            }

            else if (category == "EnhancementSlot")
            {
                //Lets resize our form to make room for other controls
                this.Size            = new Size(DefaultWidth + 100, DefaultHeight + 42);
                TreeLabel.Visible    = true;
                TreeComboBox.Visible = true;
                TreeNames            = EnhancementTreeModel.GetNames();
                foreach (string name in TreeNames)
                {
                    TreeComboBox.Items.Add(name);
                }
                ApplyToLabel.Text = "Select An Enhancement Slot";
                UpdateNameField();
                return;
            }
            else if (category == "Feat")
            {
                ApplyToNames      = FeatModel.GetNames();
                ApplyToLabel.Text = "Select a Feat";
            }

            else if (category == "Race")
            {
                ApplyToNames      = RaceModel.GetNames();
                ApplyToLabel.Text = "Select a Race";
            }

            else if (category == "Skill")
            {
                ApplyToNames      = SkillModel.GetNames();
                ApplyToLabel.Text = "Select a Skill";
            }

            else
            {
                Debug.WriteLine("Error: No category exists for the one selected. NewRequirementDialogClass : CategoryComboBox_SelectedIndexChanged()");
                return;
            }

            foreach (string name in ApplyToNames)
            {
                ApplyToComboBox.Items.Add(name);
            }

            UpdateNameField();
        }