diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Link6.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Link6.Designer.cs index bb1015324..4b2d59c04 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Link6.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Link6.Designer.cs @@ -1,4 +1,4 @@ -namespace PKHeX.WinForms +namespace PKHeX.WinForms { partial class SAV_Link6 { @@ -200,6 +200,7 @@ private void InitializeComponent() B_Export.TabIndex = 4; B_Export.Text = "Export"; B_Export.UseVisualStyleBackColor = true; + B_Export.Enabled = false; B_Export.Click += B_Export_Click; // // B_Import @@ -303,7 +304,7 @@ private void InitializeComponent() NUD_BP.Enabled = false; NUD_BP.Location = new System.Drawing.Point(99, 74); NUD_BP.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - NUD_BP.Maximum = new decimal(new int[] { 65535, 0, 0, 0 }); + NUD_BP.Maximum = new decimal(new int[] { 9999, 0, 0, 0 }); NUD_BP.Name = "NUD_BP"; NUD_BP.Size = new System.Drawing.Size(68, 23); NUD_BP.TabIndex = 144; diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Link6.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Link6.cs index 39ab807d9..c138eed6d 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Link6.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Link6.cs @@ -10,7 +10,7 @@ public partial class SAV_Link6 : Form private readonly SaveFile Origin; private readonly ISaveBlock6Main SAV; - private PL6 Gifts; + private readonly PL6 Gifts; public SAV_Link6(SaveFile sav) { @@ -52,10 +52,9 @@ private void B_Import_Click(object sender, EventArgs e) { WinFormsUtil.Alert("Invalid file length"); return; } byte[] data = File.ReadAllBytes(ofd.FileName); - Gifts = new PL6(data); + data.AsSpan().CopyTo(Gifts.Data); LoadLinkData(); - B_Export.Enabled = true; } private void B_Export_Click(object sender, EventArgs e) @@ -72,7 +71,6 @@ private void B_Export_Click(object sender, EventArgs e) private void LoadLinkData() { RTB_LinkSource.Text = Gifts.Origin; - CHK_LinkAvailable.Checked = Gifts.Enabled; NUD_BP.Value = Gifts.BattlePoints; NUD_Pokemiles.Value = Gifts.Pokemiles; @@ -98,6 +96,14 @@ private void LoadLinkData() TB_PKM4.Text = GetSpecies(Gifts.Entity4.Species); TB_PKM5.Text = GetSpecies(Gifts.Entity5.Species); TB_PKM6.Text = GetSpecies(Gifts.Entity6.Species); + + if (Gifts.Enabled) + { + NUD_BP.Enabled = true; + NUD_Pokemiles.Enabled = true; + B_Export.Enabled = true; + } + CHK_LinkAvailable.Checked = Gifts.Enabled; } private static string GetSpecies(ushort species)