Esempio n. 1
0
 private void SaveCurrentItem()
 {
     CurrentItem.Item = ItemPid.GetItemByDefine(cmbItemPid.SelectedItem.ToString());
     CurrentItem.Slot = (SlotEnum)cmbSlot.SelectedIndex;
     CurrentItem.Min  = Decimal.ToInt32(numItemMin.Value);
     CurrentItem.Max  = Decimal.ToInt32(numItemMax.Value);
 }
Esempio n. 2
0
        private void cmbItemPid_SelectedValueChanged(object sender, EventArgs e)
        {
            if (CurrentItem == null)
            {
                return;
            }

            CurrentItem.Item = ItemPid.GetItemByDefine(cmbItemPid.SelectedItem.ToString());
            RefreshItems();
        }
Esempio n. 3
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     Filter.Enabled     = chkEnableFilter.Checked;
     Filter.EnabledNpc  = chkNpc.Checked;
     Filter.EnabledItem = chkItem.Checked;
     Filter.EnabledPerk = chkPerk.Checked;
     Filter.NpcPid      = (int)numNPCPID.Value;
     Filter.ItemPid     = (int)ItemPid.GetPid(cmbItem.Text);
     Filter.PerkIndex   = (int)DefineParser.Defines[cmbPerk.SelectedItem.ToString()];
     this.Close();
 }
Esempio n. 4
0
        private void RefreshItems()
        {
            if (CurrentNpc.Items.Count == 1)
            {
                lstNpcItems.SetObjects(null);
            }
            lstNpcItems.SetObjects(CurrentNpc.Items);
            foreach (EncounterItem It in CurrentNpc.Items)
            {
                It.Item.Define = ItemPid.GetDefineName(It.Item.Pid);
            }

            lstNpcItems.SelectedObject = CurrentItem;
        }
Esempio n. 5
0
        private void btnAddItem_Click(object sender, EventArgs e)
        {
            if (cmbItemPid.SelectedIndex == -1)
            {
                Message.Show("No item PID selected.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (cmbSlot.SelectedIndex == -1)
            {
                Message.Show("No item slot selected.", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            EncounterItem Item = new EncounterItem(ItemPid.GetPid(cmbItemPid.SelectedItem.ToString()), Decimal.ToInt32(numItemMin.Value), Decimal.ToInt32(numItemMax.Value), cmbSlot.SelectedIndex);

            CurrentNpc.AddItem(Item);
            RefreshItems();
            RefreshNpcList();
        }
Esempio n. 6
0
        public frmFilter(DefineParser DefineParser, Filtering Filter)
        {
            InitializeComponent();
            this.Filter = Filter;
            if (Filter == null)
            {
                this.Filter = new Filtering();
            }
            this.DefineParser = DefineParser;
            List <Item> items = ItemPid.GetItems();

            foreach (Item item in items)
            {
                cmbItem.Items.Add(item.Define);
            }
            cmbPerk.Items.AddRange(DefineParser.GetDefinesByPrefix("PE_").Keys.ToArray <String>());

            cmbItem.Sorted = true;
            cmbPerk.Sorted = true;
        }
Esempio n. 7
0
 private void AddArmorProtoToCmb(ArmorProto ItProt, ComboBox Cmb)
 {
     Cmb.Items.Add(ItProt.Name + " [" + (!String.IsNullOrEmpty(ItemPid.GetDefineName(ItProt.ProtoId)) ? ItemPid.GetDefineName(ItProt.ProtoId) : ItProt.ProtoId.ToString()) + "]");
 }
Esempio n. 8
0
        private void frmEncounterGroupEditor_Paint(object sender, PaintEventArgs e)
        {
            if (IsFirstPaint)
            {
                cmbGroupPosition.SelectedIndex = 0;
                numDialog.Maximum = Int32.MaxValue;
                numProto.Maximum  = Int32.MaxValue;
                Groups            = GroupParser.GetGroups();

                foreach (FOCommon.Worldmap.EncounterGroup.EncounterGroup Grp in Groups)
                {
                    CalculateGroupZoneStats(Grp);
                }

                List <Item> items = ItemPid.GetItems();

                foreach (Item item in items)
                {
                    cmbItemPid.Items.Add(item.Define);
                }
                cmbItemPid.Sorted = true;


                if (TableSerializer.Exists("lstGroups"))
                {
                    lstGroups.RestoreState(TableSerializer.Load("lstGroups"));
                }
                if (TableSerializer.Exists("lstNpcs"))
                {
                    lstNpcs.RestoreState(TableSerializer.Load("lstNpcs"));
                }
                if (TableSerializer.Exists("lstNpcItems"))
                {
                    lstNpcItems.RestoreState(TableSerializer.Load("lstNpcItems"));
                }

                Factions = GameParser.GetFactions();

                ProtoNames = FODLG.GetData();

                foreach (KeyValuePair <int, string> kvp in ProtoNames)
                {
                    if (kvp.Key % 2 == 1)
                    {
                        continue;
                    }
                    CritterProto CrP = new CritterProto((kvp.Key / 10));
                    CrP.Name = kvp.Value;
                    CrProtos.Add(CrP);
                }
                foreach (FOCommon.Worldmap.EncounterGroup.EncounterGroup grp in Groups)
                {
                    foreach (Faction f in Factions)
                    {
                        if (grp.FactionId == f.Id)
                        {
                            grp.FactionName = f.Name;
                        }
                    }
                }


                lstGroups.SetObjects(Groups);

                cmbPerkDefine.Items.AddRange(DefineParser.GetDefinesByPrefix("PE_").Keys.ToArray <String>());

                IsFirstPaint = false;
            }
        }