diff --git a/PKHeX.Core/Saves/SAV4HGSS.cs b/PKHeX.Core/Saves/SAV4HGSS.cs index 92b5e654a..3ce686867 100644 --- a/PKHeX.Core/Saves/SAV4HGSS.cs +++ b/PKHeX.Core/Saves/SAV4HGSS.cs @@ -80,7 +80,7 @@ public int Counter public override void SetBoxName(int box, string value) { - const int maxlen = BOX_NAME_LEN / 2; + const int maxlen = 8; if (value.Length > maxlen) value = value.Substring(0, maxlen); // Hard cap int offset = GetBoxNameOffset(box); diff --git a/PKHeX.Core/Saves/SAV4Sinnoh.cs b/PKHeX.Core/Saves/SAV4Sinnoh.cs index cae16d8f4..bed0f99af 100644 --- a/PKHeX.Core/Saves/SAV4Sinnoh.cs +++ b/PKHeX.Core/Saves/SAV4Sinnoh.cs @@ -47,7 +47,7 @@ public int Unknown public override void SetBoxName(int box, string value) { - const int maxlen = BOX_NAME_LEN / 2; + const int maxlen = 8; if (value.Length > maxlen) value = value.Substring(0, maxlen); // Hard cap int offset = GetBoxNameOffset(box); diff --git a/PKHeX.Core/Saves/Substructures/Gen7/BoxLayout7.cs b/PKHeX.Core/Saves/Substructures/Gen7/BoxLayout7.cs index c5260b1b9..1e3a7c3bc 100644 --- a/PKHeX.Core/Saves/Substructures/Gen7/BoxLayout7.cs +++ b/PKHeX.Core/Saves/Substructures/Gen7/BoxLayout7.cs @@ -47,7 +47,7 @@ public string GetBoxName(int box) public void SetBoxName(int box, string value) { var data = SAV.SetString(value, strlen, strlen, 0); - var offset = GetBoxNameOffset(box) + (SAV6.LongStringLength * box); + var offset = GetBoxNameOffset(box - 1) + (SAV6.LongStringLength); SAV.SetData(data, offset); } diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BoxLayout.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BoxLayout.cs index 03ec32d70..abf2ffbb3 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BoxLayout.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BoxLayout.cs @@ -28,6 +28,7 @@ public SAV_BoxLayout(SaveFile sav, int box) LoadUnlockedCount(); LB_BoxSelect.SelectedIndex = box; + TB_BoxName.MaxLength = SAV.Generation >= 6 ? 14 : 8; editing = false; }