Initial handling for Flag wondercards
Some checks failed
Linux / build (Release) (push) Has been cancelled
MacOS / build (Release) (push) Has been cancelled
Windows / build (Release) (push) Has been cancelled

This commit is contained in:
Manu 2025-11-08 22:54:36 +01:00
parent f8fb4485c0
commit ef1c90dbea
3 changed files with 8 additions and 4 deletions

View File

@ -101,7 +101,7 @@ public class OtherGift
}
else if (type.GetType() == typeof(GiftType9A))
{
if ((GiftType9A)type is GiftType9A.Item)
if ((GiftType9A)type is GiftType9A.Item or GiftType9A.Flag)
str = Properties.Resources.Items.Split(new String[] { "\n" }, StringSplitOptions.None)[id];
else if ((GiftType9A)type is GiftType9A.Clothing)
{

View File

@ -13,6 +13,9 @@ public class WA9 : Wondercard
private const int TIDOffset = 0x18;
private const int SIDOffset = 0x1A;
private const int PIDOffset = 0x24;
private const int FlagStringOffset = 0x28;
private const int FlagItemOffset = 0x6C;
private const int FlagItemQuantityOffset = 0x6E;
private const int SpeciesOffset = 0x270;
private const int ShinyTypeOffset = 0x278;
private const int ChecksumOffset = 0x2C0;
@ -82,8 +85,9 @@ public class WA9 : Wondercard
}
else
{
item = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i)));
quantity = type is GiftType9A.BP ? BinaryPrimitives.ReadUInt32LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i))) :
item = type is GiftType9A.Flag ? BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(FlagItemOffset + (0x04 * i))) :
BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i)));
quantity = type is GiftType9A.Flag ? BinaryPrimitives.ReadUInt32LittleEndian(Data.AsSpan(FlagItemQuantityOffset + (0x04 * i))) :
BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(QuantityOffset + (0x04 * i)));
}

View File

@ -78,7 +78,7 @@ public enum GiftType9A : byte
None = 0,
Pokemon = 1,
Item = 2,
BP = 3,
Flag = 3,
Clothing = 4,
}