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; }
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; } }