Add mystery gift file drag&drop to slot

pgt was a pkm size, check all sizes
This commit is contained in:
Kaphotics
2016-08-06 12:57:53 -07:00
parent 29c4497603
commit f83cfbaae1
2 changed files with 5 additions and 1 deletions

View File

@@ -3344,7 +3344,7 @@ private void pbBoxSlot_DragDrop(object sender, DragEventArgs e)
return;
string file = files[0];
FileInfo fi = new FileInfo(file);
if (!PKX.getIsPKM(fi.Length))
if (!PKX.getIsPKM(fi.Length) && !MysteryGift.getIsMysteryGift(fi.Length))
{ openQuick(file); return; }
byte[] data = File.ReadAllBytes(file);

View File

@@ -5,6 +5,10 @@ namespace PKHeX
{
public abstract class MysteryGift
{
internal static bool getIsMysteryGift(long len)
{
return new[] { WC6.SizeFull, WC6.Size, PGF.Size, PGT.Size, PCD.Size }.Contains((int)len);
}
internal static MysteryGift getMysteryGift(byte[] data, string ext)
{
if (data.Length == WC6.SizeFull && ext == ".wc6full")