mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 13:58:33 +00:00
Add Full Size WC6 importing
This commit is contained in:
parent
ce87cf675f
commit
2e0a06034c
3 changed files with 10 additions and 2 deletions
|
@ -7,6 +7,7 @@ namespace PKHeX
|
|||
public class WC6
|
||||
{
|
||||
internal const int Size = 0x108;
|
||||
internal const int SizeFull = 0x310;
|
||||
|
||||
public byte[] Data;
|
||||
public WC6(byte[] data = null)
|
||||
|
|
|
@ -631,7 +631,10 @@ namespace PKHeX
|
|||
}
|
||||
#endregion
|
||||
#region Wondercard
|
||||
else if (input.Length == WC6.Size && ext == ".wc6")
|
||||
else if ((input.Length == WC6.Size && ext == ".wc6") || (input.Length == WC6.SizeFull && ext == ".wcfull6"))
|
||||
{
|
||||
if (input.Length == WC6.SizeFull) // Take bytes at end = WC6 size.
|
||||
input = input.Skip(WC6.SizeFull - WC6.Size).ToArray();
|
||||
if (ModifierKeys == Keys.Control)
|
||||
new SAV_Wondercard(input).Show();
|
||||
else
|
||||
|
@ -645,6 +648,7 @@ namespace PKHeX
|
|||
}
|
||||
populateFields(pk);
|
||||
}
|
||||
}
|
||||
else if (input.Length == PGF.Size && ext == ".pgf")
|
||||
{
|
||||
PK5 pk = new PGF(input).convertToPK5(SAV);
|
||||
|
|
|
@ -122,12 +122,15 @@ namespace PKHeX
|
|||
if (importwc6.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
string path = importwc6.FileName;
|
||||
if (new FileInfo(path).Length != WC6.Size)
|
||||
long len = new FileInfo(path).Length;
|
||||
if (len != WC6.Size || len != WC6.SizeFull)
|
||||
{
|
||||
Util.Error("File is not a Wonder Card:", path);
|
||||
return;
|
||||
}
|
||||
byte[] newwc6 = File.ReadAllBytes(path);
|
||||
if (newwc6.Length == WC6.SizeFull)
|
||||
newwc6 = newwc6.Skip(WC6.SizeFull - WC6.Size).ToArray();
|
||||
Array.Copy(newwc6, wondercard_data, newwc6.Length);
|
||||
loadwcdata();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue