private void LoadLinkData(byte[] data) { LinkInfo = new PL6(data); RTB_LinkSource.Text = LinkInfo.Origin_app; CHK_LinkAvailable.Checked = LinkInfo.PL_enabled; NUD_BP.Value = LinkInfo.BattlePoints; NUD_Pokemiles.Value = LinkInfo.Pokemiles; CB_Item1.SelectedIndex = LinkInfo.Item_1; CB_Item2.SelectedIndex = LinkInfo.Item_2; CB_Item3.SelectedIndex = LinkInfo.Item_3; CB_Item4.SelectedIndex = LinkInfo.Item_4; CB_Item5.SelectedIndex = LinkInfo.Item_5; CB_Item6.SelectedIndex = LinkInfo.Item_6; NUD_Item1.Value = LinkInfo.Quantity_1; NUD_Item2.Value = LinkInfo.Quantity_2; NUD_Item3.Value = LinkInfo.Quantity_3; NUD_Item4.Value = LinkInfo.Quantity_4; NUD_Item5.Value = LinkInfo.Quantity_5; NUD_Item6.Value = LinkInfo.Quantity_6; // Pokemon slots TB_PKM1.Text = GameInfo.Strings.specieslist[LinkInfo.Pokes[0].Species]; TB_PKM2.Text = GameInfo.Strings.specieslist[LinkInfo.Pokes[1].Species]; TB_PKM3.Text = GameInfo.Strings.specieslist[LinkInfo.Pokes[2].Species]; TB_PKM4.Text = GameInfo.Strings.specieslist[LinkInfo.Pokes[3].Species]; TB_PKM5.Text = GameInfo.Strings.specieslist[LinkInfo.Pokes[4].Species]; TB_PKM6.Text = GameInfo.Strings.specieslist[LinkInfo.Pokes[5].Species]; }
public SAV_Link6(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (ISaveBlock6Main)(Origin = sav).Clone(); foreach (var cb in TAB_Items.Controls.OfType <ComboBox>()) { cb.InitializeBinding(); cb.DataSource = new BindingSource(GameInfo.ItemDataSource.Where(item => item.Value <= sav.MaxItemID).ToArray(), null); } LinkInfo = SAV.Link.GetLinkInfo(); LoadLinkData(); }
public SAV_Link6(SaveFile sav) { InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); SAV = (ISaveBlock6Main)(Origin = sav).Clone(); var filtered = GameInfo.FilteredSources; foreach (var cb in TAB_Items.Controls.OfType <ComboBox>()) { cb.InitializeBinding(); cb.DataSource = new BindingSource(filtered.Items, null); } LinkInfo = SAV.Link.GetLinkInfo(); LoadLinkData(); }
private void B_Import_Click(object sender, EventArgs e) { using var ofd = new OpenFileDialog { Filter = PL6.Filter }; if (ofd.ShowDialog() != DialogResult.OK) { return; } if (new FileInfo(ofd.FileName).Length != PL6.Size) { WinFormsUtil.Alert("Invalid file length"); return; } byte[] data = File.ReadAllBytes(ofd.FileName); LinkInfo = new PL6(data); LoadLinkData(); B_Export.Enabled = true; }