Indicate teamlocks in boxes

This commit is contained in:
Kurt 2021-11-26 19:54:07 -08:00
parent d9a87f908d
commit fd4dd6e2fb
2 changed files with 19 additions and 1 deletions

View file

@ -83,8 +83,10 @@ namespace PKHeX.Core
Box = 0x14EF4;
Party = PartyInfo.Offset;
PokeDex = Zukan.PokeDex;
BoxLayout.LoadBattleTeams();
DaycareOffset = Daycare.Offset;
ReloadBattleTeams();
TeamSlots = BoxLayout.TeamSlots;
}
public override bool HasEvents => true;
@ -143,6 +145,19 @@ namespace PKHeX.Core
BoxLayout.LoadBattleTeams();
}
public override StorageSlotFlag GetSlotFlags(int index)
{
int team = Array.IndexOf(TeamSlots, index);
if (team < 0)
return StorageSlotFlag.None;
team /= 6;
var val = (StorageSlotFlag)((int)StorageSlotFlag.BattleTeam1 << team);
if (BoxLayout.GetIsTeamLocked(team))
val |= StorageSlotFlag.Locked;
return val;
}
#region Checksums
private const int HashOffset = SaveUtil.SIZE_G8BDSP - 0x10;

View file

@ -98,6 +98,7 @@ namespace PKHeX.Core
}
}
// bitflags
public byte LockedTeam
{
get => Data[Offset + 0x61C];
@ -126,6 +127,8 @@ namespace PKHeX.Core
set => Data[Offset + 0x61E] = value;
}
public bool GetIsTeamLocked(int team) => (LockedTeam & (1 << team)) != 0;
public int GetBoxWallpaperOffset(int box) => Offset + 0x620 + box;
public int GetBoxWallpaper(int box)