private Guid GetSlotId()
        {
            Guid   treeId;
            Guid   slotId;
            string slotName;
            string slotIndexString;
            int    startLoc = 0;
            int    index    = -1;
            string tempName;

            slotName = "";
            treeId   = EnhancementTreeModel.GetIdFromTreeName(comboTree.SelectedItem.ToString());
            if (comboCategory.SelectedItem.ToString() == "EnhancementSlot")
            {
                slotName = comboApplyTo.SelectedItem.ToString();
            }
            if (comboCategory.SelectedItem.ToString() == "Enhancement")
            {
                slotName = comboSlot.SelectedItem.ToString();
            }
            tempName        = slotName.Remove(0, 5);
            startLoc        = tempName.IndexOf(":: ");
            slotIndexString = tempName.Remove(startLoc);
            index           = Int32.Parse(slotIndexString);
            slotId          = EnhancementSlotModel.GetIdFromTreeIdandSlotIndex(treeId, index);
            return(slotId);
        }
        private void comboTree_SelectedIndexChanged(object sender, EventArgs e)
        {
            Guid treeId;
            List <EnhancementSlotModel> slotModels;

            if (e.ToString() != "")
            {
                treeId = EnhancementTreeModel.GetIdFromTreeName(comboTree.SelectedItem.ToString());

                slotModels = EnhancementSlotModel.GetAll(treeId);
                if (comboCategory.SelectedItem.ToString() == "Enhancement")
                {
                    comboSlot.Items.Clear();
                    foreach (EnhancementSlotModel model in slotModels)
                    {
                        comboSlot.Items.Add(BuildSlotName(model));
                    }
                    comboApplyTo.Items.Clear();
                }
                else
                {
                    comboApplyTo.Items.Clear();
                    foreach (EnhancementSlotModel model in slotModels)
                    {
                        comboApplyTo.Items.Add(BuildSlotName(model));
                    }
                }
            }
            buttonOk.Enabled = false;
        }
Ejemplo n.º 3
0
        private void TreeComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            Guid treeId;
            List <EnhancementSlotModel> slotModels;

            if (e.ToString() != "")
            {
                treeId = EnhancementTreeModel.GetIdFromTreeName(TreeComboBox.SelectedItem.ToString());
                //Lets pull slot data for the tree Selected
                slotModels = EnhancementSlotModel.GetAll(treeId);

                if (CategoryComboBox.SelectedItem.ToString() == "Enhancement")
                {
                    SlotComboBox.Items.Clear();
                    foreach (EnhancementSlotModel model in slotModels)
                    {
                        SlotComboBox.Items.Add("Slot " + model.SlotIndex.ToString() + ": " + GetSlotName(model));
                    }
                    ApplyToComboBox.Items.Clear();
                }
                else
                {
                    ApplyToComboBox.Items.Clear();
                    foreach (EnhancementSlotModel model in slotModels)
                    {
                        ApplyToComboBox.Items.Add("Slot " + model.SlotIndex.ToString() + ": " + GetSlotName(model));
                    }
                }
                UpdateNameField();
            }
        }
Ejemplo n.º 4
0
        private void SlotComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <EnhancementModel> enhancementModels;
            Guid slotId;
            Guid treeId;

            if (e.ToString() != "")
            {
                treeId = EnhancementTreeModel.GetIdFromTreeName(TreeComboBox.SelectedItem.ToString());
                slotId = EnhancementSlotModel.GetIdFromTreeIdandSlotIndex(treeId, GetSlotIndex(SlotComboBox.SelectedItem.ToString()));
                //lets pull the enhancement data for the selected slot
                enhancementModels = EnhancementModel.GetAll(slotId);

                ApplyToComboBox.Items.Clear();
                foreach (EnhancementModel model in enhancementModels)
                {
                    ApplyToComboBox.Items.Add("Pos " + model.DisplayOrder.ToString() + ": " + model.Name);
                }

                UpdateNameField();
            }
        }
Ejemplo n.º 5
0
        private void AddNewRequirementRecord()
        {
            RequirementModel model;
            string           categoryName;
            string           applyToName;
            string           treeName;
            Guid             treeId;
            Guid             slotId;
            Guid             enhancementId;

            treeName     = "";
            model        = new RequirementModel();
            categoryName = CategoryComboBox.SelectedItem.ToString();
            applyToName  = ApplyToComboBox.SelectedItem.ToString();
            if (categoryName == "Enhancement" || categoryName == "EnhancementSlot")
            {
                treeName = TreeComboBox.SelectedItem.ToString();
            }

            model.Initialize(Guid.Empty);
            model.TableNamesId = TableNamesModel.GetIdFromTableName(categoryName);
            if (categoryName == "Ability")
            {
                model.ApplytoId = AbilityModel.GetIdFromName(applyToName);
            }
            if (categoryName == "Attribute")
            {
                model.ApplytoId = AttributeModel.GetIdFromName(applyToName);
            }
            if (categoryName == "Class")
            {
                model.ApplytoId = ClassModel.GetIdFromName(applyToName);
            }
            if (categoryName == "Enhancement")
            {
                treeId          = EnhancementTreeModel.GetIdFromTreeName(treeName);
                slotId          = EnhancementSlotModel.GetIdFromTreeIdandSlotIndex(treeId, GetSlotIndex(SlotComboBox.SelectedItem.ToString()));
                enhancementId   = EnhancementModel.GetIdFromSlotIdandDisplayOrder(slotId, GetDisplayOrder(ApplyToComboBox.SelectedItem.ToString()));
                model.ApplytoId = enhancementId;
            }
            if (categoryName == "EnhancementSlot")
            {
                treeId          = EnhancementTreeModel.GetIdFromTreeName(treeName);
                slotId          = EnhancementSlotModel.GetIdFromTreeIdandSlotIndex(treeId, GetSlotIndex(ApplyToComboBox.SelectedItem.ToString()));
                model.ApplytoId = slotId;
            }
            if (categoryName == "Feat")
            {
                model.ApplytoId = FeatModel.GetIdFromName(applyToName);
            }
            if (categoryName == "Race")
            {
                model.ApplytoId = RaceModel.GetIdFromName(applyToName);
            }
            if (categoryName == "Skill")
            {
                model.ApplytoId = SkillModel.GetIdFromName(applyToName);
            }

            model.Name = NameTextBox.Text;
            model.Save();
            NewRequirementId = model.Id;
        }