Add wc5full compatibility (#3854)

* Add WC5Full compatibility

* Add .wc5full to mystery gift filter
This commit is contained in:
Manu 2023-04-04 16:19:54 +02:00 committed by GitHub
parent e53ca4b1af
commit 43c67fd455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -39,6 +39,7 @@ public abstract class MysteryGift : IEncounterable, IMoveset, IRelearn, ITrainer
WA8.Size when Equals(ext, ".wa8") => new WA8(data), WA8.Size when Equals(ext, ".wa8") => new WA8(data),
WC9.Size when Equals(ext, ".wc9") => new WC9(data), WC9.Size when Equals(ext, ".wc9") => new WC9(data),
PGF.SizeFull when Equals(ext, ".wc5full") => new PGF(data),
WB7.SizeFull when Equals(ext, ".wb7full") => new WB7(data), WB7.SizeFull when Equals(ext, ".wb7full") => new WB7(data),
WC6Full.Size when Equals(ext, ".wc6full") => new WC6Full(data).Gift, WC6Full.Size when Equals(ext, ".wc6full") => new WC6Full(data).Gift,
WC7Full.Size when Equals(ext, ".wc7full") => new WC7Full(data).Gift, WC7Full.Size when Equals(ext, ".wc7full") => new WC7Full(data).Gift,
@ -59,9 +60,11 @@ public abstract class MysteryGift : IEncounterable, IMoveset, IRelearn, ITrainer
PCD.Size => new PCD(data), PCD.Size => new PCD(data),
PGF.Size => new PGF(data), PGF.Size => new PGF(data),
WR7.Size => new WR7(data), WR7.Size => new WR7(data),
WC8.Size => new WC8(data),
WB8.Size => new WB8(data), WB8.Size => new WB8(data),
// WC8/WC5Full: WC8 0x2CF always 0, WC5Full 0x2CF contains card checksum
WC8.Size => data[0x2CF] == 0 ? new WC8(data) : new PGF(data),
// WA8/WC9: WA8 CardType >0 for wa8, 0 for wc9. // WA8/WC9: WA8 CardType >0 for wa8, 0 for wc9.
WA8.Size => data[0xF] > 0 ? new WA8(data) : new WC9(data), WA8.Size => data[0xF] > 0 ? new WA8(data) : new WC9(data),

View file

@ -9,6 +9,7 @@ namespace PKHeX.Core;
public sealed class PGF : DataMysteryGift, IRibbonSetEvent3, IRibbonSetEvent4, ILangNick, IContestStats, INature public sealed class PGF : DataMysteryGift, IRibbonSetEvent3, IRibbonSetEvent4, ILangNick, IContestStats, INature
{ {
public const int Size = 0xCC; public const int Size = 0xCC;
public const int SizeFull = 0x2D0;
public override int Generation => 5; public override int Generation => 5;
public override EntityContext Context => EntityContext.Gen5; public override EntityContext Context => EntityContext.Gen5;
public override bool FatefulEncounter => true; public override bool FatefulEncounter => true;

View file

@ -424,7 +424,7 @@ public static class WinFormsUtil
public static string GetMysterGiftFilter(EntityContext context) => context switch public static string GetMysterGiftFilter(EntityContext context) => context switch
{ {
EntityContext.Gen4 => "Gen4 Mystery Gift|*.pgt;*.pcd;*.wc4" + all, EntityContext.Gen4 => "Gen4 Mystery Gift|*.pgt;*.pcd;*.wc4" + all,
EntityContext.Gen5 => "Gen5 Mystery Gift|*.pgf" + all, EntityContext.Gen5 => "Gen5 Mystery Gift|*.pgf;*.wc5full" + all,
EntityContext.Gen6 => "Gen6 Mystery Gift|*.wc6;*.wc6full" + all, EntityContext.Gen6 => "Gen6 Mystery Gift|*.wc6;*.wc6full" + all,
EntityContext.Gen7 => "Gen7 Mystery Gift|*.wc7;*.wc7full" + all, EntityContext.Gen7 => "Gen7 Mystery Gift|*.wc7;*.wc7full" + all,
EntityContext.Gen8 => "Gen8 Mystery Gift|*.wc8" + all, EntityContext.Gen8 => "Gen8 Mystery Gift|*.wc8" + all,