public SAV_Capture7GG(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (SAV7b)(Origin = sav).Clone(); Dex = SAV.Blocks.Zukan; Captured = SAV.Blocks.Captured; // Clear Listbox and ComboBox LB_Species.Items.Clear(); CB_Species.Items.Clear(); // Fill List var list = GetLegalSpecies().ToArray(); var species = GameInfo.SpeciesDataSource.Where(z => list.Contains(z.Value)).ToList(); CB_Species.InitializeBinding(); CB_Species.DataSource = new BindingSource(species, null); foreach (var (text, value) in species.OrderBy(z => z.Value)) LB_Species.Items.Add($"{value:000}: {text}"); GetTotals(); CB_Species.KeyDown += WinFormsUtil.RemoveDropCB; LB_Species.SelectedIndex = Index = 0; GetEntry(); Loading = false; }
private void ChangeLBSpecies(object sender, EventArgs e) { if (Loading) return; SetEntry(); Index = LB_Species.SelectedIndex; Loading = true; CB_Species.SelectedValue = CaptureRecords.GetIndexSpecies(Index); GetEntry(); Loading = false; }
private void ChangeCBSpecies(object sender, EventArgs e) { if (Loading) return; SetEntry(); Index = CaptureRecords.GetSpeciesIndex((int)CB_Species.SelectedValue); Loading = true; LB_Species.SelectedIndex = Index; LB_Species.TopIndex = LB_Species.SelectedIndex; GetEntry(); Loading = false; }