Example #1
0
        /// <summary>
        /// Creates dynamic controls based on config file. The controls are applied to
        /// the parent item creation form passed to this object at construction.
        /// </summary>
        /// <param name="ic"></param>
        /// <param name="itemClass"></param>
        private void DynamicControlsSetup(ItemsConfig ic, string itemClass)
        {
            List <Control> InheritTabControls = new List <Control>(10);
            Positioner     post = new Positioner();

            List <Tag> itemDecls = ic.GetItemClassDecls();

            foreach (Tag t in itemDecls)
            {
                if (t.Attributes["id"] == itemClass)
                {
                    InheritTabControls = ic.GenerateControlsList(t.Value);
                }
            }

            //initialize all of the loaded custom controls
            Control controlRef = null;

            foreach (Control control in InheritTabControls)
            {
                post.AddControlBelow(this.InheritTab, controlRef, control);
                controlRef = control;
            }
            controlRef = null;
        }
Example #2
0
        public CreateArmorForm(ItemsConfig ic, string itemClass, IDomainModelAdapter domain)
        {
            InitializeComponent();

#if STELLARMASS
            this.SetWearLevel.Visible = true;
            this.SetWearLevel.Enabled = true;
#endif

            this.SetVendorType.CheckListStrings   = DeadSouls.Globals.DefinedLists.GetList("vendorTypes").ToArray();
            this.SetRestrictLimbs.EntryCollection = DeadSouls.Globals.DefinedLists.GetList("limbs").ToArray();
            this.SetProtections.KeyCollection     = DeadSouls.Globals.DefinedLists.GetList("damageTypes").ToArray();
            this.SetArmorType.ListTextCollection  = DeadSouls.Globals.DefinedLists.GetList("armorTypes").ToArray();

            CenterToParent();
            refDomain    = domain;
            this.Manager = new ItemViewManager(this, domain, this.OnFunctionControlUpdate, ItemLoadType.Armor);
            DynamicControlsSetup(ic, itemClass);
            ic.DisableListedFunctionControls(this, itemClass);
        }
Example #3
0
        public CreateItemForm(ItemsConfig ic, string itemClass, IDomainModelAdapter domain)
        {
            InitializeComponent();

#if STELLARMASS
            this.SetWieldLevel.Visible = true;
            this.SetWieldLevel.Enabled = true;
#endif
            CenterToParent();

            //this.SetDamageType.CheckListStrings = DeadSouls.Globals.DefinedLists.GetList("damageTypes").ToArray();
            this.SetInventory.KeyCollection       = domain.Inventory.ToArray();
            this.SetDamageType.CheckListStrings   = DeadSouls.Globals.DefinedLists.GetList("damageTypes").ToArray();
            this.SetWeaponType.ListTextCollection = DeadSouls.Globals.DefinedLists.GetList("weaponTypes").ToArray();
            this.SetVendorType.CheckListStrings   = DeadSouls.Globals.DefinedLists.GetList("vendorTypes").ToArray();


            refDomain    = domain;
            this.Manager = new ItemViewManager(this, domain, this.OnFunctionControlUpdate, ItemLoadType.Item);
            DynamicControlsSetup(ic, itemClass);
            ic.DisableListedFunctionControls(this, itemClass);
        }
Example #4
0
        public CreateNpcForm(ItemsConfig ic, string itemClass, IDomainModelAdapter domain)
        {
            InitializeComponent();

            //this.SetNativeLanguage.SelectedIndex = 0;
            this.comboStatRemove.DropDownStyle  = ComboBoxStyle.DropDownList;
            this.comboSkillRemove.DropDownStyle = ComboBoxStyle.DropDownList;
            this.comboStatAdd.DropDownStyle     = ComboBoxStyle.DropDownList;
            this.comboSkillAdd.DropDownStyle    = ComboBoxStyle.DropDownList;

            this.SetInventory.KeyCollection            = domain.Inventory.ToArray();
            this.SetRace.ListTextCollection            = DeadSouls.Globals.DefinedLists.GetList("races").ToArray();
            this.SetClass.ListTextCollection           = DeadSouls.Globals.DefinedLists.GetList("classes").ToArray();
            this.SetGender.ListTextCollection          = DeadSouls.Globals.DefinedLists.GetList("genders").ToArray();
            this.SetCurrency.KeyCollection             = DeadSouls.Globals.DefinedLists.GetList("currencies").ToArray();
            this.SetDefaultLanguage.ListTextCollection = DeadSouls.Globals.DefinedLists.GetList("languages").ToArray();
            this.SetNativeLanguage.ListTextCollection  = DeadSouls.Globals.DefinedLists.GetList("languages").ToArray();
            this.comboSkillAdd.Items.AddRange((object[])DeadSouls.Globals.DefinedLists.GetList("skills").ToArray());
            this.comboStatAdd.Items.AddRange((object[])DeadSouls.Globals.DefinedLists.GetList("stats").ToArray());
            this.comboLanguageAdd.Items.AddRange((object[])DeadSouls.Globals.DefinedLists.GetList("languages").ToArray());
            this.SetItemDropRates.KeyCollection = domain.Inventory.ToArray();

                        #if STELLARMASS
            this.groupInventoryDrops.Visible     = true;
            this.SetItemDropRates.Enabled        = true;
            this.SetDropInventoryOnDeath.Enabled = true;
                        #endif

            CenterToParent();

            refDomain    = domain;
            this.Manager = new ItemViewManager(this, domain, this.OnFunctionControlUpdate, ItemLoadType.Npc);
            DynamicControlsSetup(ic, itemClass);
            ic.DisableListedFunctionControls(this, itemClass);

            AddAction(FunctionCallId.SetAction, "SetAction", this.flowActions);
            AddAction(FunctionCallId.SetCombatAction, "SetCombatAction", this.flowCombatActions);
        }