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 SetRecord(int spec, int form) { bool hasRecord = Zukan7b.TryGetSizeEntryIndex(spec, form, out var index); if (!hasRecord) { return; }
private void SetRecord(int spec, int form) { bool hasRecord = Zukan7b.TryGetSizeEntryIndex(spec, form, out var index); if (!hasRecord) { return; } int get(NumericUpDown nud, CheckBox ck) => !ck.Checked ? Zukan7b.DefaultEntryValue : (int)Math.Max(0, Math.Min(255, nud.Value)); Dex.SetSizeData(DexSizeType.MinHeight, index, get(NUD_RHeightMin, CHK_RMinHeight), get(NUD_RHeightMinWeight, CHK_RMinHeight)); Dex.SetSizeData(DexSizeType.MaxHeight, index, get(NUD_RHeightMax, CHK_RMaxHeight), get(NUD_RHeightMaxWeight, CHK_RMaxHeight)); Dex.SetSizeData(DexSizeType.MinWeight, index, get(NUD_RWeightMinHeight, CHK_RMinWeight), get(NUD_RWeightMin, CHK_RMinWeight)); Dex.SetSizeData(DexSizeType.MaxWeight, index, get(NUD_RWeightMaxHeight, CHK_RMaxWeight), get(NUD_RWeightMax, CHK_RMaxWeight)); }
private void LoadRecord(int spec, int form) { bool hasRecord = Zukan7b.TryGetSizeEntryIndex(spec, form, out var index); GB_SizeRecords.Visible = hasRecord; if (!hasRecord) { return; } void set(DexSizeType type, NumericUpDown nudH, NumericUpDown nudW, CheckBox ck) { nudH.Enabled = nudW.Enabled = ck.Checked = Dex.GetSizeData(type, index, out int h, out int w); nudH.Value = h; nudW.Value = w; } set(DexSizeType.MinHeight, NUD_RHeightMin, NUD_RHeightMinWeight, CHK_RMinHeight); set(DexSizeType.MaxHeight, NUD_RHeightMax, NUD_RHeightMaxWeight, CHK_RMaxHeight); set(DexSizeType.MinWeight, NUD_RWeightMinHeight, NUD_RWeightMin, CHK_RMinWeight); set(DexSizeType.MaxWeight, NUD_RWeightMaxHeight, NUD_RWeightMax, CHK_RMaxWeight); }