From b48cc758bb89554cc70ec6b3b3a003926941bd10 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 24 Nov 2014 19:53:10 -0800 Subject: [PATCH] Overall Imrpovements --- Misc/CodeGenerator.cs | 16 +- PKX/f1-Main.cs | 34 +- SAV/SAV_EventFlagsORAS.Designer.cs | 589 ++++++++++++++++++++++++++--- SAV/SAV_EventFlagsORAS.cs | 19 +- SAV/SAV_Inventory.cs | 72 ++-- SAV/SAV_OPower.cs | 33 +- SAV/SAV_SecretBase.Designer.cs | 86 ++++- SAV/SAV_SecretBase.cs | 33 +- SAV/SAV_Trainer.Designer.cs | 23 +- SAV/SAV_Trainer.cs | 26 +- 10 files changed, 741 insertions(+), 190 deletions(-) diff --git a/Misc/CodeGenerator.cs b/Misc/CodeGenerator.cs index 23b085dd4..140c6c4fe 100644 --- a/Misc/CodeGenerator.cs +++ b/Misc/CodeGenerator.cs @@ -248,16 +248,20 @@ namespace PKHeX RTB_Code.Clear(); byte[] cybersav = m_parent.cyberSAV; byte[] editedsav = m_parent.savefile; - byte[] newcyber = new Byte[0x65600]; - Array.Copy(editedsav, 0x5400, newcyber, 0, 0x65600); - if (!m_parent.cybergadget) Array.Copy(editedsav, m_parent.savindex * 0x7F000 + 0x5400, newcyber, 0, 0x65600); + byte[] newcyber = new Byte[m_parent.cyberSAV.Length]; + Array.Copy(editedsav, 0x5400, newcyber, 0, newcyber.Length); + + int boxoffset = 0x22600; + if (m_parent.savegame_oras) boxoffset = 0x33000; + + if (!m_parent.cybergadget) Array.Copy(editedsav, m_parent.savindex * 0x7F000 + 0x5400, newcyber, 0, newcyber.Length); int lines = 0; // 65400 - for (int i = 0; i < 0x65400; i += 4) + for (int i = 0; i < newcyber.Length - 0x200; i += 4) { // Skip Party and Boxes if (i == 0x14200) i += (260 * 6 + 4); // +4 to skip over party count - if (i == 0x22600) i += (232 * 30 * 31); + if (i == boxoffset) i += (232 * 30 * 31); if (BitConverter.ToUInt32(cybersav, i) != BitConverter.ToUInt32(newcyber, i)) { result += ((0x20000000 + i).ToString("X8") + " "); @@ -303,7 +307,7 @@ namespace PKHeX } // Loop Through Boxes - for (int i = 0x22600; i < 0x22600 + (232*30*31); i += 232) + for (int i = boxoffset; i < boxoffset + (232 * 30 * 31); i += 232) { byte[] newdata = new Byte[232]; Array.Copy(newcyber, i, newdata, 0, 232); byte[] olddata = new Byte[232]; Array.Copy(cybersav, i, olddata, 0, 232); diff --git a/PKX/f1-Main.cs b/PKX/f1-Main.cs index ac96ee787..b0c723d24 100644 --- a/PKX/f1-Main.cs +++ b/PKX/f1-Main.cs @@ -70,7 +70,7 @@ namespace PKHeX CB_MainLanguage.SelectedIndex = 0; #region HaX - bool HaX = (filename.IndexOf("HaX") >= 0); + HaX = (filename.IndexOf("HaX") >= 0); { CHK_HackedStats.Enabled = CHK_HackedStats.Visible = DEV_Ability.Enabled = DEV_Ability.Visible = @@ -195,6 +195,7 @@ namespace PKHeX public int genderflag, species; public int savindex; public bool savedited; + public bool HaX = false; public static int colorizedbox = 32; public static Image colorizedcolor = null; @@ -3938,7 +3939,7 @@ namespace PKHeX // temp ORAS save-editing disable // GB_SAVtools.Enabled = !oras; GB_SUBE.Visible = - B_OpenOPowers.Enabled = B_OpenPokedex.Enabled = + B_OpenPokedex.Enabled = B_OpenBerryField.Enabled = !oras; B_OpenSecretBase.Visible = oras; @@ -5777,6 +5778,35 @@ namespace PKHeX private void B_OpenOPowers_Click(object sender, EventArgs e) { // Open O-Power Menu + if (savegame_oras) + { + DialogResult dr = MessageBox.Show("No editing support for ORAS :(\n\nMax O-Powers with a working code?","Alert",MessageBoxButtons.YesNo); + if (dr == DialogResult.Yes) + { + byte[] maxoras = new byte[] + { + 0x00, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x01, 0x01, + 0x01, 0x01, 0x00, 0x01, + 0x01, 0x01, 0x01, 0x00, + 0x01, 0x01, 0x01, 0x01, + 0x00, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x00, 0x01, + 0x01, 0x01, 0x01, 0x00, + 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x00, 0x00, + }; + Array.Copy(maxoras, 0, savefile, 0x17400 + 0x5400 + 0x7F000 + savindex, 0x44); + } + return; + } SAV_OPower opower = new PKHeX.SAV_OPower(this); opower.ShowDialog(); } diff --git a/SAV/SAV_EventFlagsORAS.Designer.cs b/SAV/SAV_EventFlagsORAS.Designer.cs index 772e50a3e..eede07a88 100644 --- a/SAV/SAV_EventFlagsORAS.Designer.cs +++ b/SAV/SAV_EventFlagsORAS.Designer.cs @@ -47,6 +47,10 @@ this.flag_0647 = new System.Windows.Forms.CheckBox(); this.flag_2840 = new System.Windows.Forms.CheckBox(); this.GB_Rebattle = new System.Windows.Forms.GroupBox(); + this.flag_2825 = new System.Windows.Forms.CheckBox(); + this.flag_0176 = new System.Windows.Forms.CheckBox(); + this.flag_2814 = new System.Windows.Forms.CheckBox(); + this.flag_0209 = new System.Windows.Forms.CheckBox(); this.flag_2818 = new System.Windows.Forms.CheckBox(); this.flag_0181 = new System.Windows.Forms.CheckBox(); this.flag_2831 = new System.Windows.Forms.CheckBox(); @@ -64,10 +68,38 @@ this.flag_0286 = new System.Windows.Forms.CheckBox(); this.flag_0285 = new System.Windows.Forms.CheckBox(); this.flag_2546 = new System.Windows.Forms.CheckBox(); - this.flag_2814 = new System.Windows.Forms.CheckBox(); - this.flag_0209 = new System.Windows.Forms.CheckBox(); - this.flag_2825 = new System.Windows.Forms.CheckBox(); - this.flag_0176 = new System.Windows.Forms.CheckBox(); + this.flag_2817 = new System.Windows.Forms.CheckBox(); + this.flag_0180 = new System.Windows.Forms.CheckBox(); + this.flag_2816 = new System.Windows.Forms.CheckBox(); + this.flag_0179 = new System.Windows.Forms.CheckBox(); + this.flag_2833 = new System.Windows.Forms.CheckBox(); + this.flag_0184 = new System.Windows.Forms.CheckBox(); + this.flag_2819 = new System.Windows.Forms.CheckBox(); + this.flag_asdf = new System.Windows.Forms.CheckBox(); + this.flag_2823 = new System.Windows.Forms.CheckBox(); + this.checkBox10 = new System.Windows.Forms.CheckBox(); + this.checkBox11 = new System.Windows.Forms.CheckBox(); + this.checkBox12 = new System.Windows.Forms.CheckBox(); + this.checkBox13 = new System.Windows.Forms.CheckBox(); + this.checkBox14 = new System.Windows.Forms.CheckBox(); + this.checkBox15 = new System.Windows.Forms.CheckBox(); + this.checkBox16 = new System.Windows.Forms.CheckBox(); + this.flag_2829 = new System.Windows.Forms.CheckBox(); + this.checkBox18 = new System.Windows.Forms.CheckBox(); + this.flag_2832 = new System.Windows.Forms.CheckBox(); + this.checkBox20 = new System.Windows.Forms.CheckBox(); + this.flag_2813 = new System.Windows.Forms.CheckBox(); + this.flag_0175 = new System.Windows.Forms.CheckBox(); + this.flag_2811 = new System.Windows.Forms.CheckBox(); + this.flag_0173 = new System.Windows.Forms.CheckBox(); + this.flag_2812 = new System.Windows.Forms.CheckBox(); + this.flag_0174 = new System.Windows.Forms.CheckBox(); + this.checkBox27 = new System.Windows.Forms.CheckBox(); + this.checkBox28 = new System.Windows.Forms.CheckBox(); + this.checkBox29 = new System.Windows.Forms.CheckBox(); + this.checkBox30 = new System.Windows.Forms.CheckBox(); + this.checkBox31 = new System.Windows.Forms.CheckBox(); + this.checkBox32 = new System.Windows.Forms.CheckBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nud)).BeginInit(); this.groupBox2.SuspendLayout(); @@ -90,7 +122,8 @@ // // B_Cancel // - this.B_Cancel.Location = new System.Drawing.Point(287, 307); + this.B_Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.B_Cancel.Location = new System.Drawing.Point(614, 307); this.B_Cancel.Name = "B_Cancel"; this.B_Cancel.Size = new System.Drawing.Size(75, 23); this.B_Cancel.TabIndex = 2; @@ -140,7 +173,8 @@ // // B_Save // - this.B_Save.Location = new System.Drawing.Point(366, 306); + this.B_Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.B_Save.Location = new System.Drawing.Point(693, 306); this.B_Save.Name = "B_Save"; this.B_Save.Size = new System.Drawing.Size(75, 23); this.B_Save.TabIndex = 9; @@ -243,9 +277,9 @@ this.flag_0647.CheckAlign = System.Drawing.ContentAlignment.TopLeft; this.flag_0647.Location = new System.Drawing.Point(16, 19); this.flag_0647.Name = "flag_0647"; - this.flag_0647.Size = new System.Drawing.Size(108, 17); + this.flag_0647.Size = new System.Drawing.Size(152, 17); this.flag_0647.TabIndex = 14; - this.flag_0647.Text = "Mascot Defeated"; + this.flag_0647.Text = "Kyogre/Groudon Defeated"; this.flag_0647.UseVisualStyleBackColor = true; this.flag_0647.Click += new System.EventHandler(this.toggleFlag); // @@ -255,14 +289,48 @@ this.flag_2840.CheckAlign = System.Drawing.ContentAlignment.TopLeft; this.flag_2840.Location = new System.Drawing.Point(16, 34); this.flag_2840.Name = "flag_2840"; - this.flag_2840.Size = new System.Drawing.Size(107, 17); + this.flag_2840.Size = new System.Drawing.Size(151, 17); this.flag_2840.TabIndex = 15; - this.flag_2840.Text = "Mascot Captured"; + this.flag_2840.Text = "Kyogre/Groudon Captured"; this.flag_2840.UseVisualStyleBackColor = true; this.flag_2840.Click += new System.EventHandler(this.toggleFlag); // // GB_Rebattle // + this.GB_Rebattle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.GB_Rebattle.Controls.Add(this.checkBox27); + this.GB_Rebattle.Controls.Add(this.checkBox28); + this.GB_Rebattle.Controls.Add(this.checkBox29); + this.GB_Rebattle.Controls.Add(this.checkBox30); + this.GB_Rebattle.Controls.Add(this.checkBox31); + this.GB_Rebattle.Controls.Add(this.checkBox32); + this.GB_Rebattle.Controls.Add(this.flag_2813); + this.GB_Rebattle.Controls.Add(this.flag_0175); + this.GB_Rebattle.Controls.Add(this.flag_2811); + this.GB_Rebattle.Controls.Add(this.flag_0173); + this.GB_Rebattle.Controls.Add(this.flag_2812); + this.GB_Rebattle.Controls.Add(this.flag_0174); + this.GB_Rebattle.Controls.Add(this.flag_2832); + this.GB_Rebattle.Controls.Add(this.checkBox20); + this.GB_Rebattle.Controls.Add(this.flag_2829); + this.GB_Rebattle.Controls.Add(this.checkBox18); + this.GB_Rebattle.Controls.Add(this.checkBox15); + this.GB_Rebattle.Controls.Add(this.checkBox16); + this.GB_Rebattle.Controls.Add(this.checkBox13); + this.GB_Rebattle.Controls.Add(this.checkBox14); + this.GB_Rebattle.Controls.Add(this.checkBox11); + this.GB_Rebattle.Controls.Add(this.checkBox12); + this.GB_Rebattle.Controls.Add(this.flag_2823); + this.GB_Rebattle.Controls.Add(this.checkBox10); + this.GB_Rebattle.Controls.Add(this.flag_2819); + this.GB_Rebattle.Controls.Add(this.flag_asdf); + this.GB_Rebattle.Controls.Add(this.flag_2833); + this.GB_Rebattle.Controls.Add(this.flag_0184); + this.GB_Rebattle.Controls.Add(this.flag_2816); + this.GB_Rebattle.Controls.Add(this.flag_0179); + this.GB_Rebattle.Controls.Add(this.flag_2817); + this.GB_Rebattle.Controls.Add(this.flag_0180); this.GB_Rebattle.Controls.Add(this.flag_2825); this.GB_Rebattle.Controls.Add(this.flag_0176); this.GB_Rebattle.Controls.Add(this.flag_2814); @@ -273,18 +341,62 @@ this.GB_Rebattle.Controls.Add(this.flag_0183); this.GB_Rebattle.Controls.Add(this.flag_2840); this.GB_Rebattle.Controls.Add(this.flag_0647); - this.GB_Rebattle.Location = new System.Drawing.Point(129, 12); + this.GB_Rebattle.Location = new System.Drawing.Point(285, 12); this.GB_Rebattle.Name = "GB_Rebattle"; - this.GB_Rebattle.Size = new System.Drawing.Size(152, 191); + this.GB_Rebattle.Size = new System.Drawing.Size(479, 288); this.GB_Rebattle.TabIndex = 16; this.GB_Rebattle.TabStop = false; this.GB_Rebattle.Text = "Rebattle"; // + // flag_2825 + // + this.flag_2825.AutoSize = true; + this.flag_2825.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2825.Location = new System.Drawing.Point(329, 186); + this.flag_2825.Name = "flag_2825"; + this.flag_2825.Size = new System.Drawing.Size(113, 17); + this.flag_2825.TabIndex = 23; + this.flag_2825.Text = "Cobalion Captured"; + this.flag_2825.UseVisualStyleBackColor = true; + // + // flag_0176 + // + this.flag_0176.AutoSize = true; + this.flag_0176.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_0176.Location = new System.Drawing.Point(329, 171); + this.flag_0176.Name = "flag_0176"; + this.flag_0176.Size = new System.Drawing.Size(114, 17); + this.flag_0176.TabIndex = 22; + this.flag_0176.Text = "Cobalion Defeated"; + this.flag_0176.UseVisualStyleBackColor = true; + // + // flag_2814 + // + this.flag_2814.AutoSize = true; + this.flag_2814.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2814.Location = new System.Drawing.Point(174, 110); + this.flag_2814.Name = "flag_2814"; + this.flag_2814.Size = new System.Drawing.Size(134, 17); + this.flag_2814.TabIndex = 21; + this.flag_2814.Text = "Lugia/Ho-Oh Captured"; + this.flag_2814.UseVisualStyleBackColor = true; + // + // flag_0209 + // + this.flag_0209.AutoSize = true; + this.flag_0209.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_0209.Location = new System.Drawing.Point(174, 95); + this.flag_0209.Name = "flag_0209"; + this.flag_0209.Size = new System.Drawing.Size(135, 17); + this.flag_0209.TabIndex = 20; + this.flag_0209.Text = "Lugia/Ho-Oh Defeated"; + this.flag_0209.UseVisualStyleBackColor = true; + // // flag_2818 // this.flag_2818.AutoSize = true; this.flag_2818.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_2818.Location = new System.Drawing.Point(16, 94); + this.flag_2818.Location = new System.Drawing.Point(174, 186); this.flag_2818.Name = "flag_2818"; this.flag_2818.Size = new System.Drawing.Size(95, 17); this.flag_2818.TabIndex = 19; @@ -295,7 +407,7 @@ // this.flag_0181.AutoSize = true; this.flag_0181.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0181.Location = new System.Drawing.Point(16, 79); + this.flag_0181.Location = new System.Drawing.Point(174, 171); this.flag_0181.Name = "flag_0181"; this.flag_0181.Size = new System.Drawing.Size(96, 17); this.flag_0181.TabIndex = 18; @@ -306,7 +418,7 @@ // this.flag_2831.AutoSize = true; this.flag_2831.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_2831.Location = new System.Drawing.Point(16, 64); + this.flag_2831.Location = new System.Drawing.Point(329, 34); this.flag_2831.Name = "flag_2831"; this.flag_2831.Size = new System.Drawing.Size(121, 17); this.flag_2831.TabIndex = 17; @@ -317,7 +429,7 @@ // this.flag_0183.AutoSize = true; this.flag_0183.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0183.Location = new System.Drawing.Point(16, 49); + this.flag_0183.Location = new System.Drawing.Point(329, 19); this.flag_0183.Name = "flag_0183"; this.flag_0183.Size = new System.Drawing.Size(122, 17); this.flag_0183.TabIndex = 16; @@ -337,9 +449,9 @@ this.groupBox3.Controls.Add(this.flag_0675); this.groupBox3.Controls.Add(this.flag_0286); this.groupBox3.Controls.Add(this.flag_0285); - this.groupBox3.Location = new System.Drawing.Point(287, 12); + this.groupBox3.Location = new System.Drawing.Point(125, 10); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(154, 288); + this.groupBox3.Size = new System.Drawing.Size(154, 194); this.groupBox3.TabIndex = 17; this.groupBox3.TabStop = false; this.groupBox3.Text = "Misc"; @@ -385,7 +497,7 @@ // this.flag_0294.AutoSize = true; this.flag_0294.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0294.Location = new System.Drawing.Point(6, 159); + this.flag_0294.Location = new System.Drawing.Point(6, 156); this.flag_0294.Name = "flag_0294"; this.flag_0294.Size = new System.Drawing.Size(128, 17); this.flag_0294.TabIndex = 22; @@ -397,7 +509,7 @@ // this.flag_0293.AutoSize = true; this.flag_0293.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0293.Location = new System.Drawing.Point(6, 144); + this.flag_0293.Location = new System.Drawing.Point(6, 141); this.flag_0293.Name = "flag_0293"; this.flag_0293.Size = new System.Drawing.Size(146, 17); this.flag_0293.TabIndex = 21; @@ -409,7 +521,7 @@ // this.flag_0292.AutoSize = true; this.flag_0292.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0292.Location = new System.Drawing.Point(6, 129); + this.flag_0292.Location = new System.Drawing.Point(6, 126); this.flag_0292.Name = "flag_0292"; this.flag_0292.Size = new System.Drawing.Size(137, 17); this.flag_0292.TabIndex = 20; @@ -421,7 +533,7 @@ // this.flag_0291.AutoSize = true; this.flag_0291.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0291.Location = new System.Drawing.Point(6, 114); + this.flag_0291.Location = new System.Drawing.Point(6, 111); this.flag_0291.Name = "flag_0291"; this.flag_0291.Size = new System.Drawing.Size(145, 17); this.flag_0291.TabIndex = 19; @@ -433,7 +545,7 @@ // this.flag_0290.AutoSize = true; this.flag_0290.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0290.Location = new System.Drawing.Point(6, 99); + this.flag_0290.Location = new System.Drawing.Point(6, 96); this.flag_0290.Name = "flag_0290"; this.flag_0290.Size = new System.Drawing.Size(140, 17); this.flag_0290.TabIndex = 18; @@ -445,7 +557,7 @@ // this.flag_0675.AutoSize = true; this.flag_0675.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0675.Location = new System.Drawing.Point(15, 243); + this.flag_0675.Location = new System.Drawing.Point(6, 174); this.flag_0675.Name = "flag_0675"; this.flag_0675.Size = new System.Drawing.Size(119, 17); this.flag_0675.TabIndex = 17; @@ -489,55 +601,378 @@ this.flag_2546.UseVisualStyleBackColor = true; this.flag_2546.Click += new System.EventHandler(this.toggleFlag); // - // flag_2814 + // flag_2817 // - this.flag_2814.AutoSize = true; - this.flag_2814.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_2814.Location = new System.Drawing.Point(16, 124); - this.flag_2814.Name = "flag_2814"; - this.flag_2814.Size = new System.Drawing.Size(134, 17); - this.flag_2814.TabIndex = 21; - this.flag_2814.Text = "Lugia/Ho-Oh Captured"; - this.flag_2814.UseVisualStyleBackColor = true; + this.flag_2817.AutoSize = true; + this.flag_2817.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2817.Location = new System.Drawing.Point(174, 216); + this.flag_2817.Name = "flag_2817"; + this.flag_2817.Size = new System.Drawing.Size(106, 17); + this.flag_2817.TabIndex = 25; + this.flag_2817.Text = "Mesprit Captured"; + this.flag_2817.UseVisualStyleBackColor = true; // - // flag_0209 + // flag_0180 // - this.flag_0209.AutoSize = true; - this.flag_0209.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0209.Location = new System.Drawing.Point(16, 109); - this.flag_0209.Name = "flag_0209"; - this.flag_0209.Size = new System.Drawing.Size(135, 17); - this.flag_0209.TabIndex = 20; - this.flag_0209.Text = "Lugia/Ho-Oh Defeated"; - this.flag_0209.UseVisualStyleBackColor = true; + this.flag_0180.AutoSize = true; + this.flag_0180.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_0180.Location = new System.Drawing.Point(174, 201); + this.flag_0180.Name = "flag_0180"; + this.flag_0180.Size = new System.Drawing.Size(107, 17); + this.flag_0180.TabIndex = 24; + this.flag_0180.Text = "Mesprit Defeated"; + this.flag_0180.UseVisualStyleBackColor = true; // - // flag_2825 + // flag_2816 // - this.flag_2825.AutoSize = true; - this.flag_2825.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_2825.Location = new System.Drawing.Point(16, 154); - this.flag_2825.Name = "flag_2825"; - this.flag_2825.Size = new System.Drawing.Size(113, 17); - this.flag_2825.TabIndex = 23; - this.flag_2825.Text = "Cobalion Captured"; - this.flag_2825.UseVisualStyleBackColor = true; + this.flag_2816.AutoSize = true; + this.flag_2816.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2816.Location = new System.Drawing.Point(174, 246); + this.flag_2816.Name = "flag_2816"; + this.flag_2816.Size = new System.Drawing.Size(93, 17); + this.flag_2816.TabIndex = 27; + this.flag_2816.Text = "Uxie Captured"; + this.flag_2816.UseVisualStyleBackColor = true; // - // flag_0176 + // flag_0179 // - this.flag_0176.AutoSize = true; - this.flag_0176.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.flag_0176.Location = new System.Drawing.Point(16, 139); - this.flag_0176.Name = "flag_0176"; - this.flag_0176.Size = new System.Drawing.Size(114, 17); - this.flag_0176.TabIndex = 22; - this.flag_0176.Text = "Cobalion Defeated"; - this.flag_0176.UseVisualStyleBackColor = true; + this.flag_0179.AutoSize = true; + this.flag_0179.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_0179.Location = new System.Drawing.Point(174, 231); + this.flag_0179.Name = "flag_0179"; + this.flag_0179.Size = new System.Drawing.Size(94, 17); + this.flag_0179.TabIndex = 26; + this.flag_0179.Text = "Uxie Defeated"; + this.flag_0179.UseVisualStyleBackColor = true; + // + // flag_2833 + // + this.flag_2833.AutoSize = true; + this.flag_2833.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2833.Location = new System.Drawing.Point(329, 72); + this.flag_2833.Name = "flag_2833"; + this.flag_2833.Size = new System.Drawing.Size(107, 17); + this.flag_2833.TabIndex = 29; + this.flag_2833.Text = "Kyurem Captured"; + this.flag_2833.UseVisualStyleBackColor = true; + // + // flag_0184 + // + this.flag_0184.AutoSize = true; + this.flag_0184.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_0184.Location = new System.Drawing.Point(329, 57); + this.flag_0184.Name = "flag_0184"; + this.flag_0184.Size = new System.Drawing.Size(108, 17); + this.flag_0184.TabIndex = 28; + this.flag_0184.Text = "Kyurem Defeated"; + this.flag_0184.UseVisualStyleBackColor = true; + // + // flag_2819 + // + this.flag_2819.AutoSize = true; + this.flag_2819.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2819.Location = new System.Drawing.Point(174, 34); + this.flag_2819.Name = "flag_2819"; + this.flag_2819.Size = new System.Drawing.Size(136, 17); + this.flag_2819.TabIndex = 31; + this.flag_2819.Text = "Dialga/Palkia Captured"; + this.flag_2819.UseVisualStyleBackColor = true; + // + // flag_asdf + // + this.flag_asdf.AutoSize = true; + this.flag_asdf.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_asdf.Location = new System.Drawing.Point(174, 19); + this.flag_asdf.Name = "flag_asdf"; + this.flag_asdf.Size = new System.Drawing.Size(137, 17); + this.flag_asdf.TabIndex = 30; + this.flag_asdf.Text = "Dialga/Palkia Defeated"; + this.flag_asdf.UseVisualStyleBackColor = true; + this.flag_asdf.Visible = false; + // + // flag_2823 + // + this.flag_2823.AutoSize = true; + this.flag_2823.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2823.Location = new System.Drawing.Point(174, 72); + this.flag_2823.Name = "flag_2823"; + this.flag_2823.Size = new System.Drawing.Size(108, 17); + this.flag_2823.TabIndex = 33; + this.flag_2823.Text = "Giratina Captured"; + this.flag_2823.UseVisualStyleBackColor = true; + // + // checkBox10 + // + this.checkBox10.AutoSize = true; + this.checkBox10.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox10.Location = new System.Drawing.Point(174, 57); + this.checkBox10.Name = "checkBox10"; + this.checkBox10.Size = new System.Drawing.Size(109, 17); + this.checkBox10.TabIndex = 32; + this.checkBox10.Text = "Giratina Defeated"; + this.checkBox10.UseVisualStyleBackColor = true; + this.checkBox10.Visible = false; + // + // checkBox11 + // + this.checkBox11.AutoSize = true; + this.checkBox11.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox11.Location = new System.Drawing.Point(329, 216); + this.checkBox11.Name = "checkBox11"; + this.checkBox11.Size = new System.Drawing.Size(117, 17); + this.checkBox11.TabIndex = 35; + this.checkBox11.Text = "Terrakion Captured"; + this.checkBox11.UseVisualStyleBackColor = true; + this.checkBox11.Visible = false; + // + // checkBox12 + // + this.checkBox12.AutoSize = true; + this.checkBox12.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox12.Location = new System.Drawing.Point(329, 201); + this.checkBox12.Name = "checkBox12"; + this.checkBox12.Size = new System.Drawing.Size(118, 17); + this.checkBox12.TabIndex = 34; + this.checkBox12.Text = "Terrakion Defeated"; + this.checkBox12.UseVisualStyleBackColor = true; + this.checkBox12.Visible = false; + // + // checkBox13 + // + this.checkBox13.AutoSize = true; + this.checkBox13.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox13.Location = new System.Drawing.Point(329, 246); + this.checkBox13.Name = "checkBox13"; + this.checkBox13.Size = new System.Drawing.Size(105, 17); + this.checkBox13.TabIndex = 37; + this.checkBox13.Text = "Virizion Captured"; + this.checkBox13.UseVisualStyleBackColor = true; + this.checkBox13.Visible = false; + // + // checkBox14 + // + this.checkBox14.AutoSize = true; + this.checkBox14.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox14.Location = new System.Drawing.Point(329, 231); + this.checkBox14.Name = "checkBox14"; + this.checkBox14.Size = new System.Drawing.Size(106, 17); + this.checkBox14.TabIndex = 36; + this.checkBox14.Text = "Virizion Defeated"; + this.checkBox14.UseVisualStyleBackColor = true; + this.checkBox14.Visible = false; + // + // checkBox15 + // + this.checkBox15.AutoSize = true; + this.checkBox15.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox15.Location = new System.Drawing.Point(173, 148); + this.checkBox15.Name = "checkBox15"; + this.checkBox15.Size = new System.Drawing.Size(119, 17); + this.checkBox15.TabIndex = 39; + this.checkBox15.Text = "Regigigas Captured"; + this.checkBox15.UseVisualStyleBackColor = true; + this.checkBox15.Visible = false; + // + // checkBox16 + // + this.checkBox16.AutoSize = true; + this.checkBox16.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox16.Location = new System.Drawing.Point(173, 133); + this.checkBox16.Name = "checkBox16"; + this.checkBox16.Size = new System.Drawing.Size(120, 17); + this.checkBox16.TabIndex = 38; + this.checkBox16.Text = "Regigigas Defeated"; + this.checkBox16.UseVisualStyleBackColor = true; + this.checkBox16.Visible = false; + // + // flag_2829 + // + this.flag_2829.AutoSize = true; + this.flag_2829.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2829.Location = new System.Drawing.Point(329, 110); + this.flag_2829.Name = "flag_2829"; + this.flag_2829.Size = new System.Drawing.Size(136, 17); + this.flag_2829.TabIndex = 41; + this.flag_2829.Text = "Torn./Thund. Captured"; + this.flag_2829.UseVisualStyleBackColor = true; + // + // checkBox18 + // + this.checkBox18.AutoSize = true; + this.checkBox18.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox18.Location = new System.Drawing.Point(329, 95); + this.checkBox18.Name = "checkBox18"; + this.checkBox18.Size = new System.Drawing.Size(137, 17); + this.checkBox18.TabIndex = 40; + this.checkBox18.Text = "Torn./Thund. Defeated"; + this.checkBox18.UseVisualStyleBackColor = true; + this.checkBox18.Visible = false; + // + // flag_2832 + // + this.flag_2832.AutoSize = true; + this.flag_2832.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2832.Location = new System.Drawing.Point(329, 148); + this.flag_2832.Name = "flag_2832"; + this.flag_2832.Size = new System.Drawing.Size(116, 17); + this.flag_2832.TabIndex = 43; + this.flag_2832.Text = "Landorus Captured"; + this.flag_2832.UseVisualStyleBackColor = true; + // + // checkBox20 + // + this.checkBox20.AutoSize = true; + this.checkBox20.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox20.Location = new System.Drawing.Point(329, 133); + this.checkBox20.Name = "checkBox20"; + this.checkBox20.Size = new System.Drawing.Size(117, 17); + this.checkBox20.TabIndex = 42; + this.checkBox20.Text = "Landorus Defeated"; + this.checkBox20.UseVisualStyleBackColor = true; + // + // flag_2813 + // + this.flag_2813.AutoSize = true; + this.flag_2813.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2813.Location = new System.Drawing.Point(16, 246); + this.flag_2813.Name = "flag_2813"; + this.flag_2813.Size = new System.Drawing.Size(111, 17); + this.flag_2813.TabIndex = 49; + this.flag_2813.Text = "Suicune Captured"; + this.flag_2813.UseVisualStyleBackColor = true; + // + // flag_0175 + // + this.flag_0175.AutoSize = true; + this.flag_0175.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_0175.Location = new System.Drawing.Point(16, 231); + this.flag_0175.Name = "flag_0175"; + this.flag_0175.Size = new System.Drawing.Size(112, 17); + this.flag_0175.TabIndex = 48; + this.flag_0175.Text = "Suicune Defeated"; + this.flag_0175.UseVisualStyleBackColor = true; + // + // flag_2811 + // + this.flag_2811.AutoSize = true; + this.flag_2811.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2811.Location = new System.Drawing.Point(16, 216); + this.flag_2811.Name = "flag_2811"; + this.flag_2811.Size = new System.Drawing.Size(106, 17); + this.flag_2811.TabIndex = 47; + this.flag_2811.Text = "Raikou Captured"; + this.flag_2811.UseVisualStyleBackColor = true; + // + // flag_0173 + // + this.flag_0173.AutoSize = true; + this.flag_0173.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_0173.Location = new System.Drawing.Point(16, 201); + this.flag_0173.Name = "flag_0173"; + this.flag_0173.Size = new System.Drawing.Size(107, 17); + this.flag_0173.TabIndex = 46; + this.flag_0173.Text = "Raikou Defeated"; + this.flag_0173.UseVisualStyleBackColor = true; + // + // flag_2812 + // + this.flag_2812.AutoSize = true; + this.flag_2812.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_2812.Location = new System.Drawing.Point(16, 186); + this.flag_2812.Name = "flag_2812"; + this.flag_2812.Size = new System.Drawing.Size(96, 17); + this.flag_2812.TabIndex = 45; + this.flag_2812.Text = "Entei Captured"; + this.flag_2812.UseVisualStyleBackColor = true; + // + // flag_0174 + // + this.flag_0174.AutoSize = true; + this.flag_0174.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.flag_0174.Location = new System.Drawing.Point(16, 171); + this.flag_0174.Name = "flag_0174"; + this.flag_0174.Size = new System.Drawing.Size(97, 17); + this.flag_0174.TabIndex = 44; + this.flag_0174.Text = "Entei Defeated"; + this.flag_0174.UseVisualStyleBackColor = true; + // + // checkBox27 + // + this.checkBox27.AutoSize = true; + this.checkBox27.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox27.Location = new System.Drawing.Point(16, 148); + this.checkBox27.Name = "checkBox27"; + this.checkBox27.Size = new System.Drawing.Size(116, 17); + this.checkBox27.TabIndex = 55; + this.checkBox27.Text = "Registeel Captured"; + this.checkBox27.UseVisualStyleBackColor = true; + this.checkBox27.Visible = false; + // + // checkBox28 + // + this.checkBox28.AutoSize = true; + this.checkBox28.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox28.Location = new System.Drawing.Point(16, 133); + this.checkBox28.Name = "checkBox28"; + this.checkBox28.Size = new System.Drawing.Size(117, 17); + this.checkBox28.TabIndex = 54; + this.checkBox28.Text = "Registeel Defeated"; + this.checkBox28.UseVisualStyleBackColor = true; + this.checkBox28.Visible = false; + // + // checkBox29 + // + this.checkBox29.AutoSize = true; + this.checkBox29.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox29.Location = new System.Drawing.Point(16, 118); + this.checkBox29.Name = "checkBox29"; + this.checkBox29.Size = new System.Drawing.Size(115, 17); + this.checkBox29.TabIndex = 53; + this.checkBox29.Text = "Regirock Captured"; + this.checkBox29.UseVisualStyleBackColor = true; + this.checkBox29.Visible = false; + // + // checkBox30 + // + this.checkBox30.AutoSize = true; + this.checkBox30.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox30.Location = new System.Drawing.Point(16, 103); + this.checkBox30.Name = "checkBox30"; + this.checkBox30.Size = new System.Drawing.Size(116, 17); + this.checkBox30.TabIndex = 52; + this.checkBox30.Text = "Regirock Defeated"; + this.checkBox30.UseVisualStyleBackColor = true; + this.checkBox30.Visible = false; + // + // checkBox31 + // + this.checkBox31.AutoSize = true; + this.checkBox31.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox31.Location = new System.Drawing.Point(16, 88); + this.checkBox31.Name = "checkBox31"; + this.checkBox31.Size = new System.Drawing.Size(106, 17); + this.checkBox31.TabIndex = 51; + this.checkBox31.Text = "Regice Captured"; + this.checkBox31.UseVisualStyleBackColor = true; + this.checkBox31.Visible = false; + // + // checkBox32 + // + this.checkBox32.AutoSize = true; + this.checkBox32.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.checkBox32.Location = new System.Drawing.Point(16, 73); + this.checkBox32.Name = "checkBox32"; + this.checkBox32.Size = new System.Drawing.Size(107, 17); + this.checkBox32.TabIndex = 50; + this.checkBox32.Text = "Regice Defeated"; + this.checkBox32.UseVisualStyleBackColor = true; + this.checkBox32.Visible = false; // // SAV_EventFlagsORAS // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(449, 342); + this.ClientSize = new System.Drawing.Size(776, 342); this.Controls.Add(this.flag_2546); this.Controls.Add(this.groupBox3); this.Controls.Add(this.GB_Rebattle); @@ -607,5 +1042,37 @@ private System.Windows.Forms.CheckBox flag_0209; private System.Windows.Forms.CheckBox flag_2825; private System.Windows.Forms.CheckBox flag_0176; + private System.Windows.Forms.CheckBox flag_2813; + private System.Windows.Forms.CheckBox flag_0175; + private System.Windows.Forms.CheckBox flag_2811; + private System.Windows.Forms.CheckBox flag_0173; + private System.Windows.Forms.CheckBox flag_2812; + private System.Windows.Forms.CheckBox flag_0174; + private System.Windows.Forms.CheckBox flag_2832; + private System.Windows.Forms.CheckBox checkBox20; + private System.Windows.Forms.CheckBox flag_2829; + private System.Windows.Forms.CheckBox checkBox18; + private System.Windows.Forms.CheckBox checkBox15; + private System.Windows.Forms.CheckBox checkBox16; + private System.Windows.Forms.CheckBox checkBox13; + private System.Windows.Forms.CheckBox checkBox14; + private System.Windows.Forms.CheckBox checkBox11; + private System.Windows.Forms.CheckBox checkBox12; + private System.Windows.Forms.CheckBox flag_2823; + private System.Windows.Forms.CheckBox checkBox10; + private System.Windows.Forms.CheckBox flag_2819; + private System.Windows.Forms.CheckBox flag_asdf; + private System.Windows.Forms.CheckBox flag_2833; + private System.Windows.Forms.CheckBox flag_0184; + private System.Windows.Forms.CheckBox flag_2816; + private System.Windows.Forms.CheckBox flag_0179; + private System.Windows.Forms.CheckBox flag_2817; + private System.Windows.Forms.CheckBox flag_0180; + private System.Windows.Forms.CheckBox checkBox27; + private System.Windows.Forms.CheckBox checkBox28; + private System.Windows.Forms.CheckBox checkBox29; + private System.Windows.Forms.CheckBox checkBox30; + private System.Windows.Forms.CheckBox checkBox31; + private System.Windows.Forms.CheckBox checkBox32; } } \ No newline at end of file diff --git a/SAV/SAV_EventFlagsORAS.cs b/SAV/SAV_EventFlagsORAS.cs index 669d0a4f3..83511d209 100644 --- a/SAV/SAV_EventFlagsORAS.cs +++ b/SAV/SAV_EventFlagsORAS.cs @@ -53,11 +53,26 @@ namespace PKHeX chka = new CheckBox[] { flag_0647,flag_2840, // Kyogre/Rayquaza - flag_0183,flag_2831, // Zekrom - flag_0181,flag_2818, // Azelf + + + flag_0173,flag_2811, // Raikou + flag_0174,flag_2812, // Entei + flag_0175,flag_2813, // Suicune flag_0209,flag_2814, // Lugia/Ho-Oh + + flag_0179,flag_2816, // Uxie + flag_0180,flag_2817, // Mesprit + flag_0181,flag_2818, // Azelf + flag_2819, // Dialga/Palkia + + flag_2823, // Giratina flag_0176,flag_2825, // Cobalion + flag_2829, // Tornadus/Thundurus + flag_0183,flag_2831, // Zekrom/Reshiram + flag_2832, // Landorus + flag_0184,flag_2833, // Kyurem + // old flag_0285,flag_0286,flag_0287,flag_0288,flag_0289, // Statuettes flag_0290,flag_0291,flag_0292,flag_0293,flag_0294, // Super Unlocks diff --git a/SAV/SAV_Inventory.cs b/SAV/SAV_Inventory.cs index 99b6c36be..1ac75d42e 100644 --- a/SAV/SAV_Inventory.cs +++ b/SAV/SAV_Inventory.cs @@ -217,17 +217,17 @@ namespace PKHeX private void popItems() { int offset = bagoffsets[0] + shiftval; - populateList(item_val, offset, 200); // max 400 + populateList(item_val, offset, 308); // max 400 } private void popKeyItems() { int offset = bagoffsets[1] + shiftval; - populateList(keyitem_val, offset, 50); // max 96 + populateList(keyitem_val, offset, 60); // max 96 } private void popTMHM() { int offset = bagoffsets[2] + shiftval; - populateList(tmhm_val, offset, 105); // 106 total tho + populateList(tmhm_val, offset, 105 + 3*Convert.ToInt16(m_parent.savegame_oras)); // 106 total tho } private void popMedicine() { @@ -271,10 +271,7 @@ namespace PKHeX for (int i = 0; i < itemcount; i++) { int itemvalue = BitConverter.ToUInt16(sav, offset + i*4); - try - { - itemname = Form1.itemlist[itemvalue]; - } + try { itemname = Form1.itemlist[itemvalue]; } catch { MessageBox.Show("Unknown item detected.\r\n\r\nItem ID: " + itemvalue + "\r\n" + "Item is after: " + itemname, "Error"); @@ -378,79 +375,56 @@ namespace PKHeX btn.ForeColor = Color.Red; } - private void giveAllItems() + private void giveAll(string[] inarray, int count) { - byte[] data = new byte[] { - 0x42,0x01,0xE3,0x03,0x43,0x01,0xE3,0x03,0x44,0x01,0xE3,0x03,0x45,0x01,0xE3,0x03, - 0x46,0x01,0xE3,0x03,0x47,0x01,0xE3,0x03,0xE5,0x01,0xE3,0x03,0xE6,0x01,0xE3,0x03, - 0xE7,0x01,0xE3,0x03,0xE8,0x01,0xE3,0x03,0xE9,0x01,0xE3,0x03,0xEA,0x01,0xE3,0x03, - 0xEB,0x01,0xE3,0x03,0xEC,0x01,0xE3,0x03,0xED,0x01,0xE3,0x03,0xEE,0x01,0xE3,0x03, - 0xEF,0x01,0xE3,0x03,0xF0,0x01,0xE3,0x03,0xF1,0x01,0xE3,0x03,0xF2,0x01,0xE3,0x03, - 0xF3,0x01,0xE3,0x03,0xF4,0x01,0xE3,0x03,0x19,0x02,0xE3,0x03,0x1A,0x02,0xE3,0x03, - 0x1B,0x02,0xE3,0x03,0x1C,0x02,0xE3,0x03,0x1D,0x02,0xE3,0x03,0x1E,0x02,0xE3,0x03, - 0x1F,0x02,0xE3,0x03,0x20,0x02,0xE3,0x03,0x21,0x02,0xE3,0x03,0x22,0x02,0xE3,0x03, - 0x23,0x02,0xE3,0x03,0x24,0x02,0xE3,0x03,0x25,0x02,0xE3,0x03,0x26,0x02,0xE3,0x03, - 0x27,0x02,0xE3,0x03,0x28,0x02,0xE3,0x03,0x29,0x02,0xE3,0x03,0x2A,0x02,0xE3,0x03, - 0x2B,0x02,0xE3,0x03,0x2C,0x02,0xE3,0x03,0x2D,0x02,0xE3,0x03,0x2E,0x02,0xE3,0x03, - 0x2F,0x02,0xE3,0x03,0x30,0x02,0xE3,0x03,0x31,0x02,0xE3,0x03,0x32,0x02,0xE3,0x03, - 0x33,0x02,0xE3,0x03,0x34,0x02,0xE3,0x03,0x3B,0x02,0xE3,0x03,0x3C,0x02,0xE3,0x03, - 0x3D,0x02,0xE3,0x03,0x3F,0x02,0xE3,0x03,0x40,0x02,0xE3,0x03,0x41,0x02,0xE3,0x03, - 0x44,0x02,0xE3,0x03,0x45,0x02,0xE3,0x03,0x46,0x02,0xE3,0x03,0x47,0x02,0xE3,0x03, - 0x48,0x02,0xE3,0x03,0x49,0x02,0xE3,0x03,0x4A,0x02,0xE3,0x03,0x4B,0x02,0xE3,0x03, - 0x4C,0x02,0xE3,0x03,0x4D,0x02,0xE3,0x03,0x4E,0x02,0xE3,0x03,0x50,0x02,0xE3,0x03, - 0x51,0x02,0xE3,0x03,0x52,0x02,0xE3,0x03,0x53,0x02,0xE3,0x03,0x54,0x02,0xE3,0x03, - 0x55,0x02,0xE3,0x03,0x56,0x02,0xE3,0x03,0x57,0x02,0xE3,0x03,0x58,0x02,0xE3,0x03, - 0x59,0x02,0xE3,0x03,0x5A,0x02,0xE3,0x03,0x5B,0x02,0xE3,0x03,0x5C,0x02,0xE3,0x03, - 0x5D,0x02,0xE3,0x03,0x5E,0x02,0xE3,0x03,0x5F,0x02,0xE3,0x03,0x60,0x02,0xE3,0x03, - 0x61,0x02,0xE3,0x03,0x62,0x02,0xE3,0x03,0x63,0x02,0xE3,0x03,0x64,0x02,0xE3,0x03, - 0x65,0x02,0xE3,0x03,0x66,0x02,0xE3,0x03,0x67,0x02,0xE3,0x03,0x7F,0x02,0xE3,0x03, - 0x80,0x02,0xE3,0x03,0x84,0x02,0xE3,0x03,0x86,0x02,0xE3,0x03,0x87,0x02,0xE3,0x03, - 0x88,0x02,0xE3,0x03,0x89,0x02,0xE3,0x03,0x8A,0x02,0xE3,0x03,0x8C,0x02,0xE3,0x03, - 0x8D,0x02,0xE3,0x03,0x8E,0x02,0xE3,0x03,0x8F,0x02,0xE3,0x03,0x90,0x02,0xE3,0x03, - 0x91,0x02,0xE3,0x03,0x92,0x02,0xE3,0x03,0x93,0x02,0xE3,0x03,0x94,0x02,0xE3,0x03, - 0x95,0x02,0xE3,0x03,0x96,0x02,0xE3,0x03,0x97,0x02,0xE3,0x03,0x98,0x02,0xE3,0x03, - 0x99,0x02,0xE3,0x03,0x9A,0x02,0xE3,0x03,0x9B,0x02,0xE3,0x03,0x9C,0x02,0xE3,0x03, - 0x9D,0x02,0xE3,0x03,0x9E,0x02,0xE3,0x03,0x9F,0x02,0xE3,0x03,0xA0,0x02,0xE3,0x03, - 0xA1,0x02,0xE3,0x03,0xA2,0x02,0xE3,0x03,0xA3,0x02,0xE3,0x03,0xA4,0x02,0xE3,0x03, - 0xA5,0x02,0xE3,0x03,0xA6,0x02,0xE3,0x03,0xA7,0x02,0xE3,0x03,0xA8,0x02,0xE3,0x03, - 0xA9,0x02,0xE3,0x03,0xAA,0x02,0xE3,0x03,0xAB,0x02,0xE3,0x03,0xAC,0x02,0xE3,0x03, - 0xAD,0x02,0xE3,0x03,0xBB,0x02,0xE3,0x03,0xC0,0x02,0xE3,0x03,0xC6,0x02,0xE3,0x03, - 0xC7,0x02,0xE3,0x03,0xCB,0x02,0xE3,0x03 - }; - Array.Copy(data, 0, sav, savindex * 0x7F000 + 0x5800, data.Length); + for (int i = 0; i < inarray.Length - 1; i++) + { + string itemname = inarray[i+1]; + int itemarrayval = Array.IndexOf(inarray, itemname); + dataGridView1.Rows[i].Cells[0].Value = inarray[itemarrayval]; + dataGridView1.Rows[i].Cells[1].Value = count; + } } private void B_DisplayItems_Click(object sender, EventArgs e) { // Store Current Items back to the save file saveBag(sender); - if (ModifierKeys == Keys.Alt && !m_parent.savegame_oras) - giveAllItems(); - popItems(); + if (ModifierKeys == Keys.Alt) + giveAll(item_val,995); } private void B_DisplayKeyItems_Click(object sender, EventArgs e) { // Store Current Items back to the save file saveBag(sender); popKeyItems(); + if (ModifierKeys == Keys.Alt && m_parent.HaX) + giveAll(keyitem_val,1); } private void B_DisplayTMHM_Click(object sender, EventArgs e) { // Store Current Items back to the save file saveBag(sender); popTMHM(); + + if (ModifierKeys == Keys.Alt && m_parent.HaX) + giveAll(tmhm_val,1); } private void B_DisplayMedicine_Click(object sender, EventArgs e) { // Store Current Items back to the save file saveBag(sender); popMedicine(); + if (ModifierKeys == Keys.Alt) + giveAll(medicine_val,995); } private void B_DisplayBerries_Click(object sender, EventArgs e) { // Store Current Items back to the save file saveBag(sender); popBerries(); + if (ModifierKeys == Keys.Alt) + giveAll(berries_val,995); } private void B_Cancel_Click(object sender, EventArgs e) { diff --git a/SAV/SAV_OPower.cs b/SAV/SAV_OPower.cs index 71d8b7d10..32fd72c1a 100644 --- a/SAV/SAV_OPower.cs +++ b/SAV/SAV_OPower.cs @@ -14,6 +14,7 @@ namespace PKHeX public SAV_OPower(Form1 frm1) { m_parent = frm1; + if (m_parent.savegame_oras) opoweroffset = 0x1C800; InitializeComponent(); LoadData(); } @@ -28,10 +29,10 @@ namespace PKHeX this.SaveData(); this.Close(); } - + private int opoweroffset = 0x1BE00; private void LoadData() { - int o = 0x1BE00 + m_parent.savindex * 0x7F000; // offset + int o = opoweroffset + m_parent.savindex * 0x7F000; // offset // Fill up the 17 o-powers ComboBox[] cba = new ComboBox[] { @@ -84,7 +85,7 @@ namespace PKHeX 0x27, 0x2C,0x2F,0x32,0x35,0x38,0x3B,0x3E, }; - int o = 0x1BE00 + m_parent.savindex * 0x7F000; // offset + int o = opoweroffset + m_parent.savindex * 0x7F000; // offset for (int i = 0; i < cba.Length; i++) { @@ -98,14 +99,14 @@ namespace PKHeX // Save Maxes - m_parent.savefile[m_parent.savindex * 0x7F000 + 0x1BE00 + 0x00] = Convert.ToByte(CHK_1.Checked); - m_parent.savefile[m_parent.savindex * 0x7F000 + 0x1BE00 + 0x05] = Convert.ToByte(CHK_2.Checked); - m_parent.savefile[m_parent.savindex * 0x7F000 + 0x1BE00 + 0x0A] = Convert.ToByte(CHK_3.Checked); - m_parent.savefile[m_parent.savindex * 0x7F000 + 0x1BE00 + 0x0F] = Convert.ToByte(CHK_4.Checked); - m_parent.savefile[m_parent.savindex * 0x7F000 + 0x1BE00 + 0x14] = Convert.ToByte(CHK_5.Checked); - m_parent.savefile[m_parent.savindex * 0x7F000 + 0x1BE00 + 0x19] = Convert.ToByte(CHK_6.Checked); - m_parent.savefile[m_parent.savindex * 0x7F000 + 0x1BE00 + 0x26] = Convert.ToByte(CHK_7.Checked); - m_parent.savefile[m_parent.savindex * 0x7F000 + 0x1BE00 + 0x2B] = Convert.ToByte(CHK_8.Checked); + m_parent.savefile[m_parent.savindex * 0x7F000 + opoweroffset + 0x00] = Convert.ToByte(CHK_1.Checked); + m_parent.savefile[m_parent.savindex * 0x7F000 + opoweroffset + 0x05] = Convert.ToByte(CHK_2.Checked); + m_parent.savefile[m_parent.savindex * 0x7F000 + opoweroffset + 0x0A] = Convert.ToByte(CHK_3.Checked); + m_parent.savefile[m_parent.savindex * 0x7F000 + opoweroffset + 0x0F] = Convert.ToByte(CHK_4.Checked); + m_parent.savefile[m_parent.savindex * 0x7F000 + opoweroffset + 0x14] = Convert.ToByte(CHK_5.Checked); + m_parent.savefile[m_parent.savindex * 0x7F000 + opoweroffset + 0x19] = Convert.ToByte(CHK_6.Checked); + m_parent.savefile[m_parent.savindex * 0x7F000 + opoweroffset + 0x26] = Convert.ToByte(CHK_7.Checked); + m_parent.savefile[m_parent.savindex * 0x7F000 + opoweroffset + 0x2B] = Convert.ToByte(CHK_8.Checked); } private int getIndex(int o, int l) { @@ -125,7 +126,6 @@ namespace PKHeX else if (data.SequenceEqual(_0)) return 0; else return 1; } - private void B_AllMax_Click(object sender, EventArgs e) { max(false); @@ -142,15 +142,12 @@ namespace PKHeX }; CheckBox[] echk = new CheckBox[] { CHK_1, CHK_2, CHK_3, CHK_4, CHK_5, CHK_6, CHK_7, CHK_8 }; - { - for (int i = 0; i < cba.Length; i++) - cba[i].SelectedIndex = (cba[i].Items.Count-1); - } + for (int i = 0; i < cba.Length; i++) + cba[i].SelectedIndex = (cba[i].Items.Count-1); + if (!s) - { for (int i = 0; i < echk.Length; i++) echk[i].Checked = !(ModifierKeys == Keys.Control); - } else if (ModifierKeys == Keys.Control) { for (int i = 0; i < cba.Length; i++) diff --git a/SAV/SAV_SecretBase.Designer.cs b/SAV/SAV_SecretBase.Designer.cs index fc4201caa..1c63ff853 100644 --- a/SAV/SAV_SecretBase.Designer.cs +++ b/SAV/SAV_SecretBase.Designer.cs @@ -116,6 +116,10 @@ this.tabControl1 = new System.Windows.Forms.TabControl(); this.B_GiveDecor = new System.Windows.Forms.Button(); this.B_FSave = new System.Windows.Forms.Button(); + this.TB_FT2 = new System.Windows.Forms.TextBox(); + this.TB_FT1 = new System.Windows.Forms.TextBox(); + this.label24 = new System.Windows.Forms.Label(); + this.label25 = new System.Windows.Forms.Label(); this.tabControl2.SuspendLayout(); this.f_PKM.SuspendLayout(); this.GB_PKM.SuspendLayout(); @@ -812,6 +816,10 @@ // // f_MAIN // + this.f_MAIN.Controls.Add(this.TB_FT2); + this.f_MAIN.Controls.Add(this.TB_FT1); + this.f_MAIN.Controls.Add(this.label24); + this.f_MAIN.Controls.Add(this.label25); this.f_MAIN.Controls.Add(this.groupBox1); this.f_MAIN.Controls.Add(this.label8); this.f_MAIN.Controls.Add(this.textBox1); @@ -848,9 +856,9 @@ this.groupBox1.Controls.Add(this.NUD_FObjType); this.groupBox1.Controls.Add(this.label9); this.groupBox1.Controls.Add(this.NUD_FObject); - this.groupBox1.Location = new System.Drawing.Point(6, 98); + this.groupBox1.Location = new System.Drawing.Point(6, 158); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(357, 163); + this.groupBox1.Size = new System.Drawing.Size(357, 103); this.groupBox1.TabIndex = 13; this.groupBox1.TabStop = false; this.groupBox1.Text = "Object Layout"; @@ -1002,7 +1010,7 @@ // textBox1 // this.textBox1.Enabled = false; - this.textBox1.Location = new System.Drawing.Point(134, 32); + this.textBox1.Location = new System.Drawing.Point(128, 33); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(45, 20); this.textBox1.TabIndex = 10; @@ -1050,7 +1058,7 @@ // TB_FOT // this.TB_FOT.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.TB_FOT.Location = new System.Drawing.Point(86, 6); + this.TB_FOT.Location = new System.Drawing.Point(80, 7); this.TB_FOT.MaxLength = 12; this.TB_FOT.Name = "TB_FOT"; this.TB_FOT.Size = new System.Drawing.Size(93, 20); @@ -1069,44 +1077,44 @@ // this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(188, 75); + this.label6.Location = new System.Drawing.Point(193, 75); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(51, 13); + this.label6.Size = new System.Drawing.Size(46, 13); this.label6.TabIndex = 8; - this.label6.Text = "Saying 4:"; + this.label6.Text = "Confetti:"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label5 // this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(188, 53); + this.label5.Location = new System.Drawing.Point(175, 53); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(51, 13); + this.label5.Size = new System.Drawing.Size(64, 13); this.label5.TabIndex = 7; - this.label5.Text = "Saying 3:"; + this.label5.Text = "Blackboard:"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label4 // this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(188, 31); + this.label4.Location = new System.Drawing.Point(177, 32); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(51, 13); + this.label4.Size = new System.Drawing.Size(62, 13); this.label4.TabIndex = 6; - this.label4.Text = "Saying 2:"; + this.label4.Text = "Encourage:"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label3 // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(188, 9); + this.label3.Location = new System.Drawing.Point(198, 9); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(51, 13); + this.label3.Size = new System.Drawing.Size(41, 13); this.label3.TabIndex = 5; - this.label3.Text = "Saying 1:"; + this.label3.Text = "Happy:"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // tabControl1 @@ -1144,6 +1152,48 @@ this.B_FSave.UseVisualStyleBackColor = true; this.B_FSave.Click += new System.EventHandler(this.B_FAV2SAV); // + // TB_FT2 + // + this.TB_FT2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.TB_FT2.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.TB_FT2.Location = new System.Drawing.Point(240, 132); + this.TB_FT2.MaxLength = 16; + this.TB_FT2.Name = "TB_FT2"; + this.TB_FT2.Size = new System.Drawing.Size(124, 20); + this.TB_FT2.TabIndex = 15; + // + // TB_FT1 + // + this.TB_FT1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.TB_FT1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.TB_FT1.Location = new System.Drawing.Point(240, 110); + this.TB_FT1.MaxLength = 16; + this.TB_FT1.Name = "TB_FT1"; + this.TB_FT1.Size = new System.Drawing.Size(124, 20); + this.TB_FT1.TabIndex = 14; + // + // label24 + // + this.label24.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label24.AutoSize = true; + this.label24.Location = new System.Drawing.Point(166, 135); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(73, 13); + this.label24.TabIndex = 17; + this.label24.Text = "Team Slogan:"; + this.label24.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label25 + // + this.label25.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(171, 113); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(68, 13); + this.label25.TabIndex = 16; + this.label25.Text = "Team Name:"; + this.label25.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // // SAV_SecretBase // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1279,5 +1329,9 @@ private System.Windows.Forms.MaskedTextBox TB_SPAEV; private System.Windows.Forms.MaskedTextBox TB_HPEV; private System.Windows.Forms.Button B_FSave; + private System.Windows.Forms.TextBox TB_FT2; + private System.Windows.Forms.TextBox TB_FT1; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.Label label25; } } \ No newline at end of file diff --git a/SAV/SAV_SecretBase.cs b/SAV/SAV_SecretBase.cs index ecbfe4570..56c4f1426 100644 --- a/SAV/SAV_SecretBase.cs +++ b/SAV/SAV_SecretBase.cs @@ -258,6 +258,10 @@ namespace PKHeX else offset += 0x3E0 * index; string TrainerName = Util.TrimFromZero(Encoding.Unicode.GetString(sav, sv + offset + 0x218, 0x1A)); + TB_FOT.Text = TrainerName; + + TB_FT1.Text = Util.TrimFromZero(Encoding.Unicode.GetString(sav, sv + offset + 0x232 + 0x22 * 0, 0x22)); + TB_FT2.Text = Util.TrimFromZero(Encoding.Unicode.GetString(sav, sv + offset + 0x232 + 0x22 * 1, 0x22)); string saying1 = Util.TrimFromZero(Encoding.Unicode.GetString(sav, sv + offset + 0x276 + 0x22 * 0, 0x22)); string saying2 = Util.TrimFromZero(Encoding.Unicode.GetString(sav, sv + offset + 0x276 + 0x22 * 1, 0x22)); @@ -267,7 +271,7 @@ namespace PKHeX int baseloc = BitConverter.ToInt16(sav, sv + offset); textBox1.Text = baseloc.ToString(); - TB_FOT.Text = TrainerName; TB_FSay1.Text = saying1; TB_FSay2.Text = saying2; TB_FSay3.Text = saying3; TB_FSay4.Text = saying4; + TB_FSay1.Text = saying1; TB_FSay2.Text = saying2; TB_FSay3.Text = saying3; TB_FSay4.Text = saying4; // Gather data for Object Array objdata = new byte[25, 12]; @@ -297,7 +301,10 @@ namespace PKHeX { // Write data back to save int index = LB_Favorite.SelectedIndex; // store for restoring - + if (GB_PKM.Enabled && index == 0) + { MessageBox.Show("Sorry, no overwriting of your own base with someone else's.","Error"); return; } + if (LB_Favorite.Items[index].ToString().Substring(LB_Favorite.Items[index].ToString().Length - 5, 5) == "Empty") + { MessageBox.Show("Sorry, no overwriting an empty base with someone else's.", "Error"); return; } if (index < 0) return; int offset = fav_offset + 0x5400 + 0x25A; @@ -312,6 +319,13 @@ namespace PKHeX byte[] tr = Encoding.Unicode.GetBytes(TrainerName); Array.Resize(ref tr, 0x22); Array.Copy(tr, 0, sav, sv + offset + 0x218, 0x1A); + string team1 = TB_FT1.Text; + string team2 = TB_FT2.Text; + byte[] t1 = Encoding.Unicode.GetBytes(team1); + Array.Resize(ref t1, 0x22); Array.Copy(t1, 0, sav, sv + offset + 0x232 + 0x22 * 0, 0x22); + byte[] t2 = Encoding.Unicode.GetBytes(team2); + Array.Resize(ref t2, 0x22); Array.Copy(t2, 0, sav, sv + offset + 0x232 + 0x22 * 1, 0x22); + string saying1 = TB_FSay1.Text; string saying2 = TB_FSay2.Text; string saying3 = TB_FSay3.Text; @@ -360,14 +374,11 @@ namespace PKHeX int offset = sv + 0x23A00 + 0x5400; for (int i = 0; i < 173; i++) { - int qty = BitConverter.ToUInt16(sav, offset + i * 4); - int has = BitConverter.ToUInt16(sav, offset + i * 4 + 2); + // int qty = BitConverter.ToUInt16(sav, offset + i * 4); + // int has = BitConverter.ToUInt16(sav, offset + i * 4 + 2); - if (qty == 0) // give 1. - { - sav[offset + i * 4] = (byte)(1 + 4 * Convert.ToInt16(ModifierKeys == Keys.Control)); // give 4 more if ctrl is pressed. - sav[offset + i * 4 + 2] = 1; - } + sav[offset + i * 4] = (byte)25; + sav[offset + i * 4 + 2] = 1; } } @@ -519,7 +530,7 @@ namespace PKHeX byte SP_IV = fpkm[0x2D]; bool isshiny = ((SP_IV & 0x40) > 0); - SP_IV &= 0x40; + SP_IV &= 0x1F; byte friendship = fpkm[0x2E]; int ball = fpkm[0x2F]; @@ -538,7 +549,7 @@ namespace PKHeX TB_DEFIV.Text = DE_IV.ToString(); TB_SPAIV.Text = SA_IV.ToString(); TB_SPDIV.Text = SD_IV.ToString(); - TB_SPEIV.Text = (SP_IV & 0x1F).ToString(); + TB_SPEIV.Text = SP_IV.ToString(); TB_HPEV.Text = HP_EV.ToString(); TB_ATKEV.Text = AT_EV.ToString(); diff --git a/SAV/SAV_Trainer.Designer.cs b/SAV/SAV_Trainer.Designer.cs index 66cddc845..6581a3d11 100644 --- a/SAV/SAV_Trainer.Designer.cs +++ b/SAV/SAV_Trainer.Designer.cs @@ -1814,18 +1814,13 @@ // this.GB_Misc.Controls.Add(this.MT_Sprite); this.GB_Misc.Controls.Add(this.TB_Style); - this.GB_Misc.Controls.Add(this.L_Offset); this.GB_Misc.Controls.Add(this.label34); this.GB_Misc.Controls.Add(this.PB_Sprite); this.GB_Misc.Controls.Add(this.CB_Multi); - this.GB_Misc.Controls.Add(this.label33); this.GB_Misc.Controls.Add(this.label21); - this.GB_Misc.Controls.Add(this.CB_Stats); - this.GB_Misc.Controls.Add(this.label39); - this.GB_Misc.Controls.Add(this.MT_Stat); this.GB_Misc.Location = new System.Drawing.Point(416, 288); this.GB_Misc.Name = "GB_Misc"; - this.GB_Misc.Size = new System.Drawing.Size(155, 177); + this.GB_Misc.Size = new System.Drawing.Size(155, 109); this.GB_Misc.TabIndex = 53; this.GB_Misc.TabStop = false; this.GB_Misc.Text = "Misc"; @@ -1843,7 +1838,7 @@ // L_Offset // this.L_Offset.AutoSize = true; - this.L_Offset.Location = new System.Drawing.Point(14, 159); + this.L_Offset.Location = new System.Drawing.Point(424, 456); this.L_Offset.Name = "L_Offset"; this.L_Offset.Size = new System.Drawing.Size(39, 13); this.L_Offset.TabIndex = 28; @@ -1882,7 +1877,7 @@ // label33 // this.label33.AutoSize = true; - this.label33.Location = new System.Drawing.Point(14, 103); + this.label33.Location = new System.Drawing.Point(424, 400); this.label33.Name = "label33"; this.label33.Size = new System.Drawing.Size(31, 13); this.label33.TabIndex = 24; @@ -1895,7 +1890,7 @@ this.CB_Stats.DropDownWidth = 180; this.CB_Stats.FormattingEnabled = true; this.CB_Stats.IntegralHeight = false; - this.CB_Stats.Location = new System.Drawing.Point(17, 119); + this.CB_Stats.Location = new System.Drawing.Point(427, 416); this.CB_Stats.Name = "CB_Stats"; this.CB_Stats.Size = new System.Drawing.Size(121, 21); this.CB_Stats.TabIndex = 23; @@ -1904,7 +1899,7 @@ // label39 // this.label39.AutoSize = true; - this.label39.Location = new System.Drawing.Point(14, 143); + this.label39.Location = new System.Drawing.Point(424, 440); this.label39.Name = "label39"; this.label39.Size = new System.Drawing.Size(34, 13); this.label39.TabIndex = 22; @@ -1913,7 +1908,7 @@ // MT_Stat // this.MT_Stat.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.MT_Stat.Location = new System.Drawing.Point(61, 140); + this.MT_Stat.Location = new System.Drawing.Point(471, 437); this.MT_Stat.Mask = "0000000000"; this.MT_Stat.Name = "MT_Stat"; this.MT_Stat.Size = new System.Drawing.Size(77, 20); @@ -1929,13 +1924,18 @@ this.ClientSize = new System.Drawing.Size(584, 512); this.Controls.Add(this.GB_Misc); this.Controls.Add(this.GB_Map); + this.Controls.Add(this.L_Offset); this.Controls.Add(this.GB_Appear); this.Controls.Add(this.GB_MaisonCurrent); this.Controls.Add(this.GB_MaisonBest); this.Controls.Add(this.B_Save); + this.Controls.Add(this.label33); this.Controls.Add(this.B_Cancel); + this.Controls.Add(this.CB_Stats); this.Controls.Add(this.GB_Overview); + this.Controls.Add(this.label39); this.Controls.Add(this.GB_Sayings); + this.Controls.Add(this.MT_Stat); this.Controls.Add(this.GB_Badges); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -1970,6 +1970,7 @@ this.GB_Misc.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.PB_Sprite)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/SAV/SAV_Trainer.cs b/SAV/SAV_Trainer.cs index fb0974ace..d156ea56d 100644 --- a/SAV/SAV_Trainer.cs +++ b/SAV/SAV_Trainer.cs @@ -22,6 +22,7 @@ namespace PKHeX Array.Copy(m_parent.savefile, sav, 0x100000); savindex = m_parent.savindex; savshift = savindex * 0x7F000; + if (m_parent.savegame_oras) psssatoffset = 0x24800; editing = true; getComboBoxes(); getTextBoxes(); @@ -363,14 +364,14 @@ namespace PKHeX } private void getTextBoxes() { - byte badgeval = sav[0x960C + savindex * 0x7F000]; + byte badgeval = sav[Trainer2 + 0xC + savindex * 0x7F000]; CheckBox[] cba = { cb1, cb2, cb3, cb4, cb5, cb6, cb7, cb8, }; for (int i = 0; i < 8; i++) cba[i].Checked = !((badgeval & (1 << i)) == 0); // Get Data string OT_NAME = Encoding.Unicode.GetString(sav, TrainerCard + 0x48 + savshift, 0x1A); - string RIV_NAME = Encoding.Unicode.GetString(sav, 0x9610 + savshift, 0x1A); + string RIV_NAME = Encoding.Unicode.GetString(sav, Trainer2 + 0x10 + savshift, 0x1A); CB_Game.SelectedIndex = sav[TrainerCard + 0x04 + savshift]-0x18; CB_Gender.SelectedIndex = sav[TrainerCard + 0x05 + savshift]; @@ -447,14 +448,12 @@ namespace PKHeX TB_CoordY.Text = BitConverter.ToSingle(sav, savshift + Trainer1 + 0x18).ToString(); // Load BP and PokeMiles - TB_BP.Text = BitConverter.ToUInt32(sav, savshift + Trainer2 + 0x3C).ToString(); - TB_PM.Text = BitConverter.ToUInt32(sav, savshift + 0x238FC).ToString(); + TB_BP.Text = BitConverter.ToUInt32(sav, savshift + Trainer2 + 0x3C - 0xC*Convert.ToInt16(m_parent.savegame_oras)).ToString(); + TB_PM.Text = BitConverter.ToUInt32(sav, savshift + psssatoffset + 0xFC).ToString(); // Temp ORAS GB_MaisonBest.Visible = GB_MaisonCurrent.Visible = - GB_Appear.Visible = GB_Map.Visible = GB_Misc.Visible = - L_BP.Visible = TB_BP.Visible = - L_PM.Visible = TB_PM.Visible = !m_parent.savegame_oras; + GB_Appear.Visible = GB_Map.Visible = GB_Misc.Visible = !m_parent.savegame_oras; TB_Style.Text = sav[0x694D + savshift].ToString(); @@ -565,18 +564,16 @@ namespace PKHeX byte[] x = BitConverter.GetBytes(Single.Parse(TB_CoordX.Text)); Array.Resize(ref x, 4); Array.Copy(x,0,sav, savshift + Trainer1 + 0x10,4); byte[] z = BitConverter.GetBytes(Single.Parse(TB_CoordZ.Text)); Array.Resize(ref z, 4); Array.Copy(z,0,sav, savshift + Trainer1 + 0x14,4); byte[] y = BitConverter.GetBytes(Single.Parse(TB_CoordY.Text)); Array.Resize(ref y, 4); Array.Copy(y,0,sav, savshift + Trainer1 + 0x18,4); - - byte[] bp = BitConverter.GetBytes(ToUInt32(TB_BP.Text)); Array.Resize(ref bp, 2); Array.Copy(bp, 0, sav, savshift + 0x963C, 2); - byte[] pm = BitConverter.GetBytes(ToUInt32(TB_PM.Text)); Array.Resize(ref pm, 4); Array.Copy(pm, 0, sav, savshift + 0x238FC, 4); Array.Copy(pm, 0, sav, savshift + 0x23900, 4); + + byte[] bp = BitConverter.GetBytes(ToUInt32(TB_BP.Text)); Array.Resize(ref bp, 2); Array.Copy(bp, 0, sav, savshift + 0x963C - 0xC * Convert.ToInt16(m_parent.savegame_oras), 2); + byte[] pm = BitConverter.GetBytes(ToUInt32(TB_PM.Text)); Array.Resize(ref pm, 4); Array.Copy(pm, 0, sav, savshift + psssatoffset + 0xFC, 4); Array.Copy(pm, 0, sav, savshift + psssatoffset + 0x100, 4); sav[0x694D+savshift] = Byte.Parse(TB_Style.Text); // Copy Badges badgeval = 0; CheckBox[] cba = { cb1, cb2, cb3, cb4, cb5, cb6, cb7, cb8, }; for (int i = 0; i < 8; i++) - { badgeval |= (byte)(Convert.ToByte(cba[i].Checked) << i); - } sav[0x960C + savshift] = badgeval; // Save PlayTime @@ -641,11 +638,12 @@ namespace PKHeX if (box.Text == "") box.Text = "0"; if (int.Parse(box.Text) > 255) box.Text = "255"; } + private int psssatoffset = 0x23800; private void changeStat(object sender, EventArgs e) { editing = true; { - int pssoff = 0x23800 + savindex * 0x7F000; + int pssoff = psssatoffset + savindex * 0x7F000; string offsetstr = statdata[CB_Stats.SelectedIndex * 2]; int offset = (int)new System.ComponentModel.Int32Converter().ConvertFromString(offsetstr); @@ -658,7 +656,7 @@ namespace PKHeX { if (!editing) { - int pssoff = 0x23800 + savindex * 0x7F000; + int pssoff = psssatoffset + savindex * 0x7F000; string offsetstr = statdata[CB_Stats.SelectedIndex * 2]; int offset = (int)new System.ComponentModel.Int32Converter().ConvertFromString(offsetstr);