mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-22 06:57:42 -05:00
Add mystery gift file drag&drop to slot
pgt was a pkm size, check all sizes
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user