SAV5: expose number of unlocked boxes

This commit is contained in:
sora10pls
2023-04-30 18:59:51 -04:00
parent d55bf21466
commit e5cc0ffd6b
2 changed files with 12 additions and 0 deletions

View File

@@ -95,6 +95,7 @@ public override int PartyCount
public override int GetPartyOffset(int slot) => Party + 8 + (SIZE_PARTY * slot);
protected override int GetBoxWallpaperOffset(int box) => BoxLayout.GetBoxWallpaperOffset(box);
public override int BoxesUnlocked { get => BoxLayout.BoxesUnlocked; set => BoxLayout.BoxesUnlocked = (byte)value; }
public override int GetBoxWallpaper(int box) => BoxLayout.GetBoxWallpaper(box);
public override void SetBoxWallpaper(int box, int value) => BoxLayout.SetBoxWallpaper(box, value);
public override string GetBoxName(int box) => BoxLayout[box];

View File

@@ -39,6 +39,17 @@ public void SetBoxName(int box, ReadOnlySpan<char> value)
SAV.SetString(GetBoxNameSpan(box), value, 13, StringConverterOption.ClearZero);
}
public byte BoxesUnlocked
{
get => Data[Offset + 0x3DD];
set
{
if (value > SAV.BoxCount)
value = (byte)SAV.BoxCount;
Data[Offset + 0x3DD] = value;
}
}
public string this[int i]
{
get => GetBoxName(i);