diff --git a/PKHeX.Core/Saves/SAV2.cs b/PKHeX.Core/Saves/SAV2.cs index 7d92d0055..3029c00b4 100644 --- a/PKHeX.Core/Saves/SAV2.cs +++ b/PKHeX.Core/Saves/SAV2.cs @@ -235,6 +235,7 @@ namespace PKHeX.Core public override int BoxSlotCount => Japanese ? 30 : 20; public override bool HasParty => true; + public override bool HasNamableBoxes => true; // Checksums private ushort GetChecksum() @@ -338,7 +339,8 @@ namespace PKHeX.Core } public int TextSpeed { - get => Options & 0x7; set + get => Options & 0x7; + set { var new_speed = value; if (new_speed > 7) @@ -398,7 +400,7 @@ namespace PKHeX.Core p.Items[i] = p.Items[ofs++]; } while (ofs < p.Items.Length) - p.Items[ofs++] = new InventoryItem { Count = 0, Index = 0 }; + p.Items[ofs++] = new InventoryItem(); p.SetPouchG1(ref Data); } } @@ -449,7 +451,9 @@ namespace PKHeX.Core } public override void SetBoxName(int box, string value) { - // Don't allow for custom box names + int len = Korean ? 17 : 9; + var data = SetString(value, len, len, 0x50); + SetData(data, Offsets.BoxNames + box * len); } public override PKM GetPKM(byte[] data) diff --git a/PKHeX.Core/Saves/SaveFile.cs b/PKHeX.Core/Saves/SaveFile.cs index cb3de1f46..36f7f7bc3 100644 --- a/PKHeX.Core/Saves/SaveFile.cs +++ b/PKHeX.Core/Saves/SaveFile.cs @@ -110,6 +110,7 @@ namespace PKHeX.Core public bool HasDaycare => Daycare > -1; public virtual bool HasPokeDex => PokeDex > -1; public virtual bool HasBoxWallpapers => GetBoxWallpaperOffset(0) > -1; + public virtual bool HasNamableBoxes => HasBoxWallpapers; public virtual bool HasSUBE => SUBE > -1 && !ORAS; public virtual bool HasGeolocation => false; public bool HasPokeBlock => ORAS && !ORASDEMO; diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs index ba9ab2cf8..7a1d4686e 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs @@ -989,7 +989,7 @@ namespace PKHeX.WinForms.Controls B_OpenPokeBeans.Enabled = sav.Generation == 7; B_CellsStickers.Enabled = sav.Generation == 7; B_OUTPasserby.Enabled = sav.HasPSS; - B_OpenBoxLayout.Enabled = sav.HasBoxWallpapers; + B_OpenBoxLayout.Enabled = sav.HasNamableBoxes; B_OpenWondercards.Enabled = sav.HasWondercards; B_OpenSuperTraining.Enabled = sav.HasSuperTrain; B_OpenHallofFame.Enabled = sav.HasHoF; diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BoxLayout.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BoxLayout.cs index 8a6f76488..856da6498 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BoxLayout.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BoxLayout.cs @@ -15,15 +15,18 @@ namespace PKHeX.WinForms InitializeComponent(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); editing = true; - - // Repopulate Wallpaper names - if (!LoadWallpaperNames()) + + if (!SAV.HasBoxWallpapers) + CB_BG.Visible = PAN_BG.Visible = false; + else if (!LoadWallpaperNames()) // Repopulate Wallpaper names WinFormsUtil.Error("Box layout is not supported for this game.", "Please close the window."); + LoadBoxNames(); LoadFlags(); LoadUnlockedCount(); LB_BoxSelect.SelectedIndex = box; + editing = false; } private bool LoadWallpaperNames()