public override void initContentImpl(int aId)
        {
            DataTable dt = Database.getData("liquid_def", "liquid_def_id", aId, null);

            if (dt == null)
            {
                Program.MainForm.logError("Could not load Liquid [" + aId + "]");
                return;
            }
            if (dt.Rows.Count == 0)
            {
                Program.MainForm.logError("Could not load Liquid [" + aId + "]");
                return;
            }

            Program.MainForm.logInfo("Liquid loaded [" + aId + "]");
            DataRow dataRow = dt.Rows[0];

            txtSystemName.Text         = dataRow["system_name"].ToString();
            txtDisplayName.Text        = dataRow["display_name"].ToString();
            txtDisplayDescription.Text = dataRow["display_description"].ToString();
            numThirstPoints.Value      = (int)dataRow["thirst_points"];
            numDrunkPoints.Value       = (int)dataRow["drunk_points"];
            numCostPerCharge.Value     = Convert.ToDecimal(dataRow["cost_per_charge"]);

            ComboUtils.fillCombo(cboFlammability, "ref_flammability", "name", "ref_flammability_id", (int)dataRow["ref_flammability_id"]);
            ComboUtils.fillCombo(cboColor, "ref_color", "name", "ref_color_id", (int)dataRow["ref_color_id"]);

            dt.Dispose();
            ControlName = txtSystemName.Text;
        }
Example #2
0
        public override void loadItemData(int aDefId)
        {
            DataTable dt = Database.getData("item_magicalnode_map", "item_def_id", aDefId, null);

            if (dt == null)
            {
                return;
            }
            if (dt.Rows.Count == 0)
            {
                return;
            }
            DataRow dataRow = dt.Rows[0];

            mItemMapId = (int)dataRow["item_magicalnode_map_id"];
            ComboUtils.fillComboBox(cboElementType, "ElementTypeTags", (int)dataRow["tag_def_id"], string.Empty);

            if (dataRow["effect_time"] != DBNull.Value)
            {
                numAuraTime.Value = (int)dataRow["effect_time"];
            }
            if (dataRow["effect_def_id"] != DBNull.Value)
            {
                EditorFactory.setupLink(linkAuraEffect, EditorSystemType.Effect, Database.getNullableId(dataRow, "effect_def_id"));
            }
            dt.Dispose();
        }
Example #3
0
        private void loadNodesGrid(int aId)
        {
            gridNodes.Rows.Clear();

            DataTable dt = Database.getData("npc_node_map", "npc_def_id", aId, null);

            if (dt == null)
            {
                return;
            }
            foreach (DataRow rowView in dt.Rows)
            {
                int             gridIndex = gridNodes.Rows.Add();
                DataGridViewRow gridRow   = gridNodes.Rows[gridIndex];

                DataGridViewComboBoxCell cellState = gridRow.Cells["ref_npc_node_type_id"] as DataGridViewComboBoxCell;
                ComboUtils.fillComboCellWithRefTable(cellState, "ref_npc_node_type", "ref_npc_node_type_id", "name", Database.getNullableId(rowView, "ref_npc_node_type_id"));

                DataGridViewLinkCell cellItem = gridRow.Cells["item_def_id"] as DataGridViewLinkCell;
                cellItem.Value = EditorFactory.getBrowseInfo(EditorSystemType.Item, rowView, "item_def_id");

                gridRow.Tag = (int)rowView["npc_node_map_id"];
            }
            dt.Dispose();
        }
        public override void loadItemData(int aDefId)
        {
            DataTable dt = Database.getData("item_lock_map", "item_def_id", aDefId, null);

            if (dt == null)
            {
                return;
            }
            if (dt.Rows.Count == 0)
            {
                return;
            }
            DataRow dataRow = dt.Rows[0];

            mItemMapId = (int)dataRow["item_lock_map_id"];

            EditorFactory.setupLink(linkPickSkill, EditorSystemType.Statistic, (int)dataRow["pick_statistic_def_id"]);
            ComboUtils.fillCombo(cboDifficulty, "ref_difficulty", "name", "ref_difficulty_id", (int)dataRow["pick_difficulty_id"]);

            int flags = (int)dataRow["flags"];

            chkIsRelockable.Checked = ((flags & Globals.LOCK_FLAG_Relockable) != 0) ? true : false;

            EditorFactory.setupLink(linkKey, EditorSystemType.Item, Database.getNullableId(dataRow, "key_item_def_id"));
            dt.Dispose();
        }
        public override void loadItemData(int aDefId)
        {
            DataTable dt = Database.getData("item_light_map", "item_def_id", aDefId, null);

            if (dt == null)
            {
                return;
            }
            if (dt.Rows.Count == 0)
            {
                return;
            }
            DataRow dataRow = dt.Rows[0];

            mItemMapId = (int)dataRow["item_light_map_id"];

            //TagUtils.fillComboBox(cboFuelType, "FuelTypeTags", (int)dataRow["fuel_type_tag_def_id"], string.Empty);
            ComboUtils.fillCombo(cboFuelType, "ref_fuel_type", "name", "ref_fuel_type_id", (int)dataRow["ref_fuel_type_id"]);

            numBurnTime.Value = Database.getNullableId(dataRow, "solid_fuel_burn_time");
            EditorFactory.setupLink(linkLiquidFuel, EditorSystemType.Liquid, Database.getNullableId(dataRow, "liquid_fuel_def_id"));
            numMaxCharges.Value = Database.getNullableId(dataRow, "liquid_fuel_max_charges");
            numBurnRate.Value   = Database.getNullableId(dataRow, "liquid_fuel_burn_rate");
            dt.Dispose();
        }
Example #6
0
 private void initNodesGrid()
 {
     {
         DataGridViewComboBoxColumn col  = new DataGridViewComboBoxColumn();
         DataGridViewComboBoxCell   cell = new DataGridViewComboBoxCell();
         col.Name         = "ref_npc_node_type_id";
         col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         col.FillWeight   = 25;
         col.HeaderText   = "Node Type";
         col.CellTemplate = cell;
         ComboUtils.fillComboCellWithRefTable(cell, "ref_npc_node_type", "ref_npc_node_type_id", "name");
         col.ValueMember   = "Value";
         col.DisplayMember = "Name";
         gridNodes.Columns.Add(col);
     }
     {
         DataGridViewColumn        col  = new DataGridViewColumn();
         DataGridViewTypedLinkCell cell = new DataGridViewTypedLinkCell();
         cell.SystemType  = EditorSystemType.Item;
         col.Name         = "item_def_id";
         col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         col.FillWeight   = 100;
         col.HeaderText   = "Resource Node";
         col.CellTemplate = cell;
         gridNodes.Columns.Add(col);
     }
 }
Example #7
0
        private void loadResourcesGrid(int aDefId)
        {
            gridResources.Rows.Clear();

            DataTable dt = Database.getData("item_resource_node_map", "item_def_id", aDefId, null);

            if (dt == null)
            {
                return;
            }
            foreach (DataRow rowView in dt.Rows)
            {
                int             gridIndex = gridResources.Rows.Add();
                DataGridViewRow gridRow   = gridResources.Rows[gridIndex];

                DataGridViewComboBoxCell cellType = gridRow.Cells["ref_tool_type_id"] as DataGridViewComboBoxCell;
                ComboUtils.fillComboCellWithRefTable(cellType, "ref_tool_type", "ref_tool_type_id", "name", Database.getNullableId(rowView, "ref_tool_type_id"));

                DataGridViewLinkCell cellStat = gridRow.Cells["statistic_def_id"] as DataGridViewLinkCell;
                cellStat.Value = EditorFactory.getBrowseInfo(EditorSystemType.Statistic, rowView, "statistic_def_id");

                DataGridViewNumericUpDownElements.DataGridViewNumericUpDownCell cellSkill = gridRow.Cells["min_skill"] as DataGridViewNumericUpDownElements.DataGridViewNumericUpDownCell;
                cellSkill.Value = (int)rowView["min_skill"];

                DataGridViewNumericUpDownElements.DataGridViewNumericUpDownCell cellGather = gridRow.Cells["gather_amount"] as DataGridViewNumericUpDownElements.DataGridViewNumericUpDownCell;
                cellGather.Value = (int)rowView["gather_amount"];

                DataGridViewLinkCell cellResource = gridRow.Cells["resource_def_id"] as DataGridViewLinkCell;
                cellResource.Value = EditorFactory.getBrowseInfo(EditorSystemType.Item, rowView, "resource_def_id");

                gridRow.Tag = (int)rowView["item_resource_node_map_id"];
            }
            dt.Dispose();
        }
        public override void loadItemData(int aDefId)
        {
            DataTable dt = Database.getData("item_trap_map", "item_def_id", aDefId, null);

            if (dt == null)
            {
                return;
            }
            if (dt.Rows.Count == 0)
            {
                return;
            }
            DataRow dataRow = dt.Rows[0];

            mItemMapId = (int)dataRow["item_trap_map_id"];

            EditorFactory.setupLink(linkDisarmSkill, EditorSystemType.Statistic, (int)dataRow["disarm_statistic_def_id"]);
            ComboUtils.fillCombo(cboDifficulty, "ref_difficulty", "name", "ref_difficulty_id", (int)dataRow["ref_difficulty_id"]);
            ComboUtils.fillCombo(cboTargetClass, "ref_target_class", "name", "ref_target_class_id", (int)dataRow["ref_target_class_id"]);

            int flags = (int)dataRow["flags"];

            chkIsDestroyedOnUse.Checked = ((flags & Globals.TRAP_FLAG_DestroyedOnUse) != 0) ? true : false;
            chkIsAreaNotifier.Checked   = ((flags & Globals.TRAP_FLAG_AreaNotifier) != 0) ? true : false;

            if (dataRow["notify_radius"] != DBNull.Value)
            {
                numNotifyRadius.Value = (int)dataRow["notify_radius"];
            }

            EditorFactory.setupLink(linkSpaceEffect, EditorSystemType.SpaceEffect, Database.getNullableId(dataRow, "space_effect_def_id"));
            EditorFactory.setupLink(linkEffect, EditorSystemType.Effect, Database.getNullableId(dataRow, "effect_def_id"));
            dt.Dispose();
        }
Example #9
0
 private void initNpcsGrid()
 {
     {
         DataGridViewColumn        col  = new DataGridViewColumn();
         DataGridViewTypedLinkCell cell = new DataGridViewTypedLinkCell();
         col.Name         = "npc_def_id";
         cell.SystemType  = EditorSystemType.Npc;
         col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         col.FillWeight   = 75;
         col.HeaderText   = "Npcs";
         col.CellTemplate = cell;
         gridNpcs.Columns.Add(col);
     }
     {
         DataGridViewComboBoxColumn col  = new DataGridViewComboBoxColumn();
         DataGridViewComboBoxCell   cell = new DataGridViewComboBoxCell();
         col.Name         = "ref_behavior_id";
         col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         col.FillWeight   = 25;
         col.HeaderText   = "Behavior";
         col.CellTemplate = cell;
         ComboUtils.fillComboCellWithRefTable(cell, "ref_behavior", "ref_behavior_id", "name");
         col.ValueMember   = "Value";
         col.DisplayMember = "Name";
         gridNpcs.Columns.Add(col);
     }
 }
Example #10
0
        public override void initContentImpl(int aId)
        {
            DataTable dt = Database.getData("spawn_def", "spawn_def_id", aId, null);

            if (dt == null)
            {
                Program.MainForm.logError("Could not load Spawn [" + aId + "]");
                return;
            }
            if (dt.Rows.Count == 0)
            {
                Program.MainForm.logError("Could not load Spawn [" + aId + "]");
                return;
            }

            Program.MainForm.logInfo("Spawn loaded [" + aId + "]");
            DataRow dataRow = dt.Rows[0];

            txtSystemName.Text     = dataRow["system_name"].ToString();
            numMinQty.Value        = (int)dataRow["min_quantity"];
            numMaxQty.Value        = (int)dataRow["max_quantity"];
            numPctChance.Value     = (int)dataRow["chance"];
            numRespawnPeriod.Value = (int)dataRow["respawn_period"];

            ComboUtils.fillCombo(cboSpawnType, "ref_spawn_type", "name", "ref_spawn_type_id", (int)dataRow["ref_spawn_type_id"]);

            dt.Dispose();
            ControlName = txtSystemName.Text;

            loadNpcGrid(aId);
            loadItemGrid(aId);
            loadSpaceGrid(aId);
            loadAccessGrid(aId);
        }
Example #11
0
        private void loadNpcGrid(int aId)
        {
            gridNpcs.Rows.Clear();

            DataTable dt = Database.getData("spawn_npc_map", "spawn_def_id", aId, null);

            if (dt == null)
            {
                return;
            }
            foreach (DataRow rowView in dt.Rows)
            {
                int             gridIndex = gridNpcs.Rows.Add();
                DataGridViewRow gridRow   = gridNpcs.Rows[gridIndex];

                DataGridViewLinkCell cell = gridRow.Cells["npc_def_id"] as DataGridViewLinkCell;
                cell.Value = EditorFactory.getBrowseInfo(EditorSystemType.Npc, rowView, "npc_def_id");

                DataGridViewComboBoxCell cellBehavior = gridRow.Cells["ref_behavior_id"] as DataGridViewComboBoxCell;
                if (Database.getNullableId(rowView, "ref_behavior_id") == 0)
                {
                    ComboUtils.fillComboCellWithRefTable(cellBehavior, "ref_behavior", "ref_behavior_id", "name", 1);
                }
                //cellBehavior.Value = 1;   // Aggressive
                else
                {
                    ComboUtils.fillComboCellWithRefTable(cellBehavior, "ref_behavior", "ref_behavior_id", "name", Database.getNullableId(rowView, "ref_behavior_id"));
                }

                gridRow.Tag = (int)rowView["spawn_npc_map_id"];
            }
            dt.Dispose();
        }
        public override void loadItemData(int aDefId)
        {
            DataTable dt = Database.getData("item_container_map", "item_def_id", aDefId, null);

            if (dt == null)
            {
                return;
            }
            if (dt.Rows.Count == 0)
            {
                return;
            }
            DataRow dataRow = dt.Rows[0];

            mItemMapId = (int)dataRow["item_container_map_id"];

            numVolume.Value = (int)dataRow["volume_allowance"];
            numWeight.Value = (int)dataRow["weight_allowance"];

            ComboUtils.fillCombo(cboSize, "ref_size", "name", "ref_size_id", (int)dataRow["ref_size_id"]);

            int flags = (int)dataRow["flags"];

            chkIsCloseable.Checked = ((flags & Globals.CONTAINER_FLAG_Closeable) != 0) ? true : false;
            chkIsLockable.Checked  = ((flags & Globals.CONTAINER_FLAG_Lockable) != 0) ? true : false;
            chkIsLocked.Checked    = ((flags & Globals.CONTAINER_FLAG_Locked) != 0) ? true : false;

            if (chkIsLockable.Checked)
            {
                EditorFactory.setupLink(linkLock, EditorSystemType.Item, Database.getNullableId(dataRow, "lock_item_def_id"));
            }
            dt.Dispose();

            loadItemsGrid(aDefId);
        }
        private void loadOppositionGrid(int aId)
        {
            gridOpposition.Rows.Clear();

            DataTable dt = Database.getData("faction_opposition_map", "faction_def_id", aId, null);

            if (dt == null)
            {
                return;
            }
            foreach (DataRow rowView in dt.Rows)
            {
                int             gridIndex = gridOpposition.Rows.Add();
                DataGridViewRow gridRow   = gridOpposition.Rows[gridIndex];

                DataGridViewLinkCell cellFaction = gridRow.Cells["target_faction_def_id"] as DataGridViewLinkCell;
                cellFaction.Value = EditorFactory.getBrowseInfo(EditorSystemType.Faction, rowView, "target_faction_def_id");

                DataGridViewComboBoxCell cellType = gridRow.Cells["ref_faction_relationship_id"] as DataGridViewComboBoxCell;
                ComboUtils.fillComboCellWithRefTable(cellType, "ref_faction_relationship", "ref_faction_relationship_id", "name", Database.getNullableId(rowView, "ref_faction_relationship_id"));

                gridRow.Tag = (int)rowView["faction_opposition_map_id"];
            }
            dt.Dispose();
        }
Example #14
0
        public override void initContentImpl(int aId)
        {
            DataTable dt = Database.getData("channel_def", "channel_def_id", aId, null);

            if (dt == null)
            {
                Program.MainForm.logError("Could not load Channel [" + aId + "]");
                return;
            }
            if (dt.Rows.Count == 0)
            {
                Program.MainForm.logError("Could not load Channel [" + aId + "]");
                return;
            }

            Program.MainForm.logInfo("Channel loaded [" + aId + "]");
            DataRow dataRow = dt.Rows[0];

            txtSystemName.Text  = dataRow["system_name"].ToString();
            txtDisplayName.Text = dataRow["display_name"].ToString();

            int flags = Database.getNullableId(dataRow, "flags");

            chkReadOnly.Checked = ((flags & Globals.CHANNEL_FLAG_ReadOnly) != 0) ? true : false;
            chkAdmin.Checked    = ((flags & Globals.CHANNEL_FLAG_Admin) != 0) ? true : false;

            ComboUtils.fillCombo(cboType, "ref_channel_type", "name", "ref_channel_type_id", (int)dataRow["ref_channel_type_id"]);

            dt.Dispose();
            ControlName = txtSystemName.Text;
        }
Example #15
0
        public override void initContentImpl(int aId)
        {
            DataTable dt = Database.getData("slot_def", "slot_def_id", aId, null);

            if (dt == null)
            {
                Program.MainForm.logError("Could not load Slot [" + aId + "]");
                return;
            }
            if (dt.Rows.Count == 0)
            {
                Program.MainForm.logError("Could not load Slot [" + aId + "]");
                return;
            }

            Program.MainForm.logInfo("Slot loaded [" + aId + "]");
            DataRow dataRow = dt.Rows[0];

            txtSystemName.Text         = dataRow["system_name"].ToString();
            txtDisplayName.Text        = dataRow["display_name"].ToString();
            txtDisplayDescription.Text = dataRow["display_description"].ToString();
            numValue.Value             = (int)dataRow["slot_value"];
            ComboUtils.fillCombo(cboSlotType, "ref_slot_type", "name", "ref_slot_type_id", (int)dataRow["ref_slot_type_id"]);

            dt.Dispose();
            ControlName = txtSystemName.Text;
        }
Example #16
0
        private void loadItemTypesGrid(int aId)
        {
            gridItemTypes.Rows.Clear();

            DataTable dt = Database.getData("shop_item_type_map", "shop_def_id", aId, null);

            if (dt == null)
            {
                return;
            }
            foreach (DataRow rowView in dt.Rows)
            {
                int             gridIndex = gridItemTypes.Rows.Add();
                DataGridViewRow gridRow   = gridItemTypes.Rows[gridIndex];

                DataGridViewComboBoxCell cellItemType = gridRow.Cells["ref_item_type_id"] as DataGridViewComboBoxCell;
                if (Database.getNullableId(rowView, "ref_item_type_id") == 0)
                {
                    ComboUtils.fillComboCellWithRefTable(cellItemType, "ref_item_type", "ref_item_type_id", "name", 6);
                }
                //cellItemType.Value = 6;   // None
                else
                {
                    ComboUtils.fillComboCellWithRefTable(cellItemType, "ref_item_type", "ref_item_type_id", "name", Database.getNullableId(rowView, "ref_item_type_id"));
                }

                gridRow.Tag = (int)rowView["shop_item_type_map_id"];
            }
            dt.Dispose();
        }
Example #17
0
        public override void loadItemData(int aDefId)
        {
            DataTable dt = Database.getData("item_weapon_map", "item_def_id", aDefId, null);

            if (dt == null)
            {
                return;
            }
            if (dt.Rows.Count == 0)
            {
                return;
            }
            DataRow dataRow = dt.Rows[0];

            mItemMapId = (int)dataRow["item_weapon_map_id"];

            EditorFactory.setupLink(linkEffect, EditorSystemType.Effect, Database.getNullableId(dataRow, "effect_def_id"));
            ComboUtils.fillCombo(cboWeaponType, "ref_weapon_type", "name", "ref_weapon_type_id", Database.getNullableId(dataRow, "ref_weapon_type_id"));
            ComboUtils.fillCombo(cboWeaponSpeed, "ref_speed_class", "name", "ref_speed_class_id", Database.getNullableId(dataRow, "ref_speed_class_id"));

            int flags = (int)dataRow["flags"];

            chkIsThrowable.Checked = ((flags & Globals.WEAPON_FLAG_Throwable) != 0) ? true : false;
            dt.Dispose();
        }
 private void initOppositionGrid()
 {
     {
         DataGridViewColumn        col  = new DataGridViewColumn();
         DataGridViewTypedLinkCell cell = new DataGridViewTypedLinkCell();
         cell.SystemType  = EditorSystemType.Faction;
         col.Name         = "target_faction_def_id";
         col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         col.FillWeight   = 100;
         col.HeaderText   = "Faction";
         col.CellTemplate = cell;
         gridOpposition.Columns.Add(col);
     }
     {
         DataGridViewComboBoxColumn col  = new DataGridViewComboBoxColumn();
         DataGridViewComboBoxCell   cell = new DataGridViewComboBoxCell();
         col.Name         = "ref_faction_relationship_id";
         col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         col.FillWeight   = 100;
         col.HeaderText   = "Relationship";
         col.CellTemplate = cell;
         ComboUtils.fillComboCellWithRefTable(cell, "ref_faction_relationship", "ref_faction_relationship_id", "name");
         col.ValueMember   = "Value";
         col.DisplayMember = "Name";
         gridOpposition.Columns.Add(col);
     }
 }
Example #19
0
        public GamesCombo()
        {
            InitializeComponent();
            PresentGames();
            ComboUtils u = new ComboUtils();

            u.TpShowdown();
        }
 public EffectHealthChangeControl()
 {
     InitializeComponent();
     linkResistStat.SystemType = EditorSystemType.Statistic;
     linkOnFail.SystemType     = EditorSystemType.Effect;
     linkOnResist.SystemType   = EditorSystemType.Effect;
     ComboUtils.fillCombo(cboDamage, "ref_damage_type", "name", "ref_damage_type_id", 0);
 }
Example #21
0
        public override void initContentImpl(int aId)
        {
            DataTable dt = Database.getData("effect_def", "effect_def_id", aId, null);

            if (dt == null)
            {
                Program.MainForm.logError("Could not load Effect [" + aId + "]");
                return;
            }
            if (dt.Rows.Count == 0)
            {
                Program.MainForm.logError("Could not load Effect [" + aId + "]");
                return;
            }

            Program.MainForm.logInfo("Effect loaded [" + aId + "]");
            DataRow dataRow = dt.Rows[0];

            txtSystemName.Text         = dataRow["system_name"].ToString();
            txtDisplayName.Text        = dataRow["display_name"].ToString();
            txtDisplayDescription.Text = dataRow["display_description"].ToString();

            int flags = (int)dataRow["flags"];

            chkIsFriendly.Checked = ((flags & Globals.EFFECT_FLAG_Friendly) != 0) ? true : false;
            ComboUtils.fillCombo(cboEffectType, "ref_effect_type", "name", "ref_effect_type_id", Database.getNullableId(dataRow, "ref_effect_type_id"));

            int duration = (int)dataRow["duration"];

            if (duration <= 0)
            {
                radInstant.Checked  = true;
                numDuration.Enabled = false;
            }
            else
            {
                radDuration.Checked = true;
                numDuration.Enabled = true;
                numDuration.Value   = duration;
            }

            dt.Dispose();
            ControlName = txtSystemName.Text;

            // Choose the proper sub-item type, load the data into all controls
            EffectTypes effectType = (EffectTypes)Database.getNullableId(dataRow, "ref_effect_type_id");

            switchEffectType(EffectTypes.HealthChange);
            switchEffectType(effectType);

            {
                mHealthChangeControl.loadEffectData(Id);
                mStatModControl.loadEffectData(Id);
                mGiveObjectControl.loadEffectData(Id);
                mSpaceEffectControl.loadEffectData(Id);
                mChangePositionControl.loadEffectData(Id);
            }
        }
Example #22
0
        private void initControls()
        {
            TextBoxUtils.initTextBox(txtSystemName, "spawn_def", "system_name");
            ComboUtils.fillCombo(cboSpawnType, "ref_spawn_type", "name", "ref_spawn_type_id", 0);

            initNpcsGrid();
            initItemsGrid();
            initSpacesGrid();
            initAccessGrid();
        }
Example #23
0
        private void initControls()
        {
            TextBoxUtils.initTextBox(txtSystemName, "effect_def", "system_name");
            TextBoxUtils.initTextBox(txtDisplayName, "effect_def", "display_name");
            TextBoxUtils.initTextBox(txtDisplayDescription, "effect_def", "display_description");
            radInstant.Checked = true;

            ComboUtils.fillCombo(cboEffectType, "ref_effect_type", "name", "ref_effect_type_id", 0);
            cboEffectType.SelectedText = "Health Change";
        }
Example #24
0
 public override void initNewImpl()
 {
     ComboUtils.fillCombo(cboEffectType, "ref_effect_type", "name", "ref_effect_type_id", 0);
     {
         mHealthChangeControl.initNewImpl();
         mStatModControl.initNewImpl();
         mGiveObjectControl.initNewImpl();
         mSpaceEffectControl.initNewImpl();
         mChangePositionControl.initNewImpl();
     }
 }
Example #25
0
        public override void InitContentImpl(int aId)
        {
            var obj = Program.RealmDal.GetSkillCategory(aId);

            txtSystemName.Text  = obj.SystemName;
            txtDisplayName.Text = obj.DisplayName;

            var statList = Program.RealmDal.GetStatistics();

            ComboUtils.FillCombo(cboStatistics, statList, obj.StatisticID);

            ControlName = txtSystemName.Text;
        }
Example #26
0
        private void loadExitGrid(int aId)
        {
            gridExits.Rows.Clear();

            DataTable dt = Database.getData("space_exit_map", "space_def_id", aId, null);

            if (dt == null)
            {
                return;
            }
            foreach (DataRow rowView in dt.Rows)
            {
                int             gridIndex = gridExits.Rows.Add();
                DataGridViewRow gridRow   = gridExits.Rows[gridIndex];

                DataGridViewComboBoxCell cellDirection = gridRow.Cells["ref_direction_id"] as DataGridViewComboBoxCell;
                ComboUtils.fillComboCellWithRefTable(cellDirection, "ref_direction", "ref_direction_id", "name", (int)rowView["ref_direction_id"]);

                DataGridViewLinkCell cellSpace = gridRow.Cells["destination_space_def_id"] as DataGridViewLinkCell;
                cellSpace.Value = EditorFactory.getBrowseInfo(EditorSystemType.Space, rowView, "destination_space_def_id");

                int flags = (int)rowView["flags"];

                DataGridViewCheckBoxCell cellHidden = gridRow.Cells["is_hidden"] as DataGridViewCheckBoxCell;
                cellHidden.Value = ((flags & Globals.EXIT_FLAG_Hidden) != 0) ? true : false;

                DataGridViewCheckBoxCell cellOneWay = gridRow.Cells["is_oneway"] as DataGridViewCheckBoxCell;
                cellOneWay.Value = ((flags & Globals.EXIT_FLAG_OneWay) != 0) ? true : false;

                DataGridViewCheckBoxCell cellTransparent = gridRow.Cells["is_transparent"] as DataGridViewCheckBoxCell;
                cellTransparent.Value = ((flags & Globals.EXIT_FLAG_Transparent) != 0) ? true : false;

                DataGridViewComboBoxCell cellDifficulty = gridRow.Cells["ref_difficulty_id"] as DataGridViewComboBoxCell;
                if (Database.getNullableId(rowView, "ref_difficulty_id") == 0)
                {
                    ComboUtils.fillComboCellWithRefTable(cellDifficulty, "ref_difficulty", "ref_difficulty_id", "name", 6);
                }
                //cellDifficulty.Value = 6;   // None
                else
                {
                    ComboUtils.fillComboCellWithRefTable(cellDifficulty, "ref_difficulty", "ref_difficulty_id", "name", Database.getNullableId(rowView, "ref_difficulty_id"));
                }

                DataGridViewLinkCell cellBarrier = gridRow.Cells["barrier_def_id"] as DataGridViewLinkCell;
                cellBarrier.Value = EditorFactory.getBrowseInfo(EditorSystemType.Barrier, rowView, "barrier_def_id");

                gridRow.Tag = (int)rowView["space_exit_map_id"];
            }
            dt.Dispose();
        }
Example #27
0
        public override void initContentImpl(int aId)
        {
            DataTable dt = Database.getData("npc_def", "npc_def_id", aId, null);

            if (dt == null)
            {
                Program.MainForm.logError("Could not load NPC [" + aId + "]");
                return;
            }
            if (dt.Rows.Count == 0)
            {
                Program.MainForm.logError("Could not load NPC [" + aId + "]");
                return;
            }

            Program.MainForm.logInfo("NPC loaded [" + aId + "]");
            DataRow dataRow = dt.Rows[0];

            txtSystemName.Text         = dataRow["system_name"].ToString();
            txtDisplayName.Text        = dataRow["display_name"].ToString();
            txtDisplayDescription.Text = dataRow["display_description"].ToString();

            numAccessLevel.Value = (int)dataRow["access_level"];

            ComboUtils.fillCombo(cboGender, "ref_gender", "name", "ref_gender_id", (int)dataRow["ref_gender_id"]);
            EditorFactory.setupLink(linkRace, EditorSystemType.Race, Database.getNullableId(dataRow, "race_def_id"));
            EditorFactory.setupLink(linkShop, EditorSystemType.Shop, Database.getNullableId(dataRow, "shop_def_id"));
            if (linkShop.Text != "")
            {
                chkIsShop.Checked = true;
            }

            EditorFactory.setupLink(linkFaction, EditorSystemType.Faction, Database.getNullableId(dataRow, "faction_def_id"));
            EditorFactory.setupLink(linkTreasure, EditorSystemType.Treasure, Database.getNullableId(dataRow, "treasure_def_id"));
            if (linkTreasure.Text != "")
            {
                chkHasTreasure.Checked = true;
            }
            numLevel.Value = Database.getNullableId(dataRow, "npc_level");

            dt.Dispose();
            ControlName = txtSystemName.Text;

            loadStatisticsGrid(aId);
            loadAbilitiesGrid(aId);
            loadItemsGrid(aId);
            loadNodesGrid(aId);
            loadConversationsGrid(aId);
        }
Example #28
0
        private void initControls()
        {
            TextBoxUtils.initTextBox(txtSystemName, "statistic_def", "system_name");
            TextBoxUtils.initTextBox(txtDisplayName, "statistic_def", "display_name");
            TextBoxUtils.initTextBox(txtDisplayDescription, "statistic_def", "display_description");

            TagUtils.fillCheckedList(lstStatTags, "StatisticGroupTags");
            ComboUtils.fillCombo(cboStatType, "ref_stat_type", "name", "ref_stat_type_id", 0);

            lblAmalgam.Visible       = false;
            gridAmalgamStats.Visible = false;

            initAmalgamStatGrid();
            initRequiredStatGrid();
        }
Example #29
0
 private void initItemTypesGrid()
 {
     {
         DataGridViewComboBoxColumn col  = new DataGridViewComboBoxColumn();
         DataGridViewComboBoxCell   cell = new DataGridViewComboBoxCell();
         col.Name         = "ref_item_type_id";
         col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
         col.FillWeight   = 40;
         col.HeaderText   = "Item Type";
         col.CellTemplate = cell;
         ComboUtils.fillComboCellWithRefTable(cell, "ref_item_type", "ref_item_type_id", "name");
         col.ValueMember   = "Value";
         col.DisplayMember = "Name";
         gridItemTypes.Columns.Add(col);
     }
 }
        public override void loadEffectData(int aEffectDefId)
        {
            DataTable dt = Database.getData("effect_healthchange_map", "effect_def_id", aEffectDefId, null);

            if (dt == null)
            {
                return;
            }
            if (dt.Rows.Count == 0)
            {
                return;
            }
            DataRow dataRow = dt.Rows[0];

            mEffectMapId = (int)dataRow["effect_healthchange_map_id"];

            int healthChangeType = (int)dataRow["health_change_type_id"];

            if (healthChangeType == Globals.HEALTH_CHANGE_TYPE_Damage)
            {
                rdoDamage.Checked = true;
            }
            else if (healthChangeType == Globals.HEALTH_CHANGE_TYPE_Heal)
            {
                rdoHeal.Checked = true;
            }
            else if (healthChangeType == Globals.HEALTH_CHANGE_TYPE_Steal)
            {
                rdoSteal.Checked = true;
            }
            else
            {
                rdoResurrect.Checked = true;
            }

            numHealthMin.Value   = Database.getNullableId(dataRow, "health_change_min");
            numHealthMax.Value   = Database.getNullableId(dataRow, "health_change_max");
            numHealthBonus.Value = Database.getNullableId(dataRow, "health_change_bonus");

            EditorFactory.setupLink(linkResistStat, EditorSystemType.Statistic, Database.getNullableId(dataRow, "resist_statistic_def_id"));
            EditorFactory.setupLink(linkOnFail, EditorSystemType.Effect, Database.getNullableId(dataRow, "onfail_effect_def_id"));
            EditorFactory.setupLink(linkOnResist, EditorSystemType.Effect, Database.getNullableId(dataRow, "onresist_effect_def_id"));

            ComboUtils.fillCombo(cboDamage, "ref_damage_type", "name", "ref_damage_type_id", Database.getNullableId(dataRow, "ref_damage_type_id"));
            dt.Dispose();
        }