Update BoxLayout6.cs

Closes #4322
This commit is contained in:
Kurt 2024-07-14 17:17:10 -05:00
parent fc509200b7
commit 36d5e771b7

View file

@ -38,13 +38,14 @@ public sealed class BoxLayout6 : SaveBlock<SAV6>, IBoxDetailName, IBoxDetailWall
Data[GetBoxWallpaperOffset(box)] = (byte)value;
}
private static int GetBoxNameOffset(int box) => (StringMaxByteCount * box);
private static int GetBoxNameOffset(int box) => StringMaxByteCount * box;
private Span<byte> GetBoxNameSpan(int box) => Data.Slice(GetBoxNameOffset(box), StringMaxByteCount);
public string GetBoxName(int box) => SAV.GetString(Data.Slice(GetBoxNameOffset(box), StringMaxByteCount));
public string GetBoxName(int box) => SAV.GetString(GetBoxNameSpan(box));
public void SetBoxName(int box, ReadOnlySpan<char> value)
{
var span = Data.Slice(GetBoxNameOffset(box) + (StringMaxByteCount * box), StringMaxByteCount);
var span = GetBoxNameSpan(box);
SAV.SetString(span, value, StringMaxLength, StringConverterOption.ClearZero);
}