mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-20 17:04:59 -05:00
Filter Species choices to only those available
Thanks \!
This commit is contained in:
@@ -58,7 +58,6 @@ public SAV_MysteryGiftDB(Main f1)
|
||||
Counter = L_Count.Text;
|
||||
Viewed = L_Viewed.Text;
|
||||
L_Viewed.Text = ""; // invis for now
|
||||
populateComboBoxes();
|
||||
|
||||
ContextMenuStrip mnu = new ContextMenuStrip();
|
||||
ToolStripMenuItem mnuView = new ToolStripMenuItem("View");
|
||||
@@ -97,6 +96,8 @@ public SAV_MysteryGiftDB(Main f1)
|
||||
if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked)
|
||||
e.Cancel = true;
|
||||
};
|
||||
|
||||
populateComboBoxes();
|
||||
CenterToParent();
|
||||
}
|
||||
private readonly Main m_parent;
|
||||
@@ -143,7 +144,10 @@ private void populateComboBoxes()
|
||||
var Any = new ComboItem {Text = "Any", Value = -1};
|
||||
|
||||
var DS_Species = new List<ComboItem>(Main.SpeciesDataSource);
|
||||
DS_Species.RemoveAt(0); DS_Species.Insert(0, Any); CB_Species.DataSource = DS_Species;
|
||||
DS_Species.RemoveAt(0);
|
||||
var filteredSpecies = DS_Species.Where(spec => RawDB.Any(mg => mg.Species == spec.Value)).ToList();
|
||||
filteredSpecies.Insert(0, Any);
|
||||
CB_Species.DataSource = filteredSpecies;
|
||||
|
||||
var DS_Item = new List<ComboItem>(Main.ItemDataSource);
|
||||
DS_Item.Insert(0, Any); CB_HeldItem.DataSource = DS_Item;
|
||||
|
||||
Reference in New Issue
Block a user