Implement PGF import->convert

Program should now be able to handle imported PGFs; due to no gen5 save
data being available, that data has to be fabricated. User has to enter
in their OT/ID/Version details, but a skeleton to make it legal is the
default data.
This commit is contained in:
Kurt 2015-12-25 14:08:43 -08:00
parent 20ae99f20d
commit 1c257c0a24

View file

@ -594,7 +594,7 @@ namespace PKHeX
}
#endregion
#region Wondercard
else if (input.Length == 0x108 && ext == ".wc6")
else if (input.Length == WC6.Size && ext == ".wc6")
if (ModifierKeys == Keys.Control)
new SAV_Wondercard(input).Show();
else
@ -608,6 +608,17 @@ namespace PKHeX
}
populateFields(pk.Data);
}
else if (input.Length == PGF.Size && ext == ".pgf")
{
PK5 pk = new PGF(input).convertToPK5(SAV);
if (pk == null || pk.Species == 0 || pk.Species > 721)
{
Util.Error("Failed to convert PGF.",
(pk == null ? "Not a Pokémon PGF." : "Invalid species."));
return;
}
populateFields(Converter.ConvertPKM(pk.Data));
}
#endregion
else
Util.Error("Attempted to load an unsupported file type/size.",