From 3b7aec7f2ee16879aa471b2ef99796c4a12973f4 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 20 Jul 2014 00:09:08 -0700 Subject: [PATCH] Added Wondercard Code Generation --- CodeGenerator.Designer.cs | 3 ++- CodeGenerator.cs | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CodeGenerator.Designer.cs b/CodeGenerator.Designer.cs index 543336e19..9370f127d 100644 --- a/CodeGenerator.Designer.cs +++ b/CodeGenerator.Designer.cs @@ -87,7 +87,8 @@ this.CB_Source.FormattingEnabled = true; this.CB_Source.Items.AddRange(new object[] { "Loaded EKX (Tabs)", - "Box EKX "}); + "Box EKX", + "Wondercard"}); this.CB_Source.Location = new System.Drawing.Point(90, 23); this.CB_Source.Name = "CB_Source"; this.CB_Source.Size = new System.Drawing.Size(132, 21); diff --git a/CodeGenerator.cs b/CodeGenerator.cs index bc8ad4667..4948508b6 100644 --- a/CodeGenerator.cs +++ b/CodeGenerator.cs @@ -64,7 +64,13 @@ namespace PKHeX // Wondercard # int wcn = CB_Slot.SelectedIndex; // copy from save, the chosen wondercard offset, to new data - Array.Copy(m_parent.savefile, SaveGame.Wondercard + wcn * 0x108, newdata, 0, 0x108); + Array.Copy(m_parent.savefile, SaveGame.Wondercard + wcn * 0x108 + 0x100, newdata, 0, 0x108); + byte[] zerodata = new Byte[0x108]; + if (newdata.SequenceEqual(zerodata)) + { + System.Media.SystemSounds.Exclamation.Play(); + return false; + } } return true; }