Merge pull request #1 from kwsch/master

Up to date
This commit is contained in:
ajtudela 2016-08-15 20:46:45 +02:00 committed by GitHub
commit 8758e9610e
2259 changed files with 4324 additions and 1058 deletions

View file

@ -1,7 +1,13 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PKHeX", "PKHeX.csproj", "{B4EFF030-C75A-49F9-A4BC-738D1B61C4AF}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PKHeX", "PKHeX\PKHeX.csproj", "{B4EFF030-C75A-49F9-A4BC-738D1B61C4AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PKHeX.Tests", "Tests\PKHeX.Tests\PKHeX.Tests.csproj", "{8E2499BC-C11A-4809-8737-66D35A625425}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{7C0598C9-DDF3-4ACC-B15D-6A626ADB7530}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -13,8 +19,15 @@ Global
{B4EFF030-C75A-49F9-A4BC-738D1B61C4AF}.Debug|x86.Build.0 = Debug|x86
{B4EFF030-C75A-49F9-A4BC-738D1B61C4AF}.Release|x86.ActiveCfg = Release|x86
{B4EFF030-C75A-49F9-A4BC-738D1B61C4AF}.Release|x86.Build.0 = Release|x86
{8E2499BC-C11A-4809-8737-66D35A625425}.Debug|x86.ActiveCfg = Debug|x86
{8E2499BC-C11A-4809-8737-66D35A625425}.Debug|x86.Build.0 = Debug|x86
{8E2499BC-C11A-4809-8737-66D35A625425}.Release|x86.ActiveCfg = Release|x86
{8E2499BC-C11A-4809-8737-66D35A625425}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8E2499BC-C11A-4809-8737-66D35A625425} = {7C0598C9-DDF3-4ACC-B15D-6A626ADB7530}
EndGlobalSection
EndGlobal

View file

@ -710,7 +710,7 @@ namespace PKHeX
switch (pk6.OT_Memory)
{
case 2: // {0} hatched from an Egg and saw {1} for the first time at... {2}. {4} that {3}.
if (!pk6.WasEgg)
if (!pk6.WasEgg && pk6.Egg_Location != 60004)
return new LegalityCheck(Severity.Invalid, "OT Memory: OT did not hatch this.");
return new LegalityCheck(Severity.Valid, "OT Memory is valid.");
case 4: // {0} became {1}s friend when it arrived via Link Trade at... {2}. {4} that {3}.
@ -1054,7 +1054,7 @@ namespace PKHeX
return res;
}
internal static string[] movelist = Util.getStringList("moves", "en");
internal static string[] movelist = Util.getMovesList("en");
private static readonly string[] EventRibName =
{
"Country", "National", "Earth", "World", "Classic",

View file

@ -399,6 +399,7 @@ namespace PKHeX
386, // Deoxys
487, // Giratina
492, // Shaymin
720, // Hoopa
};
internal static readonly int[] BreedMaleOnly =
{
@ -444,6 +445,7 @@ namespace PKHeX
486, // Regigigas
487, // Giratina
488, // Cresselia
490, // Manaphy
491, // Darkrai
492, // Shaymin
493, // Arceus

View file

@ -30,7 +30,7 @@ namespace PKHeX
internal static readonly ushort[] Pouch_Battle_DP = {
55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67
};
internal static readonly ushort[] HeldItems_DP = new ushort[1].Concat(Pouch_Items_DP).Concat(Pouch_Mail_DP).Concat(Pouch_Medicine_DP).Concat(Pouch_Berries_DP).Concat(Pouch_Ball_DP).ToArray();
internal static readonly ushort[] HeldItems_DP = new ushort[1].Concat(Pouch_Items_DP).Concat(Pouch_Mail_DP).Concat(Pouch_Medicine_DP).Concat(Pouch_Berries_DP).Concat(Pouch_Ball_DP).Concat(Pouch_TMHM_DP.Take(Pouch_TMHM_DP.Length - 8)).ToArray();
#endregion
#region Pt
@ -47,7 +47,7 @@ namespace PKHeX
internal static readonly ushort[] Pouch_Ball_Pt = Pouch_Ball_DP;
internal static readonly ushort[] Pouch_Battle_Pt = Pouch_Battle_DP;
internal static readonly ushort[] HeldItems_Pt = new ushort[1].Concat(Pouch_Items_Pt).Concat(Pouch_Mail_Pt).Concat(Pouch_Medicine_Pt).Concat(Pouch_Berries_Pt).Concat(Pouch_Ball_Pt).ToArray();
internal static readonly ushort[] HeldItems_Pt = new ushort[1].Concat(Pouch_Items_Pt).Concat(Pouch_Mail_Pt).Concat(Pouch_Medicine_Pt).Concat(Pouch_Berries_Pt).Concat(Pouch_Ball_Pt).Concat(Pouch_TMHM_Pt.Take(Pouch_TMHM_Pt.Length - 8)).ToArray();
#endregion
#region HGSS
@ -64,7 +64,7 @@ namespace PKHeX
};
internal static readonly ushort[] Pouch_Battle_HGSS = Pouch_Battle_DP;
internal static readonly ushort[] HeldItems_HGSS = new ushort[1].Concat(Pouch_Items_HGSS).Concat(Pouch_Mail_HGSS).Concat(Pouch_Medicine_HGSS).Concat(Pouch_Berries_HGSS).Concat(Pouch_Ball_Pt).ToArray();
internal static readonly ushort[] HeldItems_HGSS = new ushort[1].Concat(Pouch_Items_HGSS).Concat(Pouch_Mail_HGSS).Concat(Pouch_Medicine_HGSS).Concat(Pouch_Berries_HGSS).Concat(Pouch_Ball_Pt).Concat(Pouch_TMHM_HGSS.Take(Pouch_TMHM_HGSS.Length - 8)).ToArray();
#endregion
internal static readonly int[] MovePP_DP =

View file

@ -356,6 +356,7 @@
this.B_OpenSecretBase = new System.Windows.Forms.Button();
this.B_Pokeblocks = new System.Windows.Forms.Button();
this.B_LinkInfo = new System.Windows.Forms.Button();
this.B_CGearSkin = new System.Windows.Forms.Button();
this.dragout = new System.Windows.Forms.PictureBox();
this.mnuL = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mnuLLegality = new System.Windows.Forms.ToolStripMenuItem();
@ -3072,7 +3073,11 @@
this.bpkx30.TabStop = false;
this.bpkx30.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx30.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx30.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx30.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx30.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx30.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx30.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// mnuVSD
//
@ -3116,7 +3121,11 @@
this.bpkx29.TabStop = false;
this.bpkx29.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx29.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx29.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx29.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx29.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx29.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx29.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx28
//
@ -3130,7 +3139,11 @@
this.bpkx28.TabStop = false;
this.bpkx28.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx28.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx28.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx28.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx28.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx28.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx28.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx27
//
@ -3144,7 +3157,11 @@
this.bpkx27.TabStop = false;
this.bpkx27.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx27.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx27.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx27.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx27.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx27.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx27.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx26
//
@ -3158,7 +3175,11 @@
this.bpkx26.TabStop = false;
this.bpkx26.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx26.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx26.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx26.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx26.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx26.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx26.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx25
//
@ -3172,7 +3193,11 @@
this.bpkx25.TabStop = false;
this.bpkx25.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx25.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx25.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx25.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx25.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx25.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx25.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx24
//
@ -3186,7 +3211,11 @@
this.bpkx24.TabStop = false;
this.bpkx24.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx24.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx24.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx24.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx24.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx24.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx24.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx23
//
@ -3200,7 +3229,11 @@
this.bpkx23.TabStop = false;
this.bpkx23.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx23.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx23.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx23.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx23.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx23.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx23.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx22
//
@ -3214,7 +3247,11 @@
this.bpkx22.TabStop = false;
this.bpkx22.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx22.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx22.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx22.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx22.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx22.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx22.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx21
//
@ -3228,7 +3265,11 @@
this.bpkx21.TabStop = false;
this.bpkx21.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx21.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx21.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx21.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx21.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx21.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx21.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx20
//
@ -3242,7 +3283,11 @@
this.bpkx20.TabStop = false;
this.bpkx20.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx20.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx20.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx20.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx20.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx20.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx20.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx19
//
@ -3256,7 +3301,11 @@
this.bpkx19.TabStop = false;
this.bpkx19.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx19.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx19.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx19.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx19.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx19.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx19.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx18
//
@ -3270,7 +3319,11 @@
this.bpkx18.TabStop = false;
this.bpkx18.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx18.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx18.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx18.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx18.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx18.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx18.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx17
//
@ -3284,7 +3337,11 @@
this.bpkx17.TabStop = false;
this.bpkx17.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx17.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx17.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx17.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx17.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx17.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx17.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx16
//
@ -3298,7 +3355,11 @@
this.bpkx16.TabStop = false;
this.bpkx16.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx16.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx16.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx16.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx16.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx16.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx16.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx15
//
@ -3312,7 +3373,11 @@
this.bpkx15.TabStop = false;
this.bpkx15.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx15.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx15.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx15.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx15.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx15.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx15.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx14
//
@ -3326,7 +3391,11 @@
this.bpkx14.TabStop = false;
this.bpkx14.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx14.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx14.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx14.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx14.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx14.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx14.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx13
//
@ -3340,7 +3409,11 @@
this.bpkx13.TabStop = false;
this.bpkx13.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx13.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx13.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx13.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx13.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx13.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx13.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx12
//
@ -3354,7 +3427,11 @@
this.bpkx12.TabStop = false;
this.bpkx12.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx12.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx12.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx12.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx12.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx12.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx12.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx11
//
@ -3368,7 +3445,11 @@
this.bpkx11.TabStop = false;
this.bpkx11.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx11.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx11.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx11.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx11.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx11.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx11.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx10
//
@ -3382,7 +3463,11 @@
this.bpkx10.TabStop = false;
this.bpkx10.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx10.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx10.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx10.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx10.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx10.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx10.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx9
//
@ -3396,7 +3481,11 @@
this.bpkx9.TabStop = false;
this.bpkx9.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx9.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx9.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx9.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx9.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx9.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx9.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx8
//
@ -3410,7 +3499,11 @@
this.bpkx8.TabStop = false;
this.bpkx8.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx8.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx8.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx8.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx8.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx8.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx8.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx7
//
@ -3424,7 +3517,11 @@
this.bpkx7.TabStop = false;
this.bpkx7.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx7.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx7.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx7.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx7.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx7.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx7.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx6
//
@ -3438,7 +3535,11 @@
this.bpkx6.TabStop = false;
this.bpkx6.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx6.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx6.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx6.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx6.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx6.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx6.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx5
//
@ -3452,7 +3553,11 @@
this.bpkx5.TabStop = false;
this.bpkx5.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx5.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx5.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx5.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx5.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx5.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx5.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx4
//
@ -3466,7 +3571,11 @@
this.bpkx4.TabStop = false;
this.bpkx4.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx4.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx4.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx4.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx4.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx3
//
@ -3480,7 +3589,11 @@
this.bpkx3.TabStop = false;
this.bpkx3.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx3.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx3.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx2
//
@ -3494,7 +3607,11 @@
this.bpkx2.TabStop = false;
this.bpkx2.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx2.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx2.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx2.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bpkx1
//
@ -3508,7 +3625,11 @@
this.bpkx1.TabStop = false;
this.bpkx1.DragDrop += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragDrop);
this.bpkx1.DragEnter += new System.Windows.Forms.DragEventHandler(this.pbBoxSlot_DragEnter);
this.bpkx1.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bpkx1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bpkx1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bpkx1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bpkx1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// B_BoxRight
//
@ -3624,7 +3745,11 @@
this.bbpkx1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.bbpkx1.TabIndex = 8;
this.bbpkx1.TabStop = false;
this.bbpkx1.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bbpkx1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bbpkx1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bbpkx1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bbpkx1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// mnuV
//
@ -3649,7 +3774,11 @@
this.bbpkx2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.bbpkx2.TabIndex = 9;
this.bbpkx2.TabStop = false;
this.bbpkx2.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bbpkx2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bbpkx2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bbpkx2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bbpkx2.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bbpkx3
//
@ -3660,7 +3789,11 @@
this.bbpkx3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.bbpkx3.TabIndex = 10;
this.bbpkx3.TabStop = false;
this.bbpkx3.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bbpkx3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bbpkx3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bbpkx3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bbpkx3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bbpkx4
//
@ -3671,7 +3804,11 @@
this.bbpkx4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.bbpkx4.TabIndex = 11;
this.bbpkx4.TabStop = false;
this.bbpkx4.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bbpkx4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bbpkx4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bbpkx4.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bbpkx4.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bbpkx5
//
@ -3682,7 +3819,11 @@
this.bbpkx5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.bbpkx5.TabIndex = 12;
this.bbpkx5.TabStop = false;
this.bbpkx5.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bbpkx5.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bbpkx5.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bbpkx5.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bbpkx5.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// bbpkx6
//
@ -3693,7 +3834,11 @@
this.bbpkx6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.bbpkx6.TabIndex = 13;
this.bbpkx6.TabStop = false;
this.bbpkx6.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.bbpkx6.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.bbpkx6.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.bbpkx6.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.bbpkx6.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// L_ReadOnlyPBB
//
@ -3749,7 +3894,11 @@
this.ppkx1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.ppkx1.TabIndex = 2;
this.ppkx1.TabStop = false;
this.ppkx1.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.ppkx1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.ppkx1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.ppkx1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.ppkx1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// ppkx2
//
@ -3760,7 +3909,11 @@
this.ppkx2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.ppkx2.TabIndex = 3;
this.ppkx2.TabStop = false;
this.ppkx2.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.ppkx2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.ppkx2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.ppkx2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.ppkx2.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// ppkx3
//
@ -3771,7 +3924,11 @@
this.ppkx3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.ppkx3.TabIndex = 4;
this.ppkx3.TabStop = false;
this.ppkx3.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.ppkx3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.ppkx3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.ppkx3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.ppkx3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// ppkx4
//
@ -3782,7 +3939,11 @@
this.ppkx4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.ppkx4.TabIndex = 5;
this.ppkx4.TabStop = false;
this.ppkx4.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.ppkx4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.ppkx4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.ppkx4.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.ppkx4.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// ppkx5
//
@ -3793,7 +3954,11 @@
this.ppkx5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.ppkx5.TabIndex = 6;
this.ppkx5.TabStop = false;
this.ppkx5.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.ppkx5.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.ppkx5.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.ppkx5.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.ppkx5.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// ppkx6
//
@ -3804,7 +3969,11 @@
this.ppkx6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.ppkx6.TabIndex = 7;
this.ppkx6.TabStop = false;
this.ppkx6.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.ppkx6.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.ppkx6.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.ppkx6.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.ppkx6.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// Tab_Other
//
@ -3922,7 +4091,11 @@
this.dcpkx2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.dcpkx2.TabIndex = 11;
this.dcpkx2.TabStop = false;
this.dcpkx2.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.dcpkx2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.dcpkx2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.dcpkx2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.dcpkx2.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// dcpkx1
//
@ -3934,7 +4107,11 @@
this.dcpkx1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.dcpkx1.TabIndex = 10;
this.dcpkx1.TabStop = false;
this.dcpkx1.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.dcpkx1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.dcpkx1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.dcpkx1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.dcpkx1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// DayCare_HasEgg
//
@ -3967,7 +4144,11 @@
this.gtspkx.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.gtspkx.TabIndex = 23;
this.gtspkx.TabStop = false;
this.gtspkx.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.gtspkx.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.gtspkx.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.gtspkx.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.gtspkx.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// GB_Fused
//
@ -3989,7 +4170,11 @@
this.fusedpkx.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.fusedpkx.TabIndex = 24;
this.fusedpkx.TabStop = false;
this.fusedpkx.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.fusedpkx.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.fusedpkx.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.fusedpkx.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.fusedpkx.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// L_ReadOnlyOther
//
@ -4023,7 +4208,11 @@
this.subepkx1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.subepkx1.TabIndex = 18;
this.subepkx1.TabStop = false;
this.subepkx1.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.pbBoxSlot_QueryContinueDrag);
this.subepkx1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseClick);
this.subepkx1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseDown);
this.subepkx1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseMove);
this.subepkx1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pbBoxSlot_MouseUp);
//
// subepkx2
//
@ -4189,6 +4378,7 @@
this.FLP_SAVtools.Controls.Add(this.B_OpenSecretBase);
this.FLP_SAVtools.Controls.Add(this.B_Pokeblocks);
this.FLP_SAVtools.Controls.Add(this.B_LinkInfo);
this.FLP_SAVtools.Controls.Add(this.B_CGearSkin);
this.FLP_SAVtools.Location = new System.Drawing.Point(6, 10);
this.FLP_SAVtools.Name = "FLP_SAVtools";
this.FLP_SAVtools.Size = new System.Drawing.Size(297, 87);
@ -4347,6 +4537,16 @@
this.B_LinkInfo.UseVisualStyleBackColor = true;
this.B_LinkInfo.Click += new System.EventHandler(this.B_LinkInfo_Click);
//
// B_CGearSkin
//
this.B_CGearSkin.Location = new System.Drawing.Point(3, 148);
this.B_CGearSkin.Name = "B_CGearSkin";
this.B_CGearSkin.Size = new System.Drawing.Size(87, 23);
this.B_CGearSkin.TabIndex = 24;
this.B_CGearSkin.Text = "C-Gear Skin";
this.B_CGearSkin.UseVisualStyleBackColor = true;
this.B_CGearSkin.Click += new System.EventHandler(this.B_CGearSkin_Click);
//
// dragout
//
this.dragout.BackColor = System.Drawing.Color.Transparent;
@ -4883,6 +5083,7 @@
private System.Windows.Forms.Button BTN_Medals;
private System.Windows.Forms.FlowLayoutPanel FLP_PKMEditors;
private System.Windows.Forms.Button B_LinkInfo;
private System.Windows.Forms.Button B_CGearSkin;
}
}

View file

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Deployment.Application;
using System.Diagnostics;
using System.Drawing;
using System.IO;
@ -18,7 +17,7 @@ namespace PKHeX
{
#region Initialize Form
new Thread(() => new SplashScreen().ShowDialog()).Start();
pkm_from = SAV.BlankPKM.EncryptedPartyData;
slotPkmSource = SAV.BlankPKM.EncryptedPartyData;
InitializeComponent();
CB_ExtraBytes.SelectedIndex = 0;
SaveFile.SetUpdateDex = Menu_ModifyDex.Checked;
@ -115,11 +114,11 @@ namespace PKHeX
}
if (!SAV.Exportable) // No SAV loaded from exe args
{
string path = detectSaveFile();
string path = SaveUtil.detectSaveFile();
if (path != null && File.Exists(path))
openQuick(path, force: true);
else
GB_SAVtools.Visible = false;
loadSAV(SAV, null);
}
// Splash Screen closes on its own.
@ -177,7 +176,7 @@ namespace PKHeX
#region Path Variables
public static string WorkingDirectory => ApplicationDeployment.IsNetworkDeployed ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "PKHeX") : Environment.CurrentDirectory;
public static string WorkingDirectory => Environment.CurrentDirectory;
public static string DatabasePath => Path.Combine(WorkingDirectory, "db");
private static string WC6DatabasePath => Path.Combine(WorkingDirectory, "wc6");
private static string BackupPath => Path.Combine(WorkingDirectory, "bak");
@ -188,11 +187,22 @@ namespace PKHeX
// Main Menu Strip UI Functions
private void mainMenuOpen(object sender, EventArgs e)
{
string pkx = pkm.Extension;
string ekx = 'e' + pkx.Substring(1, pkx.Length-1);
string supported = "*.pkm;";
for (int i = 3; i <= SAV.Generation; i++)
{
supported += $"*.pk{i}";
if (i != pkm.Format)
supported += ";";
}
OpenFileDialog ofd = new OpenFileDialog
{
Filter = "PKX File|*.pk6;*.pkx" +
"|EKX File|*.ek6;*.ekx" +
"|BIN File|*.bin" +
Filter = $"Decrypted PKM File|{supported}" +
$"|Encrypted PKM File|*.{ekx}" +
"|Binary File|*.bin" +
"|All Files|*.*",
RestoreDirectory = true,
FilterIndex = 4,
@ -204,7 +214,7 @@ namespace PKHeX
ofd.InitialDirectory = WorkingDirectory;
// Detect main
string path = detectSaveFile();
string path = SaveUtil.detectSaveFile();
if (path != null)
{ ofd.InitialDirectory = Path.GetDirectoryName(path); }
else if (File.Exists(Path.Combine(ofd.InitialDirectory, "main")))
@ -219,32 +229,32 @@ namespace PKHeX
{
if (!verifiedPKM()) return;
PKM pk = preparePKM();
string pkx = pk.Extension;
string ekx = 'e' + pkx.Substring(1, pkx.Length - 1);
SaveFileDialog sfd = new SaveFileDialog
{
Filter = "PKX File|*.pk6;*.pkx" +
"|EKX File|*.ek6;*.ekx" +
"|BIN File|*.bin" +
Filter = $"Decrypted PKM File|*.{pkx}" +
$"|Encrypted PKM File|*.{ekx}" +
"|Binary File|*.bin" +
"|All Files|*.*",
DefaultExt = "pk6",
DefaultExt = pkx,
FileName = Util.CleanFileName(pk.FileName)
};
if (sfd.ShowDialog() != DialogResult.OK) return;
string path = sfd.FileName;
// Injection Dummy Override
if (path.Contains("pokemon.ekx")) path = Path.Combine(Path.GetDirectoryName(path), "pokemon.ekx");
string ext = Path.GetExtension(path);
if (File.Exists(path) && !path.Contains("pokemon.ekx"))
if (File.Exists(path))
{
// File already exists, save a .bak
byte[] backupfile = File.ReadAllBytes(path);
File.WriteAllBytes(path + ".bak", backupfile);
}
if (new[] {".ekx", ".ek6", ".bin"}.Contains(ext))
if (new[] {".ekx", "."+ekx, ".bin"}.Contains(ext))
File.WriteAllBytes(path, pk.EncryptedPartyData);
else if (new[] { ".pkx", ".pk6" }.Contains(ext))
File.WriteAllBytes(path, pk.Data);
else if (new[] { "."+pkx }.Contains(ext))
File.WriteAllBytes(path, pk.DecryptedBoxData);
else
{
Util.Error($"Foreign File Extension: {ext}", "Exporting as encrypted.");
@ -253,7 +263,7 @@ namespace PKHeX
}
private void mainMenuExit(object sender, EventArgs e)
{
if (ModifierKeys == (Keys.Control | Keys.Q)) // Hotkey Triggered
if (ModifierKeys == Keys.Control) // Hotkey Triggered
if (DialogResult.Yes != Util.Prompt(MessageBoxButtons.YesNo, "Quit PKHeX?")) return;
Close();
}
@ -279,11 +289,11 @@ namespace PKHeX
if (z != null)
{ Util.CenterToForm(z, this); z.BringToFront(); return; }
if (Directory.Exists("db"))
if (Directory.Exists(DatabasePath))
new SAV_Database(this).Show();
else
Util.Alert("PKHeX's database was not found",
"Please dump all boxes from a save file, then ensure the 'db' folder exists.");
Util.Alert("PKHeX's database was not found.",
$"Please dump all boxes from a save file, then ensure the '{DatabasePath}' folder exists.");
}
private void mainMenuUnicode(object sender, EventArgs e)
{
@ -488,17 +498,17 @@ namespace PKHeX
}
private void clickOpenSDFFolder(object sender, EventArgs e)
{
string path;
if (Util.get3DSLocation() != null && Directory.Exists(path = Util.GetSDFLocation()))
string path = Path.GetPathRoot(Util.get3DSLocation());
if (path != null && Directory.Exists(path = Path.Combine(path, "filer", "UserSaveData")))
Process.Start("explorer.exe", path);
else
Util.Alert("Can't find the SaveDataFiler folder.");
}
private void clickOpenSDBFolder(object sender, EventArgs e)
{
string path3DS = Util.get3DSLocation();
string path3DS = Path.GetPathRoot(Util.get3DSLocation());
string path;
if (path3DS != null && Directory.Exists(path = Path.Combine(Path.GetPathRoot(path3DS), "SaveDataBackup")))
if (path3DS != null && Directory.Exists(path = Path.Combine(path3DS, "SaveDataBackup")))
Process.Start("explorer.exe", path);
else
Util.Alert("Can't find the SaveDataBackup folder.");
@ -605,7 +615,7 @@ namespace PKHeX
if (SAV.Generation < 6)
{ Util.Alert("Cannot load a Gen6 Battle Video to a past generation save file."); return; }
if (Util.Prompt(MessageBoxButtons.YesNo, "Load Batte Video Pokémon data to " + CB_BoxSelect.Text + "?", "The box will be overwritten.") != DialogResult.Yes)
if (Util.Prompt(MessageBoxButtons.YesNo, "Load Battle Video Pokémon data to " + CB_BoxSelect.Text + "?", "The box will be overwritten.") != DialogResult.Yes)
return;
bool? noSetb = getPKMSetOverride();
@ -709,11 +719,11 @@ namespace PKHeX
"Cancel: FireRed / LeafGreen");
if (drGame == DialogResult.Yes)
sav = new SAV3(sav.Data, GameVersion.RS);
sav = new SAV3(sav.BAK, GameVersion.RS);
else if (drGame == DialogResult.No)
sav = new SAV3(sav.Data, GameVersion.E);
sav = new SAV3(sav.BAK, GameVersion.E);
else
sav = new SAV3(sav.Data, GameVersion.FRLG);
sav = new SAV3(sav.BAK, GameVersion.FRLG);
}
var drJP = Util.Prompt(MessageBoxButtons.YesNoCancel, $"Generation 3 ({sav.Version}) Save File detected. Select Origins:", "Yes: International" + Environment.NewLine + "No: Japanese");
if (drJP == DialogResult.Cancel)
@ -729,34 +739,56 @@ namespace PKHeX
sav.Personal = drFRLG == DialogResult.Yes ? PersonalTable.FR : PersonalTable.LG;
}
}
loadSAV(sav, path);
}
private void loadSAV(SaveFile sav, string path)
{
PKM pk = preparePKM();
SAV = sav;
if (path != null) // Actual save file
{
SAV.FilePath = Path.GetDirectoryName(path);
SAV.FileName = Path.GetExtension(path) == ".bak"
? Path.GetFileName(path)?.Split(new[] {" ["}, StringSplitOptions.None)[0]
? Path.GetFileName(path).Split(new[] { " [" }, StringSplitOptions.None)[0]
: Path.GetFileName(path);
L_Save.Text = $"SAV{SAV.Generation}: {Path.GetFileNameWithoutExtension(Util.CleanFileName(SAV.BAKName))}"; // more descriptive
// If backup folder exists, save a backup.
string backupName = Path.Combine(BackupPath, Util.CleanFileName(SAV.BAKName));
if (SAV.Exportable && Directory.Exists(BackupPath) && !File.Exists(backupName))
File.WriteAllBytes(backupName, SAV.BAK);
GB_SAVtools.Visible = true;
}
else // Blank save file
{
SAV.FilePath = null;
SAV.FileName = "Blank Save File";
L_Save.Text = $"SAV{SAV.Generation}: {SAV.FileName} [{SAV.OT} ({SAV.Version})]";
GB_SAVtools.Visible = false;
}
Menu_ExportSAV.Enabled = B_VerifyCHK.Enabled = SAV.Exportable;
setBoxNames(); // Display the Box Names
if (SAV.HasBox)
{
int startBox = SAV.CurrentBox; // FF if BattleBox
int startBox = path == null ? 0 : SAV.CurrentBox; // FF if BattleBox
if (startBox > SAV.BoxCount - 1) { tabBoxMulti.SelectedIndex = 1; CB_BoxSelect.SelectedIndex = 0; }
else { tabBoxMulti.SelectedIndex = 0; CB_BoxSelect.SelectedIndex = startBox; }
}
setPKXBoxes(); // Reload all of the PKX Windows
// Hide content if not present in game.
GB_SAVtools.Visible = true;
GB_SUBE.Visible = SAV.HasSUBE;
PB_Locked.Visible = SAV.HasBattleBox && SAV.BattleBoxLocked;
PAN_Box.Visible = CB_BoxSelect.Visible = B_BoxLeft.Visible = B_BoxRight.Visible = SAV.HasBox;
Menu_LoadBoxes.Enabled = Menu_DumpBoxes.Enabled = Menu_Report.Enabled = Menu_Modify.Enabled = B_SaveBoxBin.Enabled = SAV.HasBox;
if (GB_SAVtools.Visible)
{
PAN_BattleBox.Visible = L_BattleBox.Visible = L_ReadOnlyPBB.Visible = SAV.HasBattleBox;
GB_Daycare.Visible = SAV.HasDaycare;
GB_Fused.Visible = SAV.HasFused;
@ -775,6 +807,8 @@ namespace PKHeX
B_JPEG.Visible = SAV.HasJPEG;
B_OpenEventFlags.Visible = SAV.HasEvents;
B_LinkInfo.Visible = SAV.HasLink;
B_CGearSkin.Visible = SAV.Generation == 5;
}
// Generational Interface
byte[] extraBytes = new byte[1];
@ -788,7 +822,7 @@ namespace PKHeX
PB_MarkPentagon.Visible = SAV.Generation == 6;
PB_Legal.Visible = PB_WarnMove1.Visible = PB_WarnMove2.Visible = PB_WarnMove3.Visible = PB_WarnMove4.Visible = SAV.Generation == 6;
TB_GameSync.Visible = TB_Secure1.Visible = TB_Secure2.Visible = L_GameSync.Visible = L_Secure1.Visible = L_Secure2.Visible = SAV.Generation == 6;
TB_GameSync.Visible = TB_Secure1.Visible = TB_Secure2.Visible = L_GameSync.Visible = L_Secure1.Visible = L_Secure2.Visible = SAV.Exportable && SAV.Generation == 6;
CB_Form.Visible = Label_Form.Visible = CHK_AsEgg.Visible = GB_EggConditions.Visible =
Label_MetDate.Visible = CAL_MetDate.Visible = PB_Mark5.Visible = PB_Mark6.Visible = SAV.Generation >= 4;
@ -854,11 +888,6 @@ namespace PKHeX
// Refresh PK#->PK6 conversion info
PKMConverter.updateConfig(SAV.SubRegion, SAV.Country, SAV.ConsoleRegion, SAV.OT, SAV.Gender);
// If backup folder exists, save a backup.
string backupName = Path.Combine(BackupPath, Util.CleanFileName(SAV.BAKName));
if (SAV.Exportable && Directory.Exists(BackupPath) && !File.Exists(backupName))
File.WriteAllBytes(backupName, SAV.BAK);
// Indicate audibly the save is loaded
SystemSounds.Beep.Play();
}
@ -867,10 +896,18 @@ namespace PKHeX
List<WC6> wc6db = new List<WC6>();
byte[] wc6bin = Properties.Resources.wc6;
for (int i = 0; i < wc6bin.Length; i += WC6.Size)
wc6db.Add(new WC6(wc6bin.Skip(i).Take(WC6.Size).ToArray()));
{
byte[] data = new byte[WC6.Size];
Array.Copy(wc6bin, i, data, 0, WC6.Size);
wc6db.Add(new WC6(data));
}
byte[] wc6full = Properties.Resources.wc6full;
for (int i = 0; i < wc6full.Length; i += WC6.SizeFull)
wc6db.Add(new WC6(wc6full.Skip(i).Take(WC6.SizeFull).ToArray()));
{
byte[] data = new byte[WC6.SizeFull];
Array.Copy(wc6bin, i, data, 0, WC6.SizeFull);
wc6db.Add(new WC6(data));
}
if (Directory.Exists(WC6DatabasePath))
wc6db.AddRange(from file in Directory.GetFiles(WC6DatabasePath, "*", SearchOption.AllDirectories)
@ -909,11 +946,11 @@ namespace PKHeX
string l = curlanguage;
natures = Util.getStringList("natures", l);
types = Util.getStringList("types", l);
abilitylist = Util.getStringList("abilities", l);
movelist = Util.getStringList("moves", l);
abilitylist = Util.getAbilitiesList(l);
movelist = Util.getMovesList(l);
itemlist = Util.getStringList("items", l);
characteristics = Util.getStringList("character", l);
specieslist = Util.getStringList("species", l);
specieslist = Util.getSpeciesList(l);
wallpapernames = Util.getStringList("wallpaper", l);
encountertypelist = Util.getStringList("encountertype", l);
gamelist = Util.getStringList("games", l);
@ -1616,13 +1653,13 @@ namespace PKHeX
pkm.setPIDGender(pkm.Gender);
TB_PID.Text = pkm.PID.ToString("X8");
getQuickFiller(dragout);
if (pkm.Format >= 6)
TB_EC.Text = pkm.EncryptionConstant.ToString("X8");
if (pkm.GenNumber < 6 && TB_EC.Visible)
TB_EC.Text = TB_PID.Text;
}
private void updateRandomEC(object sender, EventArgs e)
{
int origin = Util.getIndex(CB_GameOrigin);
if (origin < 24)
pkm.Version = Util.getIndex(CB_GameOrigin);
if (pkm.GenNumber < 6)
{
TB_EC.Text = TB_PID.Text;
Util.Alert("EC should match PID.");
@ -2089,11 +2126,12 @@ namespace PKHeX
pkm.Nature = Util.getIndex(CB_Nature);
pkm.Gender = PKX.getGender(Label_Gender.Text);
pkm.AltForm = CB_Form.SelectedIndex;
pkm.Version = Util.getIndex(CB_GameOrigin);
pkm.setShinyPID();
TB_PID.Text = pkm.PID.ToString("X8");
if (pkm.Format >= 6)
if (pkm.GenNumber < 6 && TB_EC.Visible)
TB_EC.Text = TB_PID.Text;
getQuickFiller(dragout);
@ -2161,6 +2199,8 @@ namespace PKHeX
}
private void validateComboBox2(object sender, EventArgs e)
{
if (!fieldsInitialized)
return;
validateComboBox(sender, e);
if (sender == CB_Ability)
TB_AbilityNumber.Text = (1 << CB_Ability.SelectedIndex).ToString();
@ -2171,6 +2211,8 @@ namespace PKHeX
}
private void validateMove(object sender, EventArgs e)
{
if (!fieldsInitialized)
return;
validateComboBox(sender);
if (!fieldsLoaded)
return;
@ -2391,7 +2433,10 @@ namespace PKHeX
// Drag & Drop Events
private void tabMain_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy;
if (e.AllowedEffect == (DragDropEffects.Copy | DragDropEffects.Link)) // external file
e.Effect = DragDropEffects.Copy;
else if (e.Data != null) // within
e.Effect = DragDropEffects.Move;
}
private void tabMain_DragDrop(object sender, DragEventArgs e)
{
@ -2787,7 +2832,7 @@ namespace PKHeX
for (int i = 0; i < battle.Length; i++)
getQuickFiller(SlotPictureBoxes[i + 36], battle[i]);
for (int i = battle.Length; i < 6; i++)
SlotPictureBoxes[i + 30].Image = null;
SlotPictureBoxes[i + 36].Image = null;
}
}
private int getPKXOffset(int slot)
@ -3224,6 +3269,10 @@ namespace PKHeX
{
new SAV_Link6().ShowDialog();
}
private void B_CGearSkin_Click(object sender, EventArgs e)
{
new SAV_CGearSkin().ShowDialog();
}
private void B_JPEG_Click(object sender, EventArgs e)
{
byte[] jpeg = SAV.JPEGData;
@ -3237,58 +3286,60 @@ namespace PKHeX
// Save Folder Related
private void clickSaveFileName(object sender, EventArgs e)
{
string path = detectSaveFile();
string path = SaveUtil.detectSaveFile();
if (path == null || !File.Exists(path)) return;
if (Util.Prompt(MessageBoxButtons.YesNo, "Open save file from the following location?", path) == DialogResult.Yes)
openQuick(path); // load save
}
private static string detectSaveFile()
{
string pathSDF = Util.GetSDFLocation();
string path3DS = Util.get3DSLocation();
string pathCache = Util.GetCacheFolder();
if (path3DS != null && Directory.Exists(Path.Combine(path3DS, "SaveDataBackup")) && ModifierKeys != Keys.Control)
return Path.Combine(Path.GetPathRoot(path3DS), "SaveDataBackup", "main");
if (pathSDF != null && ModifierKeys != Keys.Shift) // if we have a result
return Path.Combine(pathSDF, "main");
if (path3DS != null && Directory.Exists(Path.Combine(Path.GetPathRoot(path3DS), "JKSV", "Saves")))
return Directory.GetFiles(Path.Combine(Path.GetPathRoot(path3DS), "JKSV", "Saves"), "main", SearchOption.AllDirectories)
.Where(f => SaveUtil.SizeValidSAV6((int)new FileInfo(f).Length)) // filter
.OrderByDescending(f => new FileInfo(f).LastWriteTime).FirstOrDefault();
if (Directory.Exists(pathCache))
return Directory.GetFiles(pathCache).Where(f => SaveUtil.SizeValidSAV6((int)new FileInfo(f).Length)) // filter
.OrderByDescending(f => new FileInfo(f).LastWriteTime).FirstOrDefault();
try
// Drag and drop related functions
private void pbBoxSlot_MouseClick(object sender, MouseEventArgs e)
{
if (File.Exists(Util.NormalizePath(Path.Combine(Util.GetTempFolder(), "root", "main")))) // if cgse exists
return Util.NormalizePath(Path.Combine(Util.GetTempFolder(), "root", "main"));
} catch { }
return null;
}
// Drag & Drop within Box
private void pbBoxSlot_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left || e.Clicks != 1) return;
if (ModifierKeys == Keys.Control || ModifierKeys == Keys.Alt || ModifierKeys == Keys.Shift || ModifierKeys == (Keys.Control | Keys.Alt))
{ clickSlot(sender, e); return; }
PictureBox pb = (PictureBox)sender;
if (pb.Image == null)
if (slotDragDropInProgress)
return;
pkm_from_slot = getSlot(sender);
int offset = getPKXOffset(pkm_from_slot);
// Create Temp File to Drag
Cursor.Current = Cursors.Hand;
clickSlot(sender, e);
}
private void pbBoxSlot_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
slotLeftMouseIsDown = false;
if (e.Button == MouseButtons.Right)
slotRightMouseIsDown = false;
}
private void pbBoxSlot_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
slotLeftMouseIsDown = true;
if (e.Button == MouseButtons.Right)
slotRightMouseIsDown = true;
}
private void pbBoxSlot_MouseMove(object sender, MouseEventArgs e)
{
if (slotDragDropInProgress)
return;
if (slotLeftMouseIsDown)
{
// The goal is to create a temporary PKX file for the underlying Pokemon
// and use that file to perform a drag drop operation.
// Abort if there is no Pokemon in the given slot.
if (((PictureBox)sender).Image == null)
return;
// Set flag to prevent re-entering.
slotDragDropInProgress = true;
slotSourceSlotNumber = getSlot(sender);
int offset = getPKXOffset(slotSourceSlotNumber);
// Prepare Data
pkm_from = SAV.getData(offset, SAV.SIZE_STORED);
pkm_from_offset = offset;
slotPkmSource = SAV.getData(offset, SAV.SIZE_STORED);
slotSourceOffset = offset;
// Make a new file name based off the PID
byte[] dragdata = SAV.decryptPKM(pkm_from);
byte[] dragdata = SAV.decryptPKM(slotPkmSource);
Array.Resize(ref dragdata, SAV.SIZE_STORED);
PKM pkx = SAV.getPKM(dragdata);
string filename = pkx.FileName;
@ -3298,11 +3349,14 @@ namespace PKHeX
try
{
File.WriteAllBytes(newfile, dragdata);
DoDragDrop(new DataObject(DataFormats.FileDrop, new[] { newfile }), DragDropEffects.Move);
// Thread Blocks on DoDragDrop
((PictureBox)sender).DoDragDrop(new DataObject(DataFormats.FileDrop, new[] { newfile }), DragDropEffects.Move);
}
catch (ArgumentException x)
{ Util.Error("Drag & Drop Error:", x.ToString()); }
pkm_from_offset = 0;
catch (Exception x)
{
Util.Error("Drag & Drop Error:", x.ToString());
}
slotSourceOffset = 0;
// Browser apps need time to load data since the file isn't moved to a location on the user's local storage.
// Tested 10ms -> too quick, 100ms was fine. 500ms should be safe?
@ -3313,21 +3367,22 @@ namespace PKHeX
File.Delete(newfile);
}).Start();
}
}
private void pbBoxSlot_DragDrop(object sender, DragEventArgs e)
{
int slot = getSlot(sender);
int offset = getPKXOffset(slot);
int slotDestinationSlotNumber = getSlot(sender);
int slotDestinationOffset = getPKXOffset(slotDestinationSlotNumber);
// Check for In-Dropped files (PKX,SAV,ETC)
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
if (Directory.Exists(files[0])) { loadBoxesFromDB(files[0]); return; }
if (pkm_from_offset == 0)
if (slotSourceOffset == 0)
{
if (files.Length <= 0)
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);
@ -3347,36 +3402,45 @@ namespace PKHeX
{ Console.WriteLine(c); Console.WriteLine(concat); return; }
}
SAV.setStoredSlot(pk, offset);
getQuickFiller(SlotPictureBoxes[slot], pk);
getSlotColor(slot, Properties.Resources.slotSet);
SAV.setStoredSlot(pk, slotDestinationOffset);
getQuickFiller(SlotPictureBoxes[slotDestinationSlotNumber], pk);
getSlotColor(slotDestinationSlotNumber, Properties.Resources.slotSet);
Console.WriteLine(c);
}
else
{
PKM pkz = SAV.getStoredSlot(pkm_from_offset);
if (ModifierKeys == Keys.Alt && slot > -1) // overwrite delete old slot
PKM pkz = SAV.getStoredSlot(slotSourceOffset);
if (ModifierKeys == Keys.Alt && slotDestinationSlotNumber > -1) // overwrite delete old slot
{
// Clear from slot
getQuickFiller(SlotPictureBoxes[pkm_from_slot], SAV.BlankPKM); // picturebox
SAV.setStoredSlot(SAV.BlankPKM, pkm_from_offset); // savefile
getQuickFiller(SlotPictureBoxes[slotSourceSlotNumber], SAV.BlankPKM); // picturebox
SAV.setStoredSlot(SAV.BlankPKM, slotSourceOffset); // savefile
}
else if (ModifierKeys != Keys.Control && slot > -1)
else if (ModifierKeys != Keys.Control && slotDestinationSlotNumber > -1)
{
if (((PictureBox)sender).Image != null)
{
// Load data from destination
PKM pk = SAV.getStoredSlot(offset);
PKM pk = SAV.getStoredSlot(slotDestinationOffset);
// Swap slot picture
getQuickFiller(SlotPictureBoxes[pkm_from_slot], pk);
// Set destination pokemon image to source picture box
getQuickFiller(SlotPictureBoxes[slotSourceSlotNumber], pk);
// Swap slot data to source
SAV.setStoredSlot(pk, pkm_from_offset);
// Set destination pokemon data to source slot
SAV.setStoredSlot(pk, slotSourceOffset);
}
// Copy from temp slot to new.
SAV.setStoredSlot(pkz, offset);
getQuickFiller(SlotPictureBoxes[slot], pkz);
else
{
// Set blank to source slot
SAV.setStoredSlot(SAV.BlankPKM, slotSourceOffset);
SlotPictureBoxes[slotSourceSlotNumber].Image = null;
}
}
// Copy from temp to destination slot.
SAV.setStoredSlot(pkz, slotDestinationOffset);
getQuickFiller(SlotPictureBoxes[slotDestinationSlotNumber], pkz);
pkm_from_offset = 0; // Clear offset value
slotSourceOffset = 0; // Clear offset value
}
}
private void pbBoxSlot_DragEnter(object sender, DragEventArgs e)
@ -3386,10 +3450,22 @@ namespace PKHeX
else if (e.Data != null) // within
e.Effect = DragDropEffects.Move;
}
private void pbBoxSlot_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
if (e.Action == DragAction.Cancel || e.Action == DragAction.Drop)
{
slotLeftMouseIsDown = false;
slotRightMouseIsDown = false;
slotDragDropInProgress = false;
}
}
private byte[] pkm_from;
private int pkm_from_offset;
private int pkm_from_slot = -1;
private static bool slotLeftMouseIsDown = false;
private static bool slotRightMouseIsDown = false;
private static bool slotDragDropInProgress = false;
private byte[] slotPkmSource;
private int slotSourceOffset;
private int slotSourceSlotNumber = -1;
#endregion
}
}

View file

@ -1306,6 +1306,9 @@
<metadata name="B_LinkInfo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="B_CGearSkin.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dragout.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View file

@ -41,10 +41,14 @@ namespace PKHeX
CB_EncounterType.SelectedValue = pk4.Gen4 ? pk4.EncounterType : 0;
CB_Ball.SelectedValue = pk4.Ball;
if (pk4.Met_Month == 0) { pk4.Met_Month = 1; }
if (pk4.Met_Day == 0) { pk4.Met_Day = 1; }
try { CAL_MetDate.Value = new DateTime(pk4.Met_Year + 2000, pk4.Met_Month, pk4.Met_Day); }
catch { CAL_MetDate.Value = new DateTime(2000, 1, 1); }
if (pk4.MetDate.HasValue)
{
CAL_MetDate.Value = pk4.MetDate.Value;
}
else
{
CAL_MetDate.Value = new DateTime(2000, 1, 1);
}
if (pk4.Egg_Location != 0)
{
@ -53,8 +57,14 @@ namespace PKHeX
GB_EggConditions.Enabled = true;
CB_EggLocation.SelectedValue = pk4.Egg_Location;
try { CAL_EggDate.Value = new DateTime(pk4.Egg_Year + 2000, pk4.Egg_Month, pk4.Egg_Day); }
catch { CAL_MetDate.Value = new DateTime(2000, 1, 1); }
if (pk4.EggMetDate.HasValue)
{
CAL_EggDate.Value = pk4.EggMetDate.Value;
}
else
{
CAL_EggDate.Value = new DateTime(2000, 1, 1);
}
}
else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; }
@ -194,30 +204,22 @@ namespace PKHeX
pk4.Language = Util.getIndex(CB_Language);
// Default Dates
int egg_year = 2000;
int egg_month = 0;
int egg_day = 0;
DateTime? egg_date = null;
int egg_location = 0;
if (CHK_AsEgg.Checked) // If encountered as an egg, load the Egg Met data from fields.
{
egg_year = CAL_EggDate.Value.Year;
egg_month = CAL_EggDate.Value.Month;
egg_day = CAL_EggDate.Value.Day;
egg_date = CAL_EggDate.Value;
egg_location = Util.getIndex(CB_EggLocation);
}
// Egg Met Data
pk4.Egg_Year = egg_year - 2000;
pk4.Egg_Month = egg_month;
pk4.Egg_Day = egg_day;
pk4.EggMetDate = egg_date;
pk4.Egg_Location = egg_location;
// Met Data
pk4.Met_Year = CAL_MetDate.Value.Year - 2000;
pk4.Met_Month = CAL_MetDate.Value.Month;
pk4.Met_Day = CAL_MetDate.Value.Day;
pk4.MetDate = CAL_MetDate.Value;
pk4.Met_Location = Util.getIndex(CB_MetLocation);
if (pk4.IsEgg && pk4.Met_Location == 0) // If still an egg, it has no hatch location/date. Zero it!
pk4.Met_Year = pk4.Met_Month = pk4.Met_Day = 0;
pk4.MetDate = null;
// Toss in Party Stats
Array.Resize(ref pk4.Data, pk4.SIZE_PARTY);

View file

@ -50,10 +50,14 @@ namespace PKHeX
CB_EncounterType.SelectedValue = pk5.Gen4 ? pk5.EncounterType : 0;
CB_Ball.SelectedValue = pk5.Ball;
if (pk5.Met_Month == 0) { pk5.Met_Month = 1; }
if (pk5.Met_Day == 0) { pk5.Met_Day = 1; }
try { CAL_MetDate.Value = new DateTime(pk5.Met_Year + 2000, pk5.Met_Month, pk5.Met_Day); }
catch { CAL_MetDate.Value = new DateTime(2000, 1, 1); }
if (pk5.MetDate.HasValue)
{
CAL_MetDate.Value = pk5.MetDate.Value;
}
else
{
CAL_MetDate.Value = new DateTime(2000, 1, 1);
}
if (pk5.Egg_Location != 0)
{
@ -62,8 +66,14 @@ namespace PKHeX
GB_EggConditions.Enabled = true;
CB_EggLocation.SelectedValue = pk5.Egg_Location;
try { CAL_EggDate.Value = new DateTime(pk5.Egg_Year + 2000, pk5.Egg_Month, pk5.Egg_Day); }
catch { CAL_MetDate.Value = new DateTime(2000, 1, 1); }
if (pk5.EggMetDate.HasValue)
{
CAL_EggDate.Value = pk5.EggMetDate.Value;
}
else
{
CAL_EggDate.Value = new DateTime(2000, 1, 1);
}
}
else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; }
@ -200,30 +210,22 @@ namespace PKHeX
pk5.CurrentFriendship = Util.ToInt32(TB_Friendship.Text);
// Default Dates
int egg_year = 2000;
int egg_month = 0;
int egg_day = 0;
DateTime? egg_date = null;
int egg_location = 0;
if (CHK_AsEgg.Checked) // If encountered as an egg, load the Egg Met data from fields.
{
egg_year = CAL_EggDate.Value.Year;
egg_month = CAL_EggDate.Value.Month;
egg_day = CAL_EggDate.Value.Day;
egg_date = CAL_EggDate.Value;
egg_location = Util.getIndex(CB_EggLocation);
}
// Egg Met Data
pk5.Egg_Year = egg_year - 2000;
pk5.Egg_Month = egg_month;
pk5.Egg_Day = egg_day;
pk5.EggMetDate = egg_date;
pk5.Egg_Location = egg_location;
// Met Data
pk5.Met_Year = CAL_MetDate.Value.Year - 2000;
pk5.Met_Month = CAL_MetDate.Value.Month;
pk5.Met_Day = CAL_MetDate.Value.Day;
pk5.MetDate = CAL_MetDate.Value;
pk5.Met_Location = Util.getIndex(CB_MetLocation);
if (pk5.IsEgg && pk5.Met_Location == 0) // If still an egg, it has no hatch location/date. Zero it!
pk5.Met_Year = pk5.Met_Month = pk5.Met_Day = 0;
pk5.MetDate = null;
pk5.Ball = Util.getIndex(CB_Ball);
pk5.Met_Level = Util.ToInt32(TB_MetLevel.Text);

View file

@ -57,10 +57,14 @@ namespace PKHeX
CB_EncounterType.SelectedValue = pk6.Gen4 ? pk6.EncounterType : 0;
CB_Ball.SelectedValue = pk6.Ball;
if (pk6.Met_Month == 0) { pk6.Met_Month = 1; }
if (pk6.Met_Day == 0) { pk6.Met_Day = 1; }
try { CAL_MetDate.Value = new DateTime(pk6.Met_Year + 2000, pk6.Met_Month, pk6.Met_Day); }
catch { CAL_MetDate.Value = new DateTime(2000, 1, 1); }
if (pk6.MetDate.HasValue)
{
CAL_MetDate.Value = pk6.MetDate.Value;
}
else
{
CAL_MetDate.Value = new DateTime(2000, 1, 1);
}
if (pk6.Egg_Location != 0)
{
@ -69,8 +73,14 @@ namespace PKHeX
GB_EggConditions.Enabled = true;
CB_EggLocation.SelectedValue = pk6.Egg_Location;
try { CAL_EggDate.Value = new DateTime(pk6.Egg_Year + 2000, pk6.Egg_Month, pk6.Egg_Day); }
catch { CAL_MetDate.Value = new DateTime(2000, 1, 1); }
if (pk6.EggMetDate.HasValue)
{
CAL_EggDate.Value = pk6.EggMetDate.Value;
}
else
{
CAL_EggDate.Value = new DateTime(2000, 1, 1);
}
}
else { CAL_EggDate.Value = new DateTime(2000, 01, 01); CHK_AsEgg.Checked = GB_EggConditions.Enabled = false; CB_EggLocation.SelectedValue = 0; }
@ -263,30 +273,22 @@ namespace PKHeX
pk6.OT_Name = TB_OT.Text;
pk6.CurrentFriendship = Util.ToInt32(TB_Friendship.Text);
int egg_year = 2000; // Default Dates
int egg_month = 0;
int egg_day = 0;
DateTime? egg_date = null;
int egg_location = 0;
if (CHK_AsEgg.Checked) // If encountered as an egg, load the Egg Met data from fields.
{
egg_year = CAL_EggDate.Value.Year;
egg_month = CAL_EggDate.Value.Month;
egg_day = CAL_EggDate.Value.Day;
egg_date = CAL_EggDate.Value;
egg_location = Util.getIndex(CB_EggLocation);
}
// Egg Met Data
pk6.Egg_Year = egg_year - 2000;
pk6.Egg_Month = egg_month;
pk6.Egg_Day = egg_day;
pk6.EggMetDate = egg_date;
pk6.Egg_Location = egg_location;
// Met Data
pk6.Met_Year = CAL_MetDate.Value.Year - 2000;
pk6.Met_Month = CAL_MetDate.Value.Month;
pk6.Met_Day = CAL_MetDate.Value.Day;
pk6.MetDate = CAL_MetDate.Value;
pk6.Met_Location = Util.getIndex(CB_MetLocation);
if (pk6.IsEgg && pk6.Met_Location == 0) // If still an egg, it has no hatch location/date. Zero it!
pk6.Met_Year = pk6.Met_Month = pk6.Met_Day = 0;
pk6.MetDate = null;
// 0xD7 Unknown

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")

View file

@ -90,9 +90,44 @@ namespace PKHeX
// Card Attributes
public override int Item { get { return BitConverter.ToUInt16(Data, 0x00); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x00); } }
public ushort Year { get { return BitConverter.ToUInt16(Data, 0xAE); } set { BitConverter.GetBytes(value).CopyTo(Data, 0xAE); } }
public byte Month { get { return Data[0xAD]; } set { Data[0xAD] = value; } }
public byte Day { get { return Data[0xAC]; } set { Data[0xAC] = value; } }
private ushort Year { get { return BitConverter.ToUInt16(Data, 0xAE); } set { BitConverter.GetBytes(value).CopyTo(Data, 0xAE); } }
private byte Month { get { return Data[0xAD]; } set { Data[0xAD] = value; } }
private byte Day { get { return Data[0xAC]; } set { Data[0xAC] = value; } }
/// <summary>
/// Gets or sets the date of the card.
/// </summary>
public DateTime? Date
{
get
{
// Check to see if date is valid
if (!Util.IsDateValid(Year, Month, Day))
return null;
return new DateTime(Year, Month, Day);
}
set
{
if (value.HasValue)
{
// Only update the properties if a value is provided.
Year = (ushort)value.Value.Year;
Month = (byte)value.Value.Month;
Day = (byte)value.Value.Day;
}
else
{
// Clear the Met Date.
// If code tries to access MetDate again, null will be returned.
Year = 0;
Month = 0;
Day = 0;
}
}
}
public override int CardID
{
get { return BitConverter.ToUInt16(Data, 0xB0); }
@ -151,9 +186,7 @@ namespace PKHeX
Move3 = Move3,
Move4 = Move4,
Met_Location = MetLocation,
Met_Day = Day,
Met_Month = Month,
Met_Year = Year - 2000,
MetDate = Date,
Egg_Location = EggLocation,
CNT_Cool = CNT_Cool,
CNT_Beauty = CNT_Beauty,
@ -255,9 +288,7 @@ namespace PKHeX
if (IsEgg)
{
// pk.IsEgg = true;
pk.Egg_Day = Day;
pk.Egg_Month = Month;
pk.Egg_Year = Year - 2000;
pk.EggMetDate = Date;
// Force hatch
pk.IsEgg = false;
pk.Met_Location = 4; // Nuvema Town

View file

@ -181,22 +181,17 @@ namespace PKHeX
}
// Generate Met Info
DateTime dt = DateTime.Now;
if (IsPokémon)
{
pk4.Met_Location = pk4.Egg_Location + 3000;
pk4.Egg_Location = 0;
pk4.Met_Day = dt.Day;
pk4.Met_Month = dt.Month;
pk4.Met_Year = dt.Year - 2000;
pk4.MetDate = DateTime.Now;
pk4.IsEgg = false;
}
else
{
pk4.Egg_Location = pk4.Egg_Location + 3000;
pk4.Egg_Day = dt.Day;
pk4.Egg_Month = dt.Month;
pk4.Egg_Year = dt.Year - 2000;
pk4.MetDate = DateTime.Now;
pk4.IsEgg = false;
// Met Location is modified when transferred to pk5; don't worry about it.
}

View file

@ -31,18 +31,52 @@ namespace PKHeX
public override string CardTitle { // Max len 36 char, followed by null terminator
get { return Util.TrimFromZero(Encoding.Unicode.GetString(Data, 2, 72)); }
set { Encoding.Unicode.GetBytes(value.PadRight(36, '\0')).CopyTo(Data, 2); } }
private uint Date {
private uint RawDate {
get { return BitConverter.ToUInt32(Data, 0x4C); }
set { BitConverter.GetBytes(value).CopyTo(Data, 0x4C); } }
public uint Year {
get { return Date/10000; }
set { Date = value*10000 + Date%10000; } }
public uint Month {
get { return Date%10000/100; }
set { Date = Year*10000 + value*100 + Date%100; } }
public uint Day {
get { return Date%100; }
set { Date = Year*10000 + Month*100 + value; } }
private uint Year {
get { return RawDate/10000; }
set { RawDate = value*10000 + RawDate%10000; } }
private uint Month {
get { return RawDate%10000/100; }
set { RawDate = Year*10000 + value*100 + RawDate%100; } }
private uint Day {
get { return RawDate%100; }
set { RawDate = Year*10000 + Month*100 + value; } }
/// <summary>
/// Gets or sets the date of the card.
/// </summary>
public DateTime? Date
{
get
{
// Check to see if date is valid
if (!Util.IsDateValid(Year, Month, Day))
return null;
return new DateTime((int)Year, (int)Month, (int)Day);
}
set
{
if (value.HasValue)
{
// Only update the properties if a value is provided.
Year = (ushort)value.Value.Year;
Month = (byte)value.Value.Month;
Day = (byte)value.Value.Day;
}
else
{
// Clear the Met Date.
// If code tries to access MetDate again, null will be returned.
Year = 0;
Month = 0;
Day = 0;
}
}
}
public int CardLocation { get { return Data[0x50]; } set { Data[0x50] = (byte)value; } }
public int CardType { get { return Data[0x51]; } set { Data[0x51] = (byte)value; } }
@ -281,18 +315,15 @@ namespace PKHeX
pk.Move3_PP = pk.getMovePP(Move3, 0);
pk.Move4_PP = pk.getMovePP(Move4, 0);
if (Day + Month + Year == 0) // No datetime set, typical for wc6full
if (Date.HasValue)
{
DateTime dt = DateTime.Now;
pk.Met_Day = dt.Day;
pk.Met_Month = dt.Month;
pk.Met_Year = dt.Year - 2000;
pk.MetDate = Date.Value;
}
else
{
pk.Met_Day = (int)Day;
pk.Met_Month = (int)Month;
pk.Met_Year = (int)(Year - 2000);
// No datetime set, typical for wc6full
// Set it to now, instead of zeroing it out.
pk.MetDate = DateTime.Now;
}
if (pk.CurrentHandler == 0) // OT
@ -375,9 +406,7 @@ namespace PKHeX
if (IsEgg)
{
pk.IsEgg = true;
pk.Egg_Day = (int) Day;
pk.Egg_Month = (int) Month;
pk.Egg_Year = (int) Year;
pk.EggMetDate = Date;
}
pk.RefreshChecksum();

View file

@ -61,12 +61,9 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Web" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Legality\Analysis.cs" />
@ -173,6 +170,13 @@
</Compile>
<Compile Include="Saves\SaveObjects.cs" />
<Compile Include="Saves\SaveUtil.cs" />
<Compile Include="Subforms\Save Editors\Gen5\CGearBackground.cs" />
<Compile Include="Subforms\Save Editors\Gen5\SAV_CGearSkin.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Subforms\Save Editors\Gen5\SAV_CGearSkin.Designer.cs">
<DependentUpon>SAV_CGearSkin.cs</DependentUpon>
</Compile>
<Compile Include="Subforms\Save Editors\Gen6\SAV_Link6.cs">
<SubType>Form</SubType>
</Compile>
@ -291,6 +295,7 @@
</Compile>
<Compile Include="Misc\ComboItem.cs" />
<Compile Include="Util\DataUtil.cs" />
<Compile Include="Util\DateUtil.cs" />
<Compile Include="Util\FormUtil.cs" />
<Compile Include="Util\ImageUtil.cs" />
<Compile Include="Util\PathUtil.cs" />
@ -324,6 +329,9 @@
<EmbeddedResource Include="Subforms\PKM Editors\MemoryAmie.resx">
<DependentUpon>MemoryAmie.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Subforms\Save Editors\Gen5\SAV_CGearSkin.resx">
<DependentUpon>SAV_CGearSkin.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Subforms\Save Editors\Gen6\SAV_Link6.resx">
<DependentUpon>SAV_Link6.cs</DependentUpon>
</EmbeddedResource>
@ -708,33 +716,34 @@
<None Include="Resources\img\box\xy\box_wp03xy.png" />
<None Include="Resources\img\box\xy\box_wp02xy.png" />
<None Include="Resources\img\box\xy\box_wp01xy.png" />
<Content Include="Resources\text\de\text_Pokeblock_de.txt" />
<None Include="Resources\img\item\item_tm.png" />
<None Include="Resources\text\de\text_Pokeblock_de.txt" />
<None Include="Resources\text\de\text_tradeao_de.txt" />
<None Include="Resources\text\de\text_tradexy_de.txt" />
<Content Include="Resources\text\en\text_Pokeblock_en.txt" />
<None Include="Resources\text\en\text_Pokeblock_en.txt" />
<None Include="Resources\text\en\text_tradeao_en.txt" />
<None Include="Resources\text\en\text_tradexy_en.txt" />
<Content Include="Resources\text\es\text_Pokeblock_es.txt" />
<None Include="Resources\text\es\text_Pokeblock_es.txt" />
<None Include="Resources\text\es\text_tradeao_es.txt" />
<None Include="Resources\text\es\text_tradexy_es.txt" />
<Content Include="Resources\text\fr\text_Pokeblock_fr.txt" />
<None Include="Resources\text\fr\text_Pokeblock_fr.txt" />
<None Include="Resources\text\fr\text_tradeao_fr.txt" />
<None Include="Resources\text\fr\text_tradexy_fr.txt" />
<None Include="Resources\text\gen3\text_ItemsG3_en.txt" />
<None Include="Resources\text\gen3\text_rsefrlg_00000_en.txt" />
<Content Include="Resources\text\it\text_Pokeblock_it.txt" />
<None Include="Resources\text\it\text_Pokeblock_it.txt" />
<None Include="Resources\text\it\text_tradeao_it.txt" />
<None Include="Resources\text\it\text_tradexy_it.txt" />
<Content Include="Resources\text\ja\text_Pokeblock_ja.txt" />
<None Include="Resources\text\ja\text_Pokeblock_ja.txt" />
<None Include="Resources\text\ja\text_tradeao_ja.txt" />
<None Include="Resources\text\ja\text_tradexy_ja.txt" />
<Content Include="Resources\text\ko\text_Pokeblock_ko.txt" />
<None Include="Resources\text\ko\text_Pokeblock_ko.txt" />
<None Include="Resources\text\ko\text_tradeao_ko.txt" />
<None Include="Resources\text\ko\text_tradexy_ko.txt" />
<None Include="Resources\text\other\const_oras.txt" />
<None Include="Resources\text\other\flags_oras.txt" />
<None Include="Resources\text\other\flags_xy.txt" />
<Content Include="Resources\text\zh\text_Pokeblock_zh.txt" />
<None Include="Resources\text\zh\text_Pokeblock_zh.txt" />
<None Include="Resources\text\it\lang_it.txt" />
<None Include="Resources\img\Pokemon Sprites\414-2.png" />
<None Include="Resources\img\Pokemon Sprites\414-1.png" />
@ -977,7 +986,7 @@
<None Include="Resources\img\Pokemon Sprites\18-1.png" />
<None Include="Resources\img\Pokemon Sprites\15-1.png" />
<None Include="Resources\img\Pokemon Sprites\720-1.png" />
<Content Include="Resources\icon.ico" />
<None Include="Resources\icon.ico" />
<None Include="Resources\img\ribbons\ribbon_45.png" />
<None Include="Resources\img\ribbons\ribbon_44.png" />
<None Include="Resources\img\ribbons\ribbon_43.png" />

View file

@ -64,10 +64,10 @@ namespace PKHeX
public override uint EXP { get { return BitConverter.ToUInt32(Data, 0x24); } set { BitConverter.GetBytes(value).CopyTo(Data, 0x24); } }
private byte PPUps { get { return Data[0x28]; } set { Data[0x28] = value; } }
public override int Move1_PPUps { get { return (PPUps >> 0) & 3; } set { PPUps = (byte)((PPUps & ~(3 << 0)) | value); } }
public override int Move2_PPUps { get { return (PPUps >> 2) & 3; } set { PPUps = (byte)((PPUps & ~(3 << 2)) | value); } }
public override int Move3_PPUps { get { return (PPUps >> 4) & 3; } set { PPUps = (byte)((PPUps & ~(3 << 4)) | value); } }
public override int Move4_PPUps { get { return (PPUps >> 6) & 3; } set { PPUps = (byte)((PPUps & ~(3 << 6)) | value); } }
public override int Move1_PPUps { get { return (PPUps >> 0) & 3; } set { PPUps = (byte)((PPUps & ~(3 << 0)) | value << 0); } }
public override int Move2_PPUps { get { return (PPUps >> 2) & 3; } set { PPUps = (byte)((PPUps & ~(3 << 2)) | value << 2); } }
public override int Move3_PPUps { get { return (PPUps >> 4) & 3; } set { PPUps = (byte)((PPUps & ~(3 << 4)) | value << 4); } }
public override int Move4_PPUps { get { return (PPUps >> 6) & 3; } set { PPUps = (byte)((PPUps & ~(3 << 6)) | value << 6); } }
public override int OT_Friendship { get { return Data[0x29]; } set { Data[0x29] = (byte)value; } }
// Unused 0x2A 0x2B
#endregion
@ -105,7 +105,7 @@ namespace PKHeX
public override int Met_Location { get { return Data[0x45]; } set { Data[0x45] = (byte)value; } }
// Origins
private ushort Origins { get { return BitConverter.ToUInt16(Data, 0x46); } set { BitConverter.GetBytes(value).CopyTo(Data, 0x46); } }
public override int Met_Level { get { return Origins & 0x3F; } set { Origins = (ushort)((Origins & ~0x3F) | value); } }
public override int Met_Level { get { return Origins & 0x7F; } set { Origins = (ushort)((Origins & ~0x7F) | value); } }
public override int Version { get { return (Origins >> 7) & 0xF; } set { Origins = (ushort)((Origins & ~0x780) | ((value & 0xF) << 7));} }
public override int Ball { get { return (Origins >> 11) & 0xF; } set { Origins = (ushort)((Origins & ~0x7800) | ((value & 0xF) << 11)); } }
public override int OT_Gender { get { return (Origins >> 15) & 1; } set { Origins = (ushort)(Origins & ~(1 << 15) | ((value & 1) << 15)); } }
@ -196,7 +196,7 @@ namespace PKHeX
SID = SID,
EXP = IsEgg ? PKX.getEXP(5, Species) : EXP,
IsEgg = false,
OT_Friendship = 40,
OT_Friendship = 70,
MarkCircle = MarkCircle,
MarkSquare = MarkSquare,
MarkTriangle = MarkTriangle,
@ -222,10 +222,6 @@ namespace PKHeX
Move2_PPUps = Move2_PPUps,
Move3_PPUps = Move3_PPUps,
Move4_PPUps = Move4_PPUps,
Move1_PP = getMovePP(Move1, Move1_PPUps),
Move2_PP = getMovePP(Move2, Move2_PPUps),
Move3_PP = getMovePP(Move3, Move3_PPUps),
Move4_PP = getMovePP(Move4, Move4_PPUps),
IV_HP = IV_HP,
IV_ATK = IV_ATK,
IV_DEF = IV_DEF,
@ -238,9 +234,7 @@ namespace PKHeX
PKRS_Strain = PKRS_Strain,
PKRS_Days = PKRS_Days,
OT_Gender = OT_Gender,
Met_Year = moment.Year - 2000,
Met_Month = moment.Month,
Met_Day = moment.Day,
MetDate = moment,
Met_Location = 0x37, // Pal Park
RibbonChampionG3Hoenn = RibbonChampionG3Hoenn,
@ -257,6 +251,12 @@ namespace PKHeX
RibbonWorld = RibbonWorld,
};
// Fix PP
pk4.Move1_PP = pk4.getMovePP(pk4.Move1, pk4.Move1_PPUps);
pk4.Move2_PP = pk4.getMovePP(pk4.Move2, pk4.Move2_PPUps);
pk4.Move3_PP = pk4.getMovePP(pk4.Move3, pk4.Move3_PPUps);
pk4.Move4_PP = pk4.getMovePP(pk4.Move4, pk4.Move4_PPUps);
if (Met_Location == 0xFF) // Fateful
pk4.FatefulEncounter = Met_Location == 0xFF || FatefulEncounter; // obedience flag
@ -296,6 +296,10 @@ namespace PKHeX
// Unown Form
pk4.AltForm = AltForm;
int item = HeldItem;
if (HeldItem > 0)
pk4.HeldItem = item;
// Remove HM moves
int[] banned = { 15, 19, 57, 70, 148, 249, 127, 291 };
int[] newMoves = pk4.Moves;

View file

@ -243,12 +243,12 @@ namespace PKHeX
PKX.str2arrayG4(TempNick).CopyTo(Data, 0x68);
}
}
public override int Egg_Year { get { return Data[0x78]; } set { Data[0x78] = (byte)value; } }
public override int Egg_Month { get { return Data[0x79]; } set { Data[0x79] = (byte)value; } }
public override int Egg_Day { get { return Data[0x7A]; } set { Data[0x7A] = (byte)value; } }
public override int Met_Year { get { return Data[0x7B]; } set { Data[0x7B] = (byte)value; } }
public override int Met_Month { get { return Data[0x7C]; } set { Data[0x7C] = (byte)value; } }
public override int Met_Day { get { return Data[0x7D]; } set { Data[0x7D] = (byte)value; } }
protected override int Egg_Year { get { return Data[0x78]; } set { Data[0x78] = (byte)value; } }
protected override int Egg_Month { get { return Data[0x79]; } set { Data[0x79] = (byte)value; } }
protected override int Egg_Day { get { return Data[0x7A]; } set { Data[0x7A] = (byte)value; } }
protected override int Met_Year { get { return Data[0x7B]; } set { Data[0x7B] = (byte)value; } }
protected override int Met_Month { get { return Data[0x7C]; } set { Data[0x7C] = (byte)value; } }
protected override int Met_Day { get { return Data[0x7D]; } set { Data[0x7D] = (byte)value; } }
public override int Egg_Location
{
@ -261,10 +261,21 @@ namespace PKHeX
}
set
{
if (PtHGSS)
if (value == 0)
{
BitConverter.GetBytes((ushort)0).CopyTo(Data, 0x44);
BitConverter.GetBytes((ushort)0).CopyTo(Data, 0x7E);
}
else if (PtHGSS)
{
BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x44);
BitConverter.GetBytes(0x7D0).CopyTo(Data, 0x7E);
BitConverter.GetBytes(0xBBA).CopyTo(Data, 0x7E); // Faraway Place (for DP display)
}
else if ((value < 2000 && value > 111) || (value < 3000 && value > 2010))
{
// Met location not in DP, set to Mystery Zone (0, illegal) as opposed to Faraway Place
BitConverter.GetBytes((ushort)0).CopyTo(Data, 0x44);
BitConverter.GetBytes((ushort)0).CopyTo(Data, 0x7E);
}
else
{
@ -284,10 +295,21 @@ namespace PKHeX
}
set
{
if (PtHGSS)
if (value == 0)
{
BitConverter.GetBytes((ushort)0).CopyTo(Data, 0x46);
BitConverter.GetBytes((ushort)0).CopyTo(Data, 0x80);
}
else if (PtHGSS)
{
BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x46);
BitConverter.GetBytes(0x7D0).CopyTo(Data, 0x80);
BitConverter.GetBytes(0xBBA).CopyTo(Data, 0x80); // Faraway Place (for DP display)
}
else if ((value < 2000 && value > 111) || (value < 3000 && value > 2010))
{
// Met location not in DP, set to Mystery Zone (0, illegal) as opposed to Faraway Place
BitConverter.GetBytes((ushort)0).CopyTo(Data, 0x46);
BitConverter.GetBytes((ushort)0).CopyTo(Data, 0x80);
}
else
{
@ -299,11 +321,26 @@ namespace PKHeX
private byte PKRS { get { return Data[0x82]; } set { Data[0x82] = value; } }
public override int PKRS_Days { get { return PKRS & 0xF; } set { PKRS = (byte)(PKRS & ~0xF | value); } }
public override int PKRS_Strain { get { return PKRS >> 4; } set { PKRS = (byte)(PKRS & 0xF | (value << 4)); } }
public override int Ball { get { return Data[0x83]; } set { Data[0x83] = (byte)value; } }
public override int Ball
{
get { return Data[HGSS ? 0x86 : 0x83]; }
set
{
if (HGSS)
{
Data[0x83] = (byte)(value <= 0x10 ? value : 4); // Ball to display in DP (cap at Cherish)
Data[0x86] = (byte)(value <= 0x18 ? value : 4); // Cap at Comp Ball
}
else
{
Data[0x83] = (byte)(value <= 0x10 ? value : 4); // Cap at Cherish Ball
Data[0x86] = 0; // Unused
}
}
}
public override int Met_Level { get { return Data[0x84] & ~0x80; } set { Data[0x84] = (byte)((Data[0x84] & 0x80) | value); } }
public override int OT_Gender { get { return Data[0x84] >> 7; } set { Data[0x84] = (byte)((Data[0x84] & ~0x80) | value << 7); } }
public override int EncounterType { get { return Data[0x85]; } set { Data[0x85] = (byte)value; } }
public int HGSSBall { get { return Data[0x86]; } set { Data[0x86] = (byte)value; } }
// Unused 0x87
#endregion
@ -374,16 +411,14 @@ namespace PKHeX
HeldItem = 0,
OT_Friendship = 70,
// Apply new met date
Met_Year = moment.Year - 2000,
Met_Month = moment.Month,
Met_Day = moment.Day
MetDate = moment
};
// Fix PP
pk5.Move1_PP = getMovePP(pk5.Move1_PP, pk5.Move1_PPUps);
pk5.Move2_PP = getMovePP(pk5.Move2_PP, pk5.Move2_PPUps);
pk5.Move3_PP = getMovePP(pk5.Move3_PP, pk5.Move3_PPUps);
pk5.Move4_PP = getMovePP(pk5.Move4_PP, pk5.Move4_PPUps);
pk5.Move1_PP = pk5.getMovePP(pk5.Move1_PP, pk5.Move1_PPUps);
pk5.Move2_PP = pk5.getMovePP(pk5.Move2_PP, pk5.Move2_PPUps);
pk5.Move3_PP = pk5.getMovePP(pk5.Move3_PP, pk5.Move3_PPUps);
pk5.Move4_PP = pk5.getMovePP(pk5.Move4_PP, pk5.Move4_PPUps);
// Disassociate Nature and PID
pk5.Nature = (int)(pk5.PID % 25);
@ -392,14 +427,13 @@ namespace PKHeX
BitConverter.GetBytes((uint)0).CopyTo(pk5.Data, 0x44);
// Met / Crown Data Detection
pk5.Met_Location = pk5.FatefulEncounter && Array.IndexOf(new[] {251, 243, 244, 245}, pk5.Species) >= 0
pk5.Met_Location = pk5.Gen4 && pk5.FatefulEncounter && Array.IndexOf(new[] {251, 243, 244, 245}, pk5.Species) >= 0
? (pk5.Species == 251 ? 30010 : 30012) // Celebi : Beast
: 30001; // Pokétransfer (not Crown)
// Delete HGSS Data
BitConverter.GetBytes((ushort)0).CopyTo(pk5.Data, 0x86);
if (HGSSBall > 0 && HGSSBall != 4)
pk5.Ball = HGSSBall;
pk5.Ball = Ball;
// Transfer Nickname and OT Name
pk5.Nickname = Nickname;
@ -409,9 +443,9 @@ namespace PKHeX
pk5.Met_Level = PKX.getLevel(pk5.Species, pk5.EXP);
// Remove HM moves; Defog should be kept if both are learned.
int[] banned = Moves.Contains(250) /*Whirlpool*/ && !Moves.Contains(432) /*Defog*/
? new[] {15, 19, 57, 70, 432, 249, 127, 431} // No Defog
: new[] {15, 19, 57, 70, 250, 249, 127, 431};// No Whirlpool
int[] banned = Moves.Contains(250) && Moves.Contains(432) // Whirlpool & Defog
? new[] {15, 19, 57, 70, 250, 249, 127, 431} // No Whirlpool
: new[] {15, 19, 57, 70, 249, 127, 431};// Transfer via advantageous game
int[] newMoves = pk5.Moves;
for (int i = 0; i < 4; i++)

View file

@ -248,12 +248,12 @@ namespace PKHeX
Encoding.Unicode.GetBytes(TempNick).CopyTo(Data, 0x68);
}
}
public override int Egg_Year { get { return Data[0x78]; } set { Data[0x78] = (byte)value; } }
public override int Egg_Month { get { return Data[0x79]; } set { Data[0x79] = (byte)value; } }
public override int Egg_Day { get { return Data[0x7A]; } set { Data[0x7A] = (byte)value; } }
public override int Met_Year { get { return Data[0x7B]; } set { Data[0x7B] = (byte)value; } }
public override int Met_Month { get { return Data[0x7C]; } set { Data[0x7C] = (byte)value; } }
public override int Met_Day { get { return Data[0x7D]; } set { Data[0x7D] = (byte)value; } }
protected override int Egg_Year { get { return Data[0x78]; } set { Data[0x78] = (byte)value; } }
protected override int Egg_Month { get { return Data[0x79]; } set { Data[0x79] = (byte)value; } }
protected override int Egg_Day { get { return Data[0x7A]; } set { Data[0x7A] = (byte)value; } }
protected override int Met_Year { get { return Data[0x7B]; } set { Data[0x7B] = (byte)value; } }
protected override int Met_Month { get { return Data[0x7C]; } set { Data[0x7C] = (byte)value; } }
protected override int Met_Day { get { return Data[0x7D]; } set { Data[0x7D] = (byte)value; } }
public override int Egg_Location { get { return BitConverter.ToUInt16(Data, 0x7E); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x7E); } }
public override int Met_Location { get { return BitConverter.ToUInt16(Data, 0x80); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x80); } }
private byte PKRS { get { return Data[0x82]; } set { Data[0x82] = value; } }
@ -370,16 +370,17 @@ namespace PKHeX
pk6.Move3 = Move3;
pk6.Move4 = Move4;
pk6.Move1_PP = getMovePP(Move1, Move1_PPUps);
pk6.Move2_PP = getMovePP(Move2, Move2_PPUps);
pk6.Move3_PP = getMovePP(Move3, Move3_PPUps);
pk6.Move4_PP = getMovePP(Move4, Move4_PPUps);
pk6.Move1_PPUps = Move1_PPUps;
pk6.Move2_PPUps = Move2_PPUps;
pk6.Move3_PPUps = Move3_PPUps;
pk6.Move4_PPUps = Move4_PPUps;
// Fix PP
pk6.Move1_PP = pk6.getMovePP(pk6.Move1, pk6.Move1_PPUps);
pk6.Move2_PP = pk6.getMovePP(pk6.Move2, pk6.Move2_PPUps);
pk6.Move3_PP = pk6.getMovePP(pk6.Move3, pk6.Move3_PPUps);
pk6.Move4_PP = pk6.getMovePP(pk6.Move4, pk6.Move4_PPUps);
pk6.IV_HP = IV_HP;
pk6.IV_ATK = IV_ATK;
pk6.IV_DEF = IV_DEF;
@ -403,12 +404,8 @@ namespace PKHeX
pk6.OT_Name = OT_Name;
// Dates are kept upon transfer
pk6.Met_Year = Met_Year;
pk6.Met_Month = Met_Month;
pk6.Met_Day = Met_Day;
pk6.Egg_Year = Egg_Year;
pk6.Egg_Month = Egg_Month;
pk6.Egg_Day = Egg_Day;
pk6.MetDate = MetDate;
pk6.EggMetDate = EggMetDate;
// Locations are kept upon transfer
pk6.Met_Location = Met_Location;

View file

@ -365,12 +365,12 @@ namespace PKHeX
public int OT_Memory { get { return Data[0xCD]; } set { Data[0xCD] = (byte)value; } }
public int OT_TextVar { get { return BitConverter.ToUInt16(Data, 0xCE); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0xCE); } }
public int OT_Feeling { get { return Data[0xD0]; } set { Data[0xD0] = (byte)value; } }
public override int Egg_Year { get { return Data[0xD1]; } set { Data[0xD1] = (byte)value; } }
public override int Egg_Month { get { return Data[0xD2]; } set { Data[0xD2] = (byte)value; } }
public override int Egg_Day { get { return Data[0xD3]; } set { Data[0xD3] = (byte)value; } }
public override int Met_Year { get { return Data[0xD4]; } set { Data[0xD4] = (byte)value; } }
public override int Met_Month { get { return Data[0xD5]; } set { Data[0xD5] = (byte)value; } }
public override int Met_Day { get { return Data[0xD6]; } set { Data[0xD6] = (byte)value; } }
protected override int Egg_Year { get { return Data[0xD1]; } set { Data[0xD1] = (byte)value; } }
protected override int Egg_Month { get { return Data[0xD2]; } set { Data[0xD2] = (byte)value; } }
protected override int Egg_Day { get { return Data[0xD3]; } set { Data[0xD3] = (byte)value; } }
protected override int Met_Year { get { return Data[0xD4]; } set { Data[0xD4] = (byte)value; } }
protected override int Met_Month { get { return Data[0xD5]; } set { Data[0xD5] = (byte)value; } }
protected override int Met_Day { get { return Data[0xD6]; } set { Data[0xD6] = (byte)value; } }
public byte _0xD7 { get { return Data[0xD7]; } set { Data[0xD7] = value; } }
public override int Egg_Location { get { return BitConverter.ToUInt16(Data, 0xD8); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0xD8); } }
public override int Met_Location { get { return BitConverter.ToUInt16(Data, 0xDA); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0xDA); } }

View file

@ -125,12 +125,96 @@ namespace PKHeX
public abstract int OT_Friendship { get; set; }
// Future Properties
public virtual int Met_Year { get { return 0; } set { } }
public virtual int Met_Month { get { return 0; } set { } }
public virtual int Met_Day { get { return 0; } set { } }
public virtual int Egg_Year { get { return 0; } set { } }
public virtual int Egg_Month { get { return 0; } set { } }
public virtual int Egg_Day { get { return 0; } set { } }
protected virtual int Met_Year { get { return 0; } set { } }
protected virtual int Met_Month { get { return 0; } set { } }
protected virtual int Met_Day { get { return 0; } set { } }
/// <summary>
/// The date the Pokémon was met.
/// </summary>
/// <returns>A DateTime representing the date the Pokémon was met, or null if either the <see cref="PKM"/> format does not support dates or the stored date is invalid.</returns>
/// <remarks>Not all <see cref="PKM"/> types support the <see cref="MetDate"/> property. In these cases, this property will return null.
///
/// If null is assigned to this property, it will be cleared.</remarks>
public virtual DateTime? MetDate
{
get
{
// Check to see if date is valid
if (!Util.IsDateValid(2000 + Met_Year, Met_Month, Met_Day))
{
return null;
}
else
{
return new DateTime(2000 + Met_Year, Met_Month, Met_Day);
}
}
set
{
if (value.HasValue)
{
// Only update the properties if a value is provided.
Met_Year = value.Value.Year - 2000;
Met_Month = value.Value.Month;
Met_Day = value.Value.Day;
}
else
{
// Clear the Met Date.
// If code tries to access MetDate again, null will be returned.
Met_Year = 0;
Met_Month = 0;
Met_Day = 0;
}
}
}
protected virtual int Egg_Year { get { return 0; } set { } }
protected virtual int Egg_Month { get { return 0; } set { } }
protected virtual int Egg_Day { get { return 0; } set { } }
/// <summary>
/// The date a Pokémon was met as an egg.
/// </summary>
/// <returns>A DateTime representing the date the Pokémon was met as an egg, or null if the <see cref="PKM"/> format does not support dates.</returns>
/// <remarks>Not all <see cref="PKM"/> types support the <see cref="EggMetDate"/> property. In these cases, this property will return null.
///
/// If null is assigned to this property, it will be cleared.</remarks>
public virtual DateTime? EggMetDate
{
get
{
// Check to see if date is valid
if (!Util.IsDateValid(2000 + Egg_Year, Egg_Month, Egg_Day))
{
return null;
}
else
{
return new DateTime(2000 + Egg_Year, Egg_Month, Egg_Day);
}
}
set
{
if (value.HasValue)
{
// Only update the properties if a value is provided.
Egg_Year = value.Value.Year - 2000;
Egg_Month = value.Value.Month;
Egg_Day = value.Value.Day;
}
else
{
// Clear the Met Date.
// If code tries to access MetDate again, null will be returned.
Egg_Year = 0;
Egg_Month = 0;
Egg_Day = 0;
}
}
}
public virtual int OT_Affection { get { return 0; } set { } }
public virtual int RelearnMove1 { get { return 0; } set { } }
public virtual int RelearnMove2 { get { return 0; } set { } }
@ -147,11 +231,23 @@ namespace PKHeX
public bool XY => Version == (int)GameVersion.X || Version == (int)GameVersion.Y;
public bool AO => Version == (int)GameVersion.AS || Version == (int)GameVersion.OR;
public bool SM => Version == (int)GameVersion.SN || Version == (int)GameVersion.MN;
public bool PtHGSS => new[] {GameVersion.Pt, GameVersion.HG, GameVersion.SS}.Contains((GameVersion)Version);
protected bool PtHGSS => GameVersion.Pt == (GameVersion)Version || HGSS;
public bool HGSS => new[] {GameVersion.HG, GameVersion.SS}.Contains((GameVersion)Version);
public bool Gen5 => Version >= 20 && Version <= 23;
public bool Gen4 => Version >= 10 && Version < 12 || Version >= 7 && Version <= 8;
public bool Gen3 => Version >= 1 && Version <= 5 || Version == 15;
public bool GenU => !(Gen6 || Gen5 || Gen4 || Gen3);
public int GenNumber
{
get
{
if (Gen6) return 6;
if (Gen5) return 5;
if (Gen4) return 4;
if (Gen3) return 3;
return -1;
}
}
public bool PKRS_Infected => PKRS_Strain > 0;
public bool PKRS_Cured => PKRS_Days == 0 && PKRS_Strain > 0;
public bool ChecksumValid => Checksum == CalculateChecksum();

View file

@ -2,7 +2,7 @@
namespace PKHeX
{
internal static class PKMConverter
public static class PKMConverter
{
internal static int Country = 49;
internal static int Region = 7;
@ -19,7 +19,12 @@ namespace PKHeX
OT_Gender = TRAINERGENDER;
}
private static int getPKMDataFormat(byte[] data)
/// <summary>
/// Gets the generation of the Pokemon data.
/// </summary>
/// <param name="data">Raw data representing a Pokemon.</param>
/// <returns>An integer indicating the generation of the PKM file, or -1 if the data is invalid.</returns>
public static int getPKMDataFormat(byte[] data)
{
if (!PKX.getIsPKM(data.Length))
return -1;
@ -53,7 +58,14 @@ namespace PKHeX
}
return -1;
}
internal static PKM getPKMfromBytes(byte[] data, string ident = null)
/// <summary>
/// Creates an instance of <see cref="PKM"/> from the given data.
/// </summary>
/// <param name="data">Raw data of the Pokemon file.</param>
/// <param name="ident">Optional identifier for the Pokemon. Usually the full path of the source file.</param>
/// <returns>An instance of <see cref="PKM"/> created from the given <paramref name="data"/>, or null if <paramref name="data"/> is invalid.</returns>
public static PKM getPKMfromBytes(byte[] data, string ident = null)
{
checkEncrypted(ref data);
switch (getPKMDataFormat(data))

View file

@ -7,7 +7,7 @@ using PKHeX.Properties;
namespace PKHeX
{
internal static class PKX
public static class PKX
{
internal const int SIZE_3PARTY = 100;
internal const int SIZE_3STORED = 80;
@ -25,7 +25,12 @@ namespace PKHeX
internal const int SIZE_6STORED = 0xE8;
internal const int SIZE_6BLOCK = 56;
internal static bool getIsPKM(long len)
/// <summary>
/// Determines if the given length is valid for a Pokemon file.
/// </summary>
/// <param name="len">Length of the data to check.</param>
/// <returns>A boolean indicating whether or not the length is valid for a Pokemon file.</returns>
public static bool getIsPKM(long len)
{
return new[] {SIZE_3STORED, SIZE_3PARTY, SIZE_4STORED, SIZE_4PARTY, SIZE_5PARTY, SIZE_6STORED, SIZE_6PARTY}.Contains((int)len);
}
@ -36,14 +41,14 @@ namespace PKHeX
// Relies on Util for some common operations.
// Data
internal static uint LCRNG(uint seed)
public static uint LCRNG(uint seed)
{
const uint a = 0x41C64E6D;
const uint c = 0x00006073;
return seed * a + c;
}
internal static uint LCRNG(ref uint seed)
public static uint LCRNG(ref uint seed)
{
const uint a = 0x41C64E6D;
const uint c = 0x00006073;
@ -157,33 +162,33 @@ namespace PKHeX
};
#endregion
internal static readonly string[][] SpeciesLang =
public static readonly string[][] SpeciesLang =
{
Util.getStringList("species", "ja"), // none
Util.getStringList("species", "ja"), // 1
Util.getStringList("species", "en"), // 2
Util.getStringList("species", "fr"), // 3
Util.getStringList("species", "it"), // 4
Util.getStringList("species", "de"), // 5
Util.getStringList("species", "es"), // none
Util.getStringList("species", "es"), // 7
Util.getStringList("species", "ko"), // 8
Util.getSpeciesList("ja"), // none
Util.getSpeciesList("ja"), // 1
Util.getSpeciesList("en"), // 2
Util.getSpeciesList("fr"), // 3
Util.getSpeciesList("it"), // 4
Util.getSpeciesList("de"), // 5
Util.getSpeciesList("es"), // none
Util.getSpeciesList("es"), // 7
Util.getSpeciesList("ko"), // 8
};
internal static string getSpeciesName(int species, int lang)
public static string getSpeciesName(int species, int lang)
{
try { return SpeciesLang[lang][species]; }
catch { return ""; }
}
internal static bool getIsNicknamed(int species, string nick)
public static bool getIsNicknamed(int species, string nick)
{
try { return SpeciesLang.All(list => list[species].ToUpper() != nick); }
catch { return false; }
}
internal static readonly PersonalTable Personal = PersonalTable.AO;
public static readonly PersonalTable Personal = PersonalTable.AO;
// Stat Fetching
internal static byte[] getRandomEVs()
public static byte[] getRandomEVs()
{
byte[] evs = new byte[6];
do {
@ -197,7 +202,7 @@ namespace PKHeX
Util.Shuffle(evs);
return evs;
}
internal static int getLevel(int species, uint exp)
public static int getLevel(int species, uint exp)
{
int growth = Personal[species].EXPGrowth;
int tl = 1; // Initial Level. Iterate upwards to find the level
@ -205,13 +210,13 @@ namespace PKHeX
if (tl == 100) return 100;
return --tl;
}
internal static uint getEXP(int level, int species)
public static uint getEXP(int level, int species)
{
if (level <= 1) return 0;
if (level > 100) level = 100;
return ExpTable[level, Personal[species].EXPGrowth];
}
internal static int getGender(string s)
public static int getGender(string s)
{
if (s == null)
return -1;
@ -222,7 +227,7 @@ namespace PKHeX
return 2;
}
internal static string[] getCountryRegionText(int country, int region, string lang)
public static string[] getCountryRegionText(int country, int region, string lang)
{
// Get Language we're fetching for
int index = Array.IndexOf(new[] { "ja", "en", "fr", "de", "it", "es", "zh", "ko"}, lang);
@ -275,7 +280,7 @@ namespace PKHeX
return data;
}
internal static string getLocation(PKM pk, bool eggmet)
public static string getLocation(PKM pk, bool eggmet)
{
int locval = eggmet ? pk.Egg_Location : pk.Met_Location;
if (pk.Format == 3)
@ -302,7 +307,7 @@ namespace PKHeX
}
return null; // Shouldn't happen.
}
internal static string[] getQRText(PKM pkm)
public static string[] getQRText(PKM pkm)
{
string[] response = new string[3];
// Summarize
@ -332,7 +337,7 @@ namespace PKHeX
}
// PKX Manipulation
internal static readonly byte[][] blockPosition =
public static readonly byte[][] blockPosition =
{
new byte[] {0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3},
new byte[] {1, 1, 2, 3, 2, 3, 0, 0, 0, 0, 0, 0, 2, 3, 1, 1, 3, 2, 2, 3, 1, 1, 3, 2},
@ -340,11 +345,11 @@ namespace PKHeX
new byte[] {3, 2, 3, 2, 1, 1, 3, 2, 3, 2, 1, 1, 3, 2, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0},
};
internal static readonly byte[] blockPositionInvert =
public static readonly byte[] blockPositionInvert =
{
0, 1, 2, 4, 3, 5, 6, 7, 12, 18, 13, 19, 8, 10, 14, 20, 16, 22, 9, 11, 15, 21, 17, 23
};
internal static byte[] shuffleArray(byte[] data, uint sv)
public static byte[] shuffleArray(byte[] data, uint sv)
{
byte[] sdata = new byte[data.Length];
Array.Copy(data, sdata, 8); // Copy unshuffled bytes
@ -359,7 +364,7 @@ namespace PKHeX
return sdata;
}
internal static byte[] decryptArray(byte[] ekx)
public static byte[] decryptArray(byte[] ekx)
{
byte[] pkx = (byte[])ekx.Clone();
@ -383,7 +388,7 @@ namespace PKHeX
return pkx;
}
internal static byte[] encryptArray(byte[] pkx)
public static byte[] encryptArray(byte[] pkx)
{
// Shuffle
uint pv = BitConverter.ToUInt32(pkx, 0);
@ -410,7 +415,7 @@ namespace PKHeX
// Done
return ekx;
}
internal static ushort getCHK(byte[] data)
public static ushort getCHK(byte[] data)
{
ushort chk = 0;
for (int i = 8; i < 232; i += 2) // Loop through the entire PKX
@ -419,7 +424,7 @@ namespace PKHeX
return chk;
}
internal static uint getRandomPID(int species, int cg, int origin, int nature, int form, uint OLDPID)
public static uint getRandomPID(int species, int cg, int origin, int nature, int form, uint OLDPID)
{
uint bits = OLDPID & 0x00010001;
int gt = Personal[species].Gender;
@ -457,7 +462,7 @@ namespace PKHeX
}
// Data Requests
internal static Image getSprite(int species, int form, int gender, int item, bool isegg, bool shiny)
public static Image getSprite(int species, int form, int gender, int item, bool isegg, bool shiny, int generation = -1)
{
if (species == 0)
return (Image)Resources.ResourceManager.GetObject("_0");
@ -499,14 +504,17 @@ namespace PKHeX
if (item > 0)
{
Image itemimg = (Image)Resources.ResourceManager.GetObject("item_" + item) ?? Resources.helditem;
if ((generation == 3 || generation == 4) && 328 <= item && item <= 419) // gen3/4 TM
itemimg = Resources.item_tm;
// Redraw
baseImage = Util.LayerImage(baseImage, itemimg, 22 + (15 - itemimg.Width) / 2, 15 + (15 - itemimg.Height), 1);
}
return baseImage;
}
internal static Image getSprite(PKM pkm)
public static Image getSprite(PKM pkm)
{
return getSprite(pkm.Species, pkm.AltForm, pkm.Gender, pkm.HeldItem, pkm.IsEgg, pkm.IsShiny);
return getSprite(pkm.Species, pkm.AltForm, pkm.Gender, pkm.HeldItem, pkm.IsEgg, pkm.IsShiny, pkm.Format);
}
// Font Related
@ -521,7 +529,7 @@ namespace PKHeX
return s_FontCollection.Families;
}
}
internal static Font getPKXFont(float size)
public static Font getPKXFont(float size)
{
return new Font(FontFamilies[0], size);
}
@ -540,7 +548,7 @@ namespace PKHeX
}
// Personal.dat
internal static string[] getFormList(int species, string[] t, string[] f, string[] g)
public static string[] getFormList(int species, string[] t, string[] f, string[] g)
{
// Mega List
if (Array.IndexOf(new[]
@ -863,13 +871,13 @@ namespace PKHeX
/// <param name="type">Hidden Power Type</param>
/// <param name="ivs">Order: HP,ATK,DEF,SPEED,SPA,SPD</param>
/// <returns>Hidden Power Type</returns>
internal static int[] setHPIVs(int type, int[] ivs)
public static int[] setHPIVs(int type, int[] ivs)
{
for (int i = 0; i < 6; i++)
ivs[i] = (ivs[i] & 0x1E) + hpivs[type, i];
return ivs;
}
internal static readonly int[,] hpivs = {
public static readonly int[,] hpivs = {
{ 1, 1, 0, 0, 0, 0 }, // Fighting
{ 0, 0, 0, 0, 0, 1 }, // Flying
{ 1, 1, 0, 0, 0, 1 }, // Poison
@ -888,7 +896,7 @@ namespace PKHeX
{ 1, 1, 1, 1, 1, 1 }, // Dark
};
internal static string TrimFromFFFF(string input)
public static string TrimFromFFFF(string input)
{
int index = input.IndexOf((char)0xFFFF);
return index < 0 ? input : input.Substring(0, index);
@ -896,7 +904,7 @@ namespace PKHeX
// Past Gen Manipulation
internal static byte[] shuffleArray45(byte[] data, uint sv)
public static byte[] shuffleArray45(byte[] data, uint sv)
{
byte[] sdata = new byte[data.Length];
Array.Copy(data, sdata, 8); // Copy unshuffled bytes
@ -912,7 +920,7 @@ namespace PKHeX
return sdata;
}
internal static byte[] decryptArray45(byte[] ekm)
public static byte[] decryptArray45(byte[] ekm)
{
byte[] pkm = (byte[])ekm.Clone();
@ -938,7 +946,7 @@ namespace PKHeX
return pkm;
}
internal static byte[] encryptArray45(byte[] pkm)
public static byte[] encryptArray45(byte[] pkm)
{
uint pv = BitConverter.ToUInt32(pkm, 0);
uint sv = ((pv & 0x3E000) >> 0xD) % 24;
@ -966,25 +974,25 @@ namespace PKHeX
return ekm;
}
internal static int getUnownForm(uint PID)
public static int getUnownForm(uint PID)
{
byte[] data = BitConverter.GetBytes(PID);
return (((data[3] & 3) << 6) + ((data[2] & 3) << 4) + ((data[1] & 3) << 2) + ((data[0] & 3) << 0)) % 28;
}
internal static ushort val2charG4(ushort val)
public static ushort val2charG4(ushort val)
{
int index = Array.IndexOf(G4Values, val);
return index > -1 ? G4Chars[index] : (ushort)0xFFFF;
}
internal static ushort char2valG4(ushort chr)
public static ushort char2valG4(ushort chr)
{
int index = Array.IndexOf(G4Chars, chr);
return index > -1 ? G4Values[index] : (ushort)0xFFFF;
}
internal static string array2strG4(byte[] strdata)
public static string array2strG4(byte[] strdata)
{
string s = "";
for (int i = 0; i < strdata.Length; i += 2)
@ -998,7 +1006,7 @@ namespace PKHeX
return s;
}
internal static byte[] str2arrayG4(string str)
public static byte[] str2arrayG4(string str)
{
byte[] strdata = new byte[str.Length * 2 + 2]; // +2 for 0xFFFF
for (int i = 0; i < str.Length; i++)
@ -1014,16 +1022,16 @@ namespace PKHeX
}
// Gen3 && 3->4 Conversion has two character tables, and translates to the same character map.
internal static ushort getG4Val(byte val, bool jp) { return jp ? G34_4J[val] : G34_4E[val]; }
internal static ushort getG3Char(byte val, bool jp) { return val2charG4(getG4Val(val, jp)); }
public static ushort getG4Val(byte val, bool jp) { return jp ? G34_4J[val] : G34_4E[val]; }
public static ushort getG3Char(byte val, bool jp) { return val2charG4(getG4Val(val, jp)); }
internal static byte setG3Char(ushort chr, bool jp)
public static byte setG3Char(ushort chr, bool jp)
{
int index = Array.IndexOf(jp ? G34_4J : G34_4E, char2valG4(chr));
return (byte)(index > -1 ? index : 0xFF);
}
internal static string getG3Str(byte[] strdata, bool jp)
public static string getG3Str(byte[] strdata, bool jp)
{
return strdata
.TakeWhile(val => val < 247) // Take valid values
@ -1032,7 +1040,7 @@ namespace PKHeX
.Aggregate("", (current, chr) => current + (char)chr);
}
internal static byte[] setG3Str(string str, bool jp)
public static byte[] setG3Str(string str, bool jp)
{
byte[] strdata = new byte[str.Length + 1]; // +1 for 0xFF
for (int i = 0; i < str.Length; i++)
@ -1043,23 +1051,24 @@ namespace PKHeX
{ Array.Resize(ref strdata, i); break; }
strdata[i] = val;
}
strdata[str.Length] = 0xFF;
if (strdata.Length > 0)
strdata[strdata.Length - 1] = 0xFF;
return strdata;
}
internal static int getG4Species(int g3index)
public static int getG4Species(int g3index)
{
int index = Array.IndexOf(oldindex, g3index);
return newindex[index > -1 ? index : 0];
}
internal static int getG3Species(int g4index)
public static int getG3Species(int g4index)
{
int index = Array.IndexOf(newindex, g4index);
return oldindex[index > -1 ? index : 0];
}
internal static int getGender(int species, uint PID)
public static int getGender(int species, uint PID)
{
int genderratio = Personal[species].Gender;
switch (genderratio)
@ -1469,48 +1478,46 @@ namespace PKHeX
internal static readonly ushort[] G34_4E =
{
478, 351, 352, 353, 358, 359, 360, 361, 362, 363, 020, 365, 366, 369, 370,
371, 415, 376, 377, 378, 368, 382, 383, 384, 046, 358, 359, 392, 393, 394,
395, 396, 397, 398, 401, 402, 403, 416, 408, 409, 410, 400, 420, 419, 479,
450, 445, 003, 004, 006, 008, 010, 068, 449, 072, 013, 015, 017, 019, 021,
023, 025, 027, 029, 031, 033, 035, 038, 040, 042, 049, 052, 055, 058, 061,
050, 053, 056, 059, 062, 036, 426, 425, 480, 481, 091, 092, 094, 096, 098,
364, 100, 102, 106, 108, 110, 112, 114, 117, 119, 121, 123, 124, 125, 385,
127, 128, 131, 134, 137, 140, 396, 144, 145, 146, 147, 149, 151, 153, 154,
155, 156, 157, 158, 159, 160, 161, 082, 084, 086, 088, 090, 148, 150, 152,
093, 095, 097, 099, 101, 103, 105, 107, 109, 111, 113, 115, 118, 120, 122,
129, 132, 135, 138, 141, 130, 133, 136, 139, 142, 116, 289, 290, 291, 292,
293, 294, 295, 296, 297, 298, 427, 428, 430, 241, 230, 431, 436, 437, 434,
435, 443, 444, 424, 429, 242, 433, 299, 300, 301, 302, 303, 304, 305, 306,
307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336,
337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 289,
452, 355, 373, 379, 387, 405, 411
478, 351, 352, 353, 358, 359, 360, 361, 362, 363, 020, 365, 366, 369, 370, 371, // 0
415, 376, 377, 378, 368, 382, 383, 384, 046, 358, 359, 392, 393, 394, 395, 396, // 1
397, 398, 401, 402, 403, 416, 408, 409, 410, 400, 420, 419, 479, 450, 445, 003, // 2
004, 006, 008, 010, 068, 449, 072, 013, 015, 017, 019, 021, 023, 025, 027, 029, // 3
031, 033, 035, 038, 040, 042, 049, 052, 055, 058, 061, 050, 053, 056, 059, 062, // 4
036, 426, 425, 480, 481, 091, 092, 094, 096, 098, 364, 100, 102, 106, 108, 110, // 5
112, 114, 117, 119, 121, 123, 124, 125, 385, 127, 128, 131, 134, 137, 140, 396, // 6
144, 145, 146, 147, 149, 151, 153, 154, 155, 156, 157, 158, 159, 160, 161, 082, // 7
084, 086, 088, 090, 148, 150, 152, 093, 095, 097, 099, 101, 103, 105, 107, 109, // 8
111, 113, 115, 118, 120, 122, 129, 132, 135, 138, 141, 130, 133, 136, 139, 142, // 9
116, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 427, 428, 430, 446, 230, // A
431, 436, 437, 434, 435, 443, 444, 424, 429, 242, 433, 299, 300, 301, 302, 303, // B
304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, // C
320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, // D
336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 289, // E
452, 355, 373, 379, 387, 405, 411 // F
};
internal static readonly ushort[] G34_4J =
{
001, 003, 005, 007, 009, 011, 012, 014, 016, 018, 020, 022, 024, 026, 028,
030, 032, 034, 037, 039, 041, 043, 044, 045, 046, 047, 048, 051, 054, 057,
060, 063, 064, 065, 066, 067, 069, 071, 073, 074, 075, 076, 077, 078, 079,
080, 081, 002, 004, 006, 008, 010, 068, 070, 072, 013, 015, 017, 019, 021,
023, 025, 027, 029, 031, 033, 035, 038, 040, 042, 049, 052, 055, 058, 061,
050, 053, 056, 059, 062, 036, 083, 085, 087, 089, 091, 092, 094, 096, 098,
100, 102, 104, 106, 108, 110, 112, 114, 117, 119, 121, 123, 124, 125, 126,
127, 128, 131, 134, 137, 140, 143, 144, 145, 146, 147, 149, 151, 153, 154,
155, 156, 157, 158, 159, 160, 161, 082, 084, 086, 088, 090, 148, 150, 152,
093, 095, 097, 099, 101, 103, 105, 107, 109, 111, 113, 115, 118, 120, 122,
129, 132, 135, 138, 141, 130, 133, 136, 139, 142, 116, 162, 163, 164, 165,
166, 167, 168, 169, 170, 171, 225, 226, 228, 241, 230, 229, 234, 235, 232,
233, 443, 444, 424, 430, 242, 433, 172, 173, 174, 175, 176, 177, 178, 179,
180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 289,
452, 355, 373, 379, 387, 405, 411
001, 003, 005, 007, 009, 011, 012, 014, 016, 018, 020, 022, 024, 026, 028, 030, // 0
032, 034, 037, 039, 041, 043, 044, 045, 046, 047, 048, 051, 054, 057, 060, 063, // 1
064, 065, 066, 067, 069, 071, 073, 074, 075, 076, 077, 078, 079, 080, 081, 002, // 2
004, 006, 008, 010, 068, 070, 072, 013, 015, 017, 019, 021, 023, 025, 027, 029, // 3
031, 033, 035, 038, 040, 042, 049, 052, 055, 058, 061, 050, 053, 056, 059, 062, // 4
036, 083, 085, 087, 089, 091, 092, 094, 096, 098, 100, 102, 104, 106, 108, 110, // 5
112, 114, 117, 119, 121, 123, 124, 125, 126, 127, 128, 131, 134, 137, 140, 143, // 6
144, 145, 146, 147, 149, 151, 153, 154, 155, 156, 157, 158, 159, 160, 161, 082, // 7
084, 086, 088, 090, 148, 150, 152, 093, 095, 097, 099, 101, 103, 105, 107, 109, // 8
111, 113, 115, 118, 120, 122, 129, 132, 135, 138, 141, 130, 133, 136, 139, 142, // 9
116, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 225, 226, 228, 446, 230, // A
229, 234, 235, 232, 233, 443, 444, 424, 430, 242, 433, 172, 173, 174, 175, 176, // B
177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, // C
193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, // D
209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 289, // E
452, 355, 373, 379, 387, 405, 411 // F
};
#endregion
internal static readonly byte[][] G4TransferTrashBytes = {
public static readonly byte[][] G4TransferTrashBytes = {
new byte[] { }, // Unused
new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[] { 0x18, 0x20, 0x0D, 0x02, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0xA1, 0x0C, 0x02, 0xE0, 0xFF },
@ -1521,7 +1528,7 @@ namespace PKHeX
new byte[] { 0x74, 0x20, 0x0D, 0x02, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xA1, 0x0C, 0x02, 0xE0, 0xFF },
};
internal static byte[] decryptArray3(byte[] ekm)
public static byte[] decryptArray3(byte[] ekm)
{
if (ekm.Length != SIZE_3PARTY && ekm.Length != SIZE_3STORED)
return null;
@ -1535,7 +1542,7 @@ namespace PKHeX
ekm[i] ^= xorkey[i % 4];
return shuffleArray3(ekm, PID%24);
}
internal static byte[] shuffleArray3(byte[] data, uint sv)
public static byte[] shuffleArray3(byte[] data, uint sv)
{
byte[] sdata = new byte[data.Length];
Array.Copy(data, sdata, 32); // Copy unshuffled bytes
@ -1550,7 +1557,7 @@ namespace PKHeX
return sdata;
}
internal static byte[] encryptArray3(byte[] pkm)
public static byte[] encryptArray3(byte[] pkm)
{
if (pkm.Length != SIZE_3PARTY && pkm.Length != SIZE_3STORED)
return null;
@ -1566,7 +1573,7 @@ namespace PKHeX
return ekm;
}
internal static ushort getG4Item(ushort g3val)
public static ushort getG4Item(ushort g3val)
{
ushort[] arr =
{
@ -1577,7 +1584,7 @@ namespace PKHeX
66,67,68,69,43,44,70,71,72,73,
74,75,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
0xFFFF,0xFFFF,0xFFFF,45,46,47,48,49,50,51,
52,53,0xFFFF,55,56,57,58,59,60,0xFFFF,
52,53,0xFFFF,55,56,57,58,59,60,61,
63,64,0xFFFF,76,77,78,79,0xFFFF,0xFFFF,0xFFFF,
0xFFFF,0xFFFF,0xFFFF,80,81,82,83,84,85,0xFFFF,
0xFFFF,0xFFFF,0xFFFF,86,87,0xFFFF,88,89,90,91,
@ -1596,6 +1603,15 @@ namespace PKHeX
0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
0xFFFF,0xFFFF,0xFFFF,0xFFFF,260,261,262,263,264,
0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
328,329,330,331,332,333,334,335,336,337,
338,339,340,341,342,343,344,345,346,347,
348,349,350,351,352,353,354,355,356,357,
358,359,360,361,362,363,364,365,366,367,
368,369,370,371,372,373,374,375,376,377,
};
if (g3val > arr.Length)
return 0xFFFF;

View file

@ -9,11 +9,11 @@ namespace PKHeX
internal static readonly string[] StatNames = { "HP", "Atk", "Def", "SpA", "SpD", "Spe" };
public static readonly string[] types = Util.getStringList("types", "en");
public static readonly string[] forms = Util.getStringList("forms", "en");
private static readonly string[] species = Util.getStringList("species", "en");
private static readonly string[] species = Util.getSpeciesList("en");
private static readonly string[] items = Util.getStringList("items", "en");
private static readonly string[] natures = Util.getStringList("natures", "en");
private static readonly string[] moves = Util.getStringList("moves", "en");
private static readonly string[] abilities = Util.getStringList("abilities", "en");
private static readonly string[] moves = Util.getMovesList("en");
private static readonly string[] abilities = Util.getAbilitiesList("en");
private static readonly string[] hptypes = types.Skip(1).ToArray();
// Default Set Data
@ -96,7 +96,7 @@ namespace PKHeX
string[] tmp = spec.Split(new[] { "-" }, StringSplitOptions.None);
if (tmp.Length < 2) return;
Species = Array.IndexOf(species, tmp[0].Replace(" ", ""));
Form = tmp[1].Replace(" ", "");
Form = tmp[1].Trim();
if (tmp.Length > 2)
Form += " " + tmp[2];
}
@ -186,7 +186,7 @@ namespace PKHeX
{
string[] tmp = spec.Split(new[] { "-" }, StringSplitOptions.None);
Species = Array.IndexOf(species, tmp[0].Replace(" ", ""));
Form = tmp[1].Replace(" ", "");
Form = tmp[1].Trim();
if (tmp.Length > 2)
Form += " " + tmp[2];
}

View file

@ -15132,6 +15132,16 @@ namespace PKHeX.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap item_tm {
get {
object obj = ResourceManager.GetObject("item_tm", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to ! PKHeX Interface Customization File
///! Languages: Save this file accordingly and put it in the same folder as PKHeX&apos;s executable.
@ -15181,11 +15191,11 @@ namespace PKHeX.Properties {
/// <summary>
/// Looks up a localized string similar to ! PKHeX Interface Customization File
///! Languages: Save this file accordingly and put it in the same folder as PKHeX&apos;s executable.
///! lang_en.txt = English
///! lang_jp.txt = Japanese
///! lang_en.txt = Inglés
///! lang_jp.txt = Japonés
///! lang_fr.txt = French
///! lang_de.txt = German
///! lang_es.txt = Spanish
///! lang_de.txt = Alemán
///! lang_es.txt = Español
///! lang_it.txt = Italian
///! lang_ko.txt = Korean
///! lang_zh.txt = Chinese
@ -15193,7 +15203,7 @@ namespace PKHeX.Properties {
///! Make sure that each edit has a &apos; = &apos; between Control name and new Text!
///!
///! -----------------------------------------------------
///- DO NOT CHANGE THI [rest of string was truncated]&quot;;.
///- DO NOT CHANGE THIS [rest of string was truncated]&quot;;.
/// </summary>
internal static string lang_es {
get {
@ -20500,18 +20510,18 @@ namespace PKHeX.Properties {
/// <summary>
/// Looks up a localized string similar to None
///Rock Smash (HGSS)
///Tall Grass
///Golpe roca (HGSS)
///Hierba Alta
///
///Dialga/Palkia
///Cave/Hall of Origin
///Cueva/Sala del Origen
///
///Surfing/Fishing
///Surfeando/Pescando
///
///Building/Enigma Stone
///Marsh/Safari
///Edificio/Misticristal
///Pantano/Safari
///
///Starter/Fossil/Gift (DP)
///Inicial/Fosil/Regalo (DP)
///
///
///
@ -20522,8 +20532,8 @@ namespace PKHeX.Properties {
///
///
///
///Distortion World (Pt)
///Starter/Fossil/Gift (Pt/DP Trio).
///Mundo Distorsion (Pt)
///Inicial/Fosil/Regalo (Pt/DP Trio).
/// </summary>
internal static string text_encountertype_es {
get {
@ -20697,7 +20707,7 @@ namespace PKHeX.Properties {
}
/// <summary>
/// Looks up a localized string similar to
/// Looks up a localized string similar to Spiky
///
///
///
@ -20949,9 +20959,7 @@ namespace PKHeX.Properties {
///
///
///
///
///
/// /// [rest of string was truncated]&quot;;.
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string text_forms_de {
get {
@ -20960,7 +20968,7 @@ namespace PKHeX.Properties {
}
/// <summary>
/// Looks up a localized string similar to
/// Looks up a localized string similar to Spiky
///
///
///
@ -21212,9 +21220,7 @@ namespace PKHeX.Properties {
///
///
///
///
///
/// /// [rest of string was truncated]&quot;;.
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string text_forms_en {
get {
@ -21223,7 +21229,7 @@ namespace PKHeX.Properties {
}
/// <summary>
/// Looks up a localized string similar to
/// Looks up a localized string similar to Spiky
///
///
///
@ -21474,10 +21480,7 @@ namespace PKHeX.Properties {
///
///
///
///
///
///
/// [rest of string was truncated]&quot;;.
/// /// [rest of string was truncated]&quot;;.
/// </summary>
internal static string text_forms_es {
get {
@ -21486,7 +21489,7 @@ namespace PKHeX.Properties {
}
/// <summary>
/// Looks up a localized string similar to
/// Looks up a localized string similar to Spiky
///
///
///
@ -21736,10 +21739,7 @@ namespace PKHeX.Properties {
///
///
///
///
///
///
/// [rest of string was truncated]&quot;;.
/// /// [rest of string was truncated]&quot;;.
/// </summary>
internal static string text_forms_fr {
get {
@ -21748,7 +21748,7 @@ namespace PKHeX.Properties {
}
/// <summary>
/// Looks up a localized string similar to
/// Looks up a localized string similar to Spiky
///
///
///
@ -21999,10 +21999,7 @@ namespace PKHeX.Properties {
///
///
///
///
///
///
/// [rest of string was truncated]&quot;;.
/// /// [rest of string was truncated]&quot;;.
/// </summary>
internal static string text_forms_it {
get {
@ -22011,7 +22008,7 @@ namespace PKHeX.Properties {
}
/// <summary>
/// Looks up a localized string similar to
/// Looks up a localized string similar to Spiky
///
///
///
@ -22262,9 +22259,7 @@ namespace PKHeX.Properties {
///
///
///
///
///
/// /// [rest of string was truncated]&quot;;.
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string text_forms_ja {
get {
@ -22273,7 +22268,7 @@ namespace PKHeX.Properties {
}
/// <summary>
/// Looks up a localized string similar to
/// Looks up a localized string similar to Spiky
///
///
///
@ -22525,9 +22520,7 @@ namespace PKHeX.Properties {
///
///
///
///
///
/// /// [rest of string was truncated]&quot;;.
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string text_forms_ko {
get {
@ -22536,7 +22529,7 @@ namespace PKHeX.Properties {
}
/// <summary>
/// Looks up a localized string similar to
/// Looks up a localized string similar to Spiky
///
///
///
@ -22787,10 +22780,7 @@ namespace PKHeX.Properties {
///
///
///
///
///
///
/// [rest of string was truncated]&quot;;.
/// /// [rest of string was truncated]&quot;;.
/// </summary>
internal static string text_forms_zh {
get {
@ -22878,8 +22868,8 @@ namespace PKHeX.Properties {
///RojoFuego
///VerdeHoja
///
///HeartGold
///SoulSilver
///Oro HeartGold
///Plata SoulSilver
///
///Diamante
///Perla
@ -22897,8 +22887,8 @@ namespace PKHeX.Properties {
///Negra2
///X
///Y
///AS
///OR.
///Zafiro Alfa
///Rubí Omega.
/// </summary>
internal static string text_games_es {
get {

View file

@ -6382,4 +6382,7 @@
<data name="slotView1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\box\slotView.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="item_tm" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\item\item_tm.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

View file

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 283 B

View file

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 305 B

View file

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B

View file

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

View file

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 286 B

View file

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 225 B

View file

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 216 B

View file

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 311 B

View file

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 151 B

View file

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

View file

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

View file

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 308 B

View file

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 327 B

View file

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 434 B

View file

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 474 B

View file

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 402 B

View file

Before

Width:  |  Height:  |  Size: 448 B

After

Width:  |  Height:  |  Size: 448 B

View file

Before

Width:  |  Height:  |  Size: 424 B

After

Width:  |  Height:  |  Size: 424 B

View file

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 406 B

View file

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 430 B

View file

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

Some files were not shown because too many files have changed in this diff Show more