Exemplo n.º 1
0
        private void CreateContentTab(string name, BaseEditorControl control)
        {
            tabContent.SuspendLayout();
            var newPage = new TabPage(name)
            {
                Padding = new Padding(6, 6, 6, 6)
            };

            newPage.Controls.Add(control);

            // This works around a bug it seems.
            // You can't set the ImageKey property of a dynamic tab.
            // Yet you can set the ImageIndex
            var keyIndex = 0;

            if (EditorFactory.Builders.ContainsKey(control.SystemType))
            {
                keyIndex = tabContent.ImageList.Images.IndexOfKey(EditorFactory.Builders[control.SystemType].DisplayName);
            }
            newPage.ImageIndex = keyIndex;

            control.Dock = DockStyle.Fill;
            tabContent.TabPages.Add(newPage);
            tabContent.SelectedTab = newPage;
            tabContent.ResumeLayout(true);

            control.DirtyChanged += EditorControlDirtyChanged;
        }
Exemplo n.º 2
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_magicalnode_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_magicalnode_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_magicalnode_map");
            }

            Database.updateData("item_magicalnode_map", "item_magicalnode_map_id", mItemMapId, "tag_def_id", (cboElementType.SelectedItem as SystemTag).Value);
            Database.updateData("item_magicalnode_map", "item_magicalnode_map_id", mItemMapId, "effect_time", (int)numAuraTime.Value);
            Database.updateData("item_magicalnode_map", "item_magicalnode_map_id", mItemMapId, "effect_def_id", BaseEditorControl.getContentLinkId(linkAuraEffect));
        }
        public override void saveEffectData(int aDefId)
        {
            Database.deleteData("effect_healthchange_map", "effect_def_id", aDefId);

            mEffectMapId = Database.createData("effect_healthchange_map", "effect_def_id", aDefId, null, null);
            if (mEffectMapId == 0)
            {
                throw new Exception("Failed to create new row in effect_healthchange_map");
            }

            Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "resist_statistic_def_id", BaseEditorControl.getContentLinkId(linkResistStat));
            Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "health_change_min", (int)numHealthMin.Value);
            Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "health_change_max", (int)numHealthMax.Value);
            Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "health_change_bonus", (int)numHealthBonus.Value);

            if (rdoDamage.Checked)
            {
                Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "health_change_type_id", Globals.HEALTH_CHANGE_TYPE_Damage);
            }
            else if (rdoHeal.Checked)
            {
                Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "health_change_type_id", Globals.HEALTH_CHANGE_TYPE_Heal);
            }
            else if (rdoSteal.Checked)
            {
                Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "health_change_type_id", Globals.HEALTH_CHANGE_TYPE_Steal);
            }
            else
            {
                Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "health_change_type_id", Globals.HEALTH_CHANGE_TYPE_Resurrect);
            }

            Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "onfail_effect_def_id", BaseEditorControl.getContentLinkId(linkOnFail));
            Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "onresist_effect_def_id", BaseEditorControl.getContentLinkId(linkOnResist));
            Database.updateData("effect_healthchange_map", "effect_healthchange_map_id", mEffectMapId, "ref_damage_type_id", (cboDamage.SelectedItem as TagInfo).Id);
        }
Exemplo n.º 4
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_weapon_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_weapon_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_weapon_map");
            }

            Database.updateData("item_weapon_map", "item_weapon_map_id", mItemMapId, "effect_def_id", BaseEditorControl.getContentLinkId(linkEffect));
            Database.updateData("item_weapon_map", "item_weapon_map_id", mItemMapId, "ref_weapon_type_id", (cboWeaponType.SelectedItem as TagInfo).Id);
            Database.updateData("item_weapon_map", "item_weapon_map_id", mItemMapId, "ref_speed_class_id", (cboWeaponSpeed.SelectedItem as TagInfo).Id);

            int flags =
                (chkIsThrowable.Checked ? Globals.WEAPON_FLAG_Throwable : 0);

            Database.updateData("item_weapon_map", "item_weapon_map_id", mItemMapId, "flags", flags);
        }
Exemplo n.º 5
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_book_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_book_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_book_map");
            }

            Database.updateData("item_book_map", "item_book_map_id", mItemMapId, "ability_def_id", BaseEditorControl.getContentLinkId(linkAbility));

            int i = 0;

            foreach (BookPage bookPage in mPages)
            {
                int rowId = Database.createData("item_book_page_map", "item_def_id", aDefId, null, null);
                if (rowId == 0)
                {
                    throw new Exception("Failed to create new row in item_book_page_map");
                }

                Database.updateData("item_book_page_map", "item_book_page_map_id", rowId, "page_text", bookPage.page_text);
                Database.updateData("item_book_page_map", "item_book_page_map_id", rowId, "page_number", i++);
            }
        }
Exemplo n.º 6
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_light_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_light_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_light_map");
            }

            int fuelTypeId = (cboFuelType.SelectedItem as TagInfo).Id;

            Database.updateData("item_light_map", "item_light_map_id", mItemMapId, "ref_fuel_type_id", fuelTypeId);
            if (fuelTypeId == Globals.FUEL_TYPE_Solid)
            {
                Database.updateData("item_light_map", "item_light_map_id", mItemMapId, "solid_fuel_burn_time", (int)numBurnTime.Value);
            }
            else if (fuelTypeId == Globals.FUEL_TYPE_Liquid)
            {
                Database.updateData("item_light_map", "item_light_map_id", mItemMapId, "liquid_fuel_def_id", BaseEditorControl.getContentLinkId(linkLiquidFuel));
                Database.updateData("item_light_map", "item_light_map_id", mItemMapId, "liquid_fuel_burn_rate", (int)numBurnRate.Value);
                Database.updateData("item_light_map", "item_light_map_id", mItemMapId, "liquid_fuel_max_charges", (int)numMaxCharges.Value);
            }
        }
Exemplo n.º 7
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_lock_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_lock_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_lock_map");
            }

            Database.updateData("item_lock_map", "item_lock_map_id", mItemMapId, "pick_statistic_def_id", BaseEditorControl.getContentLinkId(linkPickSkill));
            Database.updateData("item_lock_map", "item_lock_map_id", mItemMapId, "ref_difficulty_id", (cboDifficulty.SelectedItem as TagInfo).Id);

            int flags =
                (chkIsRelockable.Checked ? Globals.LOCK_FLAG_Relockable : 0);

            Database.updateData("item_lock_map", "item_lock_map_id", mItemMapId, "flags", flags);
            Database.updateData("item_lock_map", "item_lock_map_id", mItemMapId, "key_item_def_id", BaseEditorControl.getContentLinkId(linkKey));
        }
Exemplo n.º 8
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_portal_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_portal_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_portal_map");
            }

            Database.updateData("item_portal_map", "item_portal_map_id", mItemMapId, "destination_space_def_id", BaseEditorControl.getContentLinkId(linkDestination));

            int flags =
                (chkOnUse.Checked ? Globals.PORTAL_FLAG_OnUse : 0) |
                (chkOnEnter.Checked ? Globals.PORTAL_FLAG_OnEnter : 0);

            Database.updateData("item_portal_map", "item_portal_map_id", mItemMapId, "flags", flags);
        }
Exemplo n.º 9
0
        public override void saveEffectData(int aDefId)
        {
            Database.deleteData("effect_giveobject_map", "effect_def_id", aDefId);

            mEffectMapId = Database.createData("effect_giveobject_map", "effect_def_id", aDefId, null, null);
            if (mEffectMapId == 0)
            {
                throw new Exception("Failed to create new row in effect_giveobject_map");
            }

            if (radGiveAbility.Checked)
            {
                Database.updateData("effect_giveobject_map", "effect_giveobject_map_id", mEffectMapId, "give_ability_def_id", BaseEditorControl.getContentLinkId(linkGive));
            }
            else if (radGiveStat.Checked)
            {
                Database.updateData("effect_giveobject_map", "effect_giveobject_map_id", mEffectMapId, "give_statistic_def_id", BaseEditorControl.getContentLinkId(linkGive));
            }
            else if (radGiveItem.Checked)
            {
                Database.updateData("effect_giveobject_map", "effect_giveobject_map_id", mEffectMapId, "give_item_def_id", BaseEditorControl.getContentLinkId(linkGive));
            }
            else if (radGiveQuest.Checked)
            {
                Database.updateData("effect_giveobject_map", "effect_giveobject_map_id", mEffectMapId, "give_quest_def_id", BaseEditorControl.getContentLinkId(linkGive));
            }
            else if (radGiveRitual.Checked)
            {
                Database.updateData("effect_giveobject_map", "effect_giveobject_map_id", mEffectMapId, "give_ritual_def_id", BaseEditorControl.getContentLinkId(linkGive));
            }
        }
Exemplo n.º 10
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_treasure_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_treasure_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_treasure_map");
            }

            Database.updateData("item_treasure_map", "item_treasure_map_id", mItemMapId, "quantity", (int)numQuantity.Value);
            Database.updateData("item_treasure_map", "item_treasure_map_id", mItemMapId, "treasure_def_id", BaseEditorControl.getContentLinkId(linkTreasure));
        }
Exemplo n.º 11
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_potion_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_potion_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_potion_map");
            }

            Database.updateData("item_potion_map", "item_potion_map_id", mItemMapId, "charges", (int)numCharges.Value);
            Database.updateData("item_potion_map", "item_potion_map_id", mItemMapId, "ability_def_id", BaseEditorControl.getContentLinkId(linkAbility));
        }
Exemplo n.º 12
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_formula_resource_map", "item_def_id", aDefId);
            Database.deleteData("item_formula_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_formula_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_formula_map");
            }

            Database.updateData("item_formula_map", "item_formula_map_id", mItemMapId, "statistic_def_id", BaseEditorControl.getContentLinkId(linkSkill));
            Database.updateData("item_formula_map", "item_formula_map_id", mItemMapId, "min_skill", (int)numMinSkill.Value);
            Database.updateData("item_formula_map", "item_formula_map_id", mItemMapId, "product_item_def_id", BaseEditorControl.getContentLinkId(linkProduct));
            Database.updateData("item_formula_map", "item_formula_map_id", mItemMapId, "product_quantity", (int)numProductQty.Value);
            Database.updateData("item_formula_map", "item_formula_map_id", mItemMapId, "machine_item_def_id", BaseEditorControl.getContentLinkId(linkMachine));
            Database.updateData("item_formula_map", "item_formula_map_id", mItemMapId, "tool_item_def_id", BaseEditorControl.getContentLinkId(linkTool));
            Database.updateData("item_formula_map", "item_formula_map_id", mItemMapId, "xp_value", (int)numXpValue.Value);

            saveResourcesGrid(aDefId);
        }
Exemplo n.º 13
0
        public override void saveEffectData(int aDefId)
        {
            Database.deleteData("effect_spaceeffect_map", "effect_def_id", aDefId);

            mEffectMapId = Database.createData("effect_spaceeffect_map", "effect_def_id", aDefId, null, null);
            if (mEffectMapId == 0)
            {
                throw new Exception("Failed to create new row in effect_spaceeffect_map");
            }

            Database.updateData("effect_spaceeffect_map", "effect_spaceeffect_map_id", mEffectMapId, "space_effect_def_id", BaseEditorControl.getContentLinkId(linkSpaceEffect));
        }
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_drinkcontainer_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_drinkcontainer_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_drinkcontainer_map");
            }

            Database.updateData("item_drinkcontainer_map", "item_drinkcontainer_map_id", mItemMapId, "max_charges", (int)numCharges.Value);
            int flags =
                (chkIsCloseable.Checked ? Globals.CONTAINER_FLAG_Closeable : 0);

            Database.updateData("item_drinkcontainer_map", "item_drinkcontainer_map_id", mItemMapId, "flags", flags);
            Database.updateData("item_drinkcontainer_map", "item_drinkcontainer_map_id", mItemMapId, "liquid_def_id", BaseEditorControl.getContentLinkId(linkLiquid));
        }
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_container_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_container_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_container_map");
            }

            Database.updateData("item_container_map", "item_container_map_id", mItemMapId, "volume_allowance", (int)numVolume.Value);
            Database.updateData("item_container_map", "item_container_map_id", mItemMapId, "weight_allowance", (int)numWeight.Value);
            Database.updateData("item_container_map", "item_container_map_id", mItemMapId, "ref_size_id", (cboSize.SelectedItem as TagInfo).Id);

            int flags =
                (chkIsCloseable.Checked ? Globals.CONTAINER_FLAG_Closeable : 0) |
                (chkIsLockable.Checked ? Globals.CONTAINER_FLAG_Lockable : 0) |
                (chkIsLocked.Checked ? Globals.CONTAINER_FLAG_Locked : 0);

            Database.updateData("item_container_map", "item_container_map_id", mItemMapId, "flags", flags);
            Database.updateData("item_container_map", "item_container_map_id", mItemMapId, "lock_item_def_id", BaseEditorControl.getContentLinkId(linkLock));

            saveItemsGrid(aDefId);
        }
Exemplo n.º 16
0
        public override void saveItemData(int aDefId)
        {
            Database.deleteData("item_trap_map", "item_def_id", aDefId);

            mItemMapId = Database.createData("item_trap_map", "item_def_id", aDefId, null, null);
            if (mItemMapId == 0)
            {
                throw new Exception("Failed to create new row in item_trap_map");
            }

            Database.updateData("item_trap_map", "item_trap_map_id", mItemMapId, "disarm_statistic_def_id", BaseEditorControl.getContentLinkId(linkDisarmSkill));
            Database.updateData("item_trap_map", "item_trap_map_id", mItemMapId, "ref_difficulty_id", (cboDifficulty.SelectedItem as TagInfo).Id);
            Database.updateData("item_trap_map", "item_trap_map_id", mItemMapId, "ref_target_class_id", (cboTargetClass.SelectedItem as TagInfo).Id);

            int flags =
                (chkIsDestroyedOnUse.Checked ? Globals.TRAP_FLAG_DestroyedOnUse : 0) |
                (chkIsAreaNotifier.Checked ? Globals.TRAP_FLAG_AreaNotifier : 0);

            Database.updateData("item_trap_map", "item_trap_map_id", mItemMapId, "flags", flags);

            if (chkIsAreaNotifier.Checked)
            {
                Database.updateData("item_trap_map", "item_trap_map_id", mItemMapId, "notify_radius", (int)numNotifyRadius.Value);
            }
            Database.updateData("item_trap_map", "item_trap_map_id", mItemMapId, "space_effect_def_id", BaseEditorControl.getContentLinkId(linkSpaceEffect));
            Database.updateData("item_trap_map", "item_trap_map_id", mItemMapId, "effect_def_id", BaseEditorControl.getContentLinkId(linkEffect));
        }
        public override void saveEffectData(int aDefId)
        {
            Database.deleteData("effect_statmod_map", "effect_def_id", aDefId);

            mEffectMapId = Database.createData("effect_statmod_map", "effect_def_id", aDefId, null, null);
            if (mEffectMapId == 0)
            {
                throw new Exception("Failed to create new row in effect_statmod_map");
            }

            Database.updateData("effect_statmod_map", "effect_statmod_map_id", mEffectMapId, "stat_affected_def_id", BaseEditorControl.getContentLinkId(linkStatAffected));
            if (linkStatAffected.Text != "")
            {
                Database.updateData("effect_statmod_map", "effect_statmod_map_id", mEffectMapId, "stat_change_min", (int)numStatMin.Value);
                Database.updateData("effect_statmod_map", "effect_statmod_map_id", mEffectMapId, "stat_change_max", (int)numStatMax.Value);
            }
        }