diff --git a/PKHeX.Core/Saves/SAV5.cs b/PKHeX.Core/Saves/SAV5.cs index f5d268935..352c7d340 100644 --- a/PKHeX.Core/Saves/SAV5.cs +++ b/PKHeX.Core/Saves/SAV5.cs @@ -98,6 +98,7 @@ public override int PartyCount public override int CurrentBox { get => BoxLayout.CurrentBox; set => BoxLayout.CurrentBox = value; } protected int BattleBoxOffset; + public bool BattleBoxLocked { get => Data[BattleBoxOffset + 0x358] != 0; // wifi/live diff --git a/PKHeX.Core/Saves/Substructures/Gen8/TrainerCard8.cs b/PKHeX.Core/Saves/Substructures/Gen8/TrainerCard8.cs index 0b79ca97c..2fa65db3a 100644 --- a/PKHeX.Core/Saves/Substructures/Gen8/TrainerCard8.cs +++ b/PKHeX.Core/Saves/Substructures/Gen8/TrainerCard8.cs @@ -17,7 +17,7 @@ public string Number get => Encoding.ASCII.GetString(Data, 0x39, 3); set { - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) Data[0x39 + i] = (byte) (value.Length > i ? value[i] : '0'); SAV.Edited = true; } diff --git a/PKHeX.WinForms/Subforms/PKM Editors/Text.cs b/PKHeX.WinForms/Subforms/PKM Editors/Text.cs index 4fd7e3c45..82d31cc51 100644 --- a/PKHeX.WinForms/Subforms/PKM Editors/Text.cs +++ b/PKHeX.WinForms/Subforms/PKM Editors/Text.cs @@ -122,8 +122,7 @@ private void UpdateNUD(object sender, EventArgs e) int index = Bytes.IndexOf(nud); Raw[index] = (byte)nud.Value; - string str = GetString(); - TB_Text.Text = str; + TB_Text.Text = GetString(); editing = false; } @@ -190,13 +189,12 @@ private void B_ClearTrash_Click(object sender, EventArgs e) private static ushort[] GetChars(int generation) { - switch (generation) + return generation switch { - case 6: - case 7: - return chars67; - default: return Array.Empty(); - } + 6 => chars67, + 7 => chars67, + _ => Array.Empty() + }; } private static readonly ushort[] chars67 =