diff --git a/PKHeX/Subforms/Save Editors/SAV_Inventory.Designer.cs b/PKHeX/Subforms/Save Editors/SAV_Inventory.Designer.cs index 0611e5417..ccf9b3bc1 100644 --- a/PKHeX/Subforms/Save Editors/SAV_Inventory.Designer.cs +++ b/PKHeX/Subforms/Save Editors/SAV_Inventory.Designer.cs @@ -84,6 +84,7 @@ private void InitializeComponent() this.tabControl1.SelectedIndex = 0; this.tabControl1.Size = new System.Drawing.Size(261, 336); this.tabControl1.TabIndex = 17; + this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.switchBag); // // IL_Pouch // diff --git a/PKHeX/Subforms/Save Editors/SAV_Inventory.cs b/PKHeX/Subforms/Save Editors/SAV_Inventory.cs index b3720f738..c9d5811a5 100644 --- a/PKHeX/Subforms/Save Editors/SAV_Inventory.cs +++ b/PKHeX/Subforms/Save Editors/SAV_Inventory.cs @@ -21,6 +21,7 @@ public SAV_Inventory() Pouches = SAV.Inventory; initBags(); getBags(); + switchBag(null, null); // bag 0 } private readonly SaveFile SAV = Main.SAV.Clone(); @@ -152,20 +153,6 @@ private void getBag(DataGridView dgv, InventoryPouch pouch) dgv.Rows[i].Cells[0].Value = itemlist[pouch.Items[i].Index]; dgv.Rows[i].Cells[1].Value = pouch.Items[i].Count; } - if (Main.HaX) - { - // Cap at absolute maximum - if (SAV.Generation <= 2) - NUD_Count.Maximum = byte.MaxValue; - else if (SAV.Generation >= 7) - NUD_Count.Maximum = pouch.MaxCount; - else if (SAV.Generation >= 3) - NUD_Count.Maximum = ushort.MaxValue; - } - else - NUD_Count.Maximum = pouch.MaxCount; - - NUD_Count.Value = pouch.Type == InventoryType.KeyItems ? 1 : pouch.MaxCount; } private void setBag(DataGridView dgv, InventoryPouch pouch) { @@ -199,6 +186,26 @@ private void setBag(DataGridView dgv, InventoryPouch pouch) pouch.Items[i] = new InventoryItem(); // Empty Slots at the end } + private void switchBag(object sender, EventArgs e) + { + int index = tabControl1.SelectedIndex; + var pouch = Pouches[index]; + if (Main.HaX) + { + // Cap at absolute maximum + if (SAV.Generation <= 2) + NUD_Count.Maximum = byte.MaxValue; + else if (SAV.Generation >= 7) + NUD_Count.Maximum = pouch.MaxCount; + else if (SAV.Generation >= 3) + NUD_Count.Maximum = ushort.MaxValue; + } + else + NUD_Count.Maximum = pouch.MaxCount; + + NUD_Count.Value = pouch.Type == InventoryType.KeyItems ? 1 : pouch.MaxCount; + } + // Initialize String Tables private readonly string[] itemlist; private string[] getItems(ushort[] items, bool sort = true) diff --git a/PKHeX/Subforms/Save Editors/SAV_Inventory.resx b/PKHeX/Subforms/Save Editors/SAV_Inventory.resx index 63723025c..f863519a2 100644 --- a/PKHeX/Subforms/Save Editors/SAV_Inventory.resx +++ b/PKHeX/Subforms/Save Editors/SAV_Inventory.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB0 - EwAAAk1TRnQBSQFMAgEBCwEAASABAAEgAQABGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + EwAAAk1TRnQBSQFMAgEBCwEAASgBAAEoAQABGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABYAMAAUgDAAEBAQABCAYAARsYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA