diff --git a/PKHeX.csproj b/PKHeX.csproj index 42db1417e..60f2bb22c 100644 --- a/PKHeX.csproj +++ b/PKHeX.csproj @@ -301,6 +301,7 @@ + diff --git a/PKX/f1-Main.Designer.cs b/PKX/f1-Main.Designer.cs index 73c059b18..afc7387c6 100644 --- a/PKX/f1-Main.Designer.cs +++ b/PKX/f1-Main.Designer.cs @@ -326,6 +326,13 @@ public void InitializeComponent() this.GB_SAVtools = new System.Windows.Forms.GroupBox(); this.B_OpenSuperTraining = new System.Windows.Forms.Button(); this.L_SAVINDEX = new System.Windows.Forms.Label(); + this.DEV_Ability = new System.Windows.Forms.ComboBox(); + this.L_HAXABILITY = new System.Windows.Forms.Label(); + this.L_HAXLEVEL = new System.Windows.Forms.Label(); + this.MT_Level = new System.Windows.Forms.MaskedTextBox(); + this.CHK_HackedStats = new System.Windows.Forms.CheckBox(); + this.MT_Form = new System.Windows.Forms.MaskedTextBox(); + this.L_HAXFORM = new System.Windows.Forms.Label(); this.tabMain.SuspendLayout(); this.Tab_Main.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Label_IsShiny)).BeginInit(); @@ -433,6 +440,7 @@ public void InitializeComponent() // this.Tab_Main.AllowDrop = true; this.Tab_Main.Controls.Add(this.CB_Language); + this.Tab_Main.Controls.Add(this.MT_Form); this.Tab_Main.Controls.Add(this.CB_Ability); this.Tab_Main.Controls.Add(this.TB_PID); this.Tab_Main.Controls.Add(this.CHK_Nicknamed); @@ -473,6 +481,8 @@ public void InitializeComponent() this.Tab_Main.Controls.Add(this.BTN_Shinytize); this.Tab_Main.Controls.Add(this.Label_PID); this.Tab_Main.Controls.Add(this.TB_AbilityNumber); + this.Tab_Main.Controls.Add(this.MT_Level); + this.Tab_Main.Controls.Add(this.DEV_Ability); this.Tab_Main.Location = new System.Drawing.Point(4, 22); this.Tab_Main.Name = "Tab_Main"; this.Tab_Main.Padding = new System.Windows.Forms.Padding(3); @@ -930,7 +940,7 @@ public void InitializeComponent() // TB_AbilityNumber // this.TB_AbilityNumber.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.TB_AbilityNumber.Location = new System.Drawing.Point(207, 151); + this.TB_AbilityNumber.Location = new System.Drawing.Point(206, 153); this.TB_AbilityNumber.Mask = "0"; this.TB_AbilityNumber.Name = "TB_AbilityNumber"; this.TB_AbilityNumber.Size = new System.Drawing.Size(20, 20); @@ -941,6 +951,9 @@ public void InitializeComponent() // Tab_Met // this.Tab_Met.AllowDrop = true; + this.Tab_Met.Controls.Add(this.L_HAXFORM); + this.Tab_Met.Controls.Add(this.L_HAXLEVEL); + this.Tab_Met.Controls.Add(this.L_HAXABILITY); this.Tab_Met.Controls.Add(this.CHK_AsEgg); this.Tab_Met.Controls.Add(this.CHK_Fateful); this.Tab_Met.Controls.Add(this.GB_EggConditions); @@ -1169,6 +1182,7 @@ public void InitializeComponent() // Tab_Stats // this.Tab_Stats.AllowDrop = true; + this.Tab_Stats.Controls.Add(this.CHK_HackedStats); this.Tab_Stats.Controls.Add(this.Label_CharacteristicPrefix); this.Tab_Stats.Controls.Add(this.L_Potential); this.Tab_Stats.Controls.Add(this.TB_IVTotal); @@ -1671,7 +1685,7 @@ public void InitializeComponent() this.Stat_SPE.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Stat_SPE.Enabled = false; this.Stat_SPE.Location = new System.Drawing.Point(167, 129); - this.Stat_SPE.MaxLength = 3; + this.Stat_SPE.MaxLength = 5; this.Stat_SPE.Name = "Stat_SPE"; this.Stat_SPE.Size = new System.Drawing.Size(31, 20); this.Stat_SPE.TabIndex = 17; @@ -1682,7 +1696,7 @@ public void InitializeComponent() this.Stat_SPD.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Stat_SPD.Enabled = false; this.Stat_SPD.Location = new System.Drawing.Point(167, 107); - this.Stat_SPD.MaxLength = 3; + this.Stat_SPD.MaxLength = 5; this.Stat_SPD.Name = "Stat_SPD"; this.Stat_SPD.Size = new System.Drawing.Size(31, 20); this.Stat_SPD.TabIndex = 16; @@ -1693,7 +1707,7 @@ public void InitializeComponent() this.Stat_SPA.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Stat_SPA.Enabled = false; this.Stat_SPA.Location = new System.Drawing.Point(167, 85); - this.Stat_SPA.MaxLength = 3; + this.Stat_SPA.MaxLength = 5; this.Stat_SPA.Name = "Stat_SPA"; this.Stat_SPA.Size = new System.Drawing.Size(31, 20); this.Stat_SPA.TabIndex = 15; @@ -1704,7 +1718,7 @@ public void InitializeComponent() this.Stat_DEF.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Stat_DEF.Enabled = false; this.Stat_DEF.Location = new System.Drawing.Point(167, 63); - this.Stat_DEF.MaxLength = 3; + this.Stat_DEF.MaxLength = 5; this.Stat_DEF.Name = "Stat_DEF"; this.Stat_DEF.Size = new System.Drawing.Size(31, 20); this.Stat_DEF.TabIndex = 14; @@ -1715,7 +1729,7 @@ public void InitializeComponent() this.Stat_ATK.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Stat_ATK.Enabled = false; this.Stat_ATK.Location = new System.Drawing.Point(167, 41); - this.Stat_ATK.MaxLength = 3; + this.Stat_ATK.MaxLength = 5; this.Stat_ATK.Name = "Stat_ATK"; this.Stat_ATK.Size = new System.Drawing.Size(31, 20); this.Stat_ATK.TabIndex = 13; @@ -1726,7 +1740,7 @@ public void InitializeComponent() this.Stat_HP.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Stat_HP.Enabled = false; this.Stat_HP.Location = new System.Drawing.Point(167, 19); - this.Stat_HP.MaxLength = 3; + this.Stat_HP.MaxLength = 5; this.Stat_HP.Name = "Stat_HP"; this.Stat_HP.Size = new System.Drawing.Size(31, 20); this.Stat_HP.TabIndex = 12; @@ -3832,6 +3846,89 @@ public void InitializeComponent() this.L_SAVINDEX.TabIndex = 16; this.L_SAVINDEX.Text = "0"; // + // DEV_Ability + // + this.DEV_Ability.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.DEV_Ability.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.DEV_Ability.Enabled = false; + this.DEV_Ability.FormattingEnabled = true; + this.DEV_Ability.Items.AddRange(new object[] { + "Item"}); + this.DEV_Ability.Location = new System.Drawing.Point(105, 153); + this.DEV_Ability.Name = "DEV_Ability"; + this.DEV_Ability.Size = new System.Drawing.Size(100, 21); + this.DEV_Ability.TabIndex = 14; + this.DEV_Ability.Visible = false; + // + // L_HAXABILITY + // + this.L_HAXABILITY.AutoSize = true; + this.L_HAXABILITY.Enabled = false; + this.L_HAXABILITY.Location = new System.Drawing.Point(27, 161); + this.L_HAXABILITY.Name = "L_HAXABILITY"; + this.L_HAXABILITY.Size = new System.Drawing.Size(72, 13); + this.L_HAXABILITY.TabIndex = 15; + this.L_HAXABILITY.Text = "HAX ABILITY"; + this.L_HAXABILITY.Visible = false; + // + // L_HAXLEVEL + // + this.L_HAXLEVEL.AutoSize = true; + this.L_HAXLEVEL.Enabled = false; + this.L_HAXLEVEL.Location = new System.Drawing.Point(34, 183); + this.L_HAXLEVEL.Name = "L_HAXLEVEL"; + this.L_HAXLEVEL.Size = new System.Drawing.Size(65, 13); + this.L_HAXLEVEL.TabIndex = 16; + this.L_HAXLEVEL.Text = "HAX LEVEL"; + this.L_HAXLEVEL.Visible = false; + // + // MT_Level + // + this.MT_Level.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.MT_Level.Enabled = false; + this.MT_Level.Location = new System.Drawing.Point(205, 70); + this.MT_Level.Mask = "000"; + this.MT_Level.Name = "MT_Level"; + this.MT_Level.Size = new System.Drawing.Size(22, 20); + this.MT_Level.TabIndex = 17; + this.MT_Level.Visible = false; + this.MT_Level.TextChanged += new System.EventHandler(this.updateEXPLevel); + // + // CHK_HackedStats + // + this.CHK_HackedStats.AutoSize = true; + this.CHK_HackedStats.Enabled = false; + this.CHK_HackedStats.Location = new System.Drawing.Point(3, 3); + this.CHK_HackedStats.Name = "CHK_HackedStats"; + this.CHK_HackedStats.Size = new System.Drawing.Size(91, 17); + this.CHK_HackedStats.TabIndex = 18; + this.CHK_HackedStats.Text = "Hacked Stats"; + this.CHK_HackedStats.UseVisualStyleBackColor = true; + this.CHK_HackedStats.Visible = false; + this.CHK_HackedStats.Click += new System.EventHandler(this.CHK_HackedStats_Click); + // + // MT_Form + // + this.MT_Form.Enabled = false; + this.MT_Form.Location = new System.Drawing.Point(229, 133); + this.MT_Form.Mask = "00"; + this.MT_Form.Name = "MT_Form"; + this.MT_Form.Size = new System.Drawing.Size(19, 20); + this.MT_Form.TabIndex = 18; + this.MT_Form.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.MT_Form.Visible = false; + // + // L_HAXFORM + // + this.L_HAXFORM.AutoSize = true; + this.L_HAXFORM.Enabled = false; + this.L_HAXFORM.Location = new System.Drawing.Point(147, 183); + this.L_HAXFORM.Name = "L_HAXFORM"; + this.L_HAXFORM.Size = new System.Drawing.Size(38, 13); + this.L_HAXFORM.TabIndex = 19; + this.L_HAXFORM.Text = "FORM"; + this.L_HAXFORM.Visible = false; + // // Form1 // this.AllowDrop = true; @@ -4259,6 +4356,13 @@ public void InitializeComponent() private System.Windows.Forms.Button B_3DSSETemp; private System.Windows.Forms.Panel PAN_Box; public System.Windows.Forms.ComboBox C_BoxSelect; + private System.Windows.Forms.Label L_HAXABILITY; + private System.Windows.Forms.ComboBox DEV_Ability; + private System.Windows.Forms.CheckBox CHK_HackedStats; + private System.Windows.Forms.MaskedTextBox MT_Level; + private System.Windows.Forms.Label L_HAXLEVEL; + private System.Windows.Forms.Label L_HAXFORM; + private System.Windows.Forms.MaskedTextBox MT_Form; } } diff --git a/PKX/f1-Main.cs b/PKX/f1-Main.cs index 0250ccef4..2e129ad96 100644 --- a/PKX/f1-Main.cs +++ b/PKX/f1-Main.cs @@ -70,7 +70,16 @@ public Form1() { CB_MainLanguage.SelectedIndex = 0; } + { + CHK_HackedStats.Enabled = CHK_HackedStats.Visible = + DEV_Ability.Enabled = DEV_Ability.Visible = + MT_Level.Enabled = MT_Level.Visible = + TB_AbilityNumber.Visible = + MT_Form.Enabled = MT_Form.Visible = true; // (filename.Substring(filename.Length - 3) == "dev"); + TB_Level.Visible = + CB_Ability.Visible = false; // !(filename.Substring(filename.Length - 3) == "dev"); + } #endregion #region Localize & Populate InitializeStrings(); @@ -3503,6 +3512,12 @@ private void InitializeLanguage() 648,649,650,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683, 684,685,686,687,688,699,704,708,709,710,711,715, }; + if (DEV_Ability.Enabled) + { + item_nums = new int[itemlist.Length]; + for (int i = 0; i < itemlist.Length; i++) + item_nums[i] = i; + } List item_list = new List(); // Sort the Rest based on String Name @@ -3549,6 +3564,27 @@ private void InitializeLanguage() CB_Species.DataSource = species_list; } #endregion + #region DEV Ability + { + List ability_list = new List(); + // Sort the Rest based on String Name + string[] sortedability = new string[abilitylist.Length]; + Array.Copy(abilitylist, sortedability, abilitylist.Length); + Array.Sort(sortedability); + + // Add the rest of the items + for (int i = 0; i < sortedability.Length; i++) + { + cbItem ncbi = new cbItem(); + ncbi.Text = sortedability[i]; + ncbi.Value = Array.IndexOf(abilitylist, sortedability[i]); + ability_list.Add(ncbi); + } + DEV_Ability.DisplayMember = "Text"; + DEV_Ability.ValueMember = "Value"; + DEV_Ability.DataSource = ability_list; + } + #endregion #region Natures { List natures_list = new List(); @@ -4062,6 +4098,11 @@ private void populatefields(byte[] buff) } } init = true; + + // DEV Illegality + DEV_Ability.SelectedValue = ability; + MT_Level.Text = level.ToString(); + MT_Form.Text = altforms.ToString(); } private void populatemarkings(int markings) { @@ -4670,15 +4711,29 @@ private void Label_OT_Click(object sender, EventArgs e) if (OT.Length > 0) { TB_OT.Text = OT; + int savshift = 0x7F000 * savindex; // Set Gender Label - int g6trgend = savefile[0x19405 + savindex * 0x7F000]; + int g6trgend = savefile[0x19405 + savshift]; if (g6trgend == 1) Label_OTGender.Text = "♀"; else Label_OTGender.Text = "♂"; // Get TID/SID - TB_TID.Text = BitConverter.ToUInt16(savefile, 0x19400 + savindex * 0x7F000).ToString(); - TB_SID.Text = BitConverter.ToUInt16(savefile, 0x19402 + savindex * 0x7F000).ToString(); + TB_TID.Text = BitConverter.ToUInt16(savefile, 0x19400 + savshift).ToString(); + TB_SID.Text = BitConverter.ToUInt16(savefile, 0x19402 + savshift).ToString(); + int game = savefile[0x19404 + savshift]; + int subreg = savefile[0x19426 + savshift]; + int country = savefile[0x19427 + savshift]; + int _3DSreg = savefile[0x1942C + savshift]; + int lang = savefile[0x1942D + savshift]; + + // CB_GameOrigin.SelectedValue = game; + + CB_SubRegion.SelectedValue = subreg; + CB_Country.SelectedValue = country; + CB_3DSReg.SelectedValue = _3DSreg; + CB_Language.SelectedValue = lang; + updateNickname(null, null); } } private void Label_PrevOT_Click(object sender, EventArgs e) @@ -4879,6 +4934,10 @@ private void updateEXPLevel(object sender, EventArgs e) else TB_Level.BackColor = Color.Red; TB_EXP.Enabled = true; } + else if (MT_Level.Focused == true) + { + getEXP(Math.Min(Convert.ToInt32(MT_Level.Text),255),getSpecies()); + } updateStats(); } private void updateContest(object sender, EventArgs e) @@ -5796,7 +5855,7 @@ private void updateStats() }; for (int i = 0; i < 6; i++) { - if (ToInt32(mbIV[i].Text) > 31 || ToInt32(mbEV[i].Text) > 252) + if (ToInt32(mbIV[i].Text) > 31 || (ToInt32(mbEV[i].Text) > 252 && !CHK_HackedStats.Checked) || (CHK_HackedStats.Checked && ToInt32(mbEV[i].Text) > 255)) { return; // if anything is illegal, don't calc stats. } @@ -5805,6 +5864,7 @@ private void updateStats() // EVs and IVs are valid, continue to generate the stats. species = getSpecies(); int level = ToInt32(TB_Level.Text); + if (MT_Level.Enabled) level = ToInt32(MT_Level.Text); if (level == 0) { level = 1; } DataTable spectable = SpeciesTable(); int HP_IV = ToInt32(TB_HPIV.Text); @@ -6487,13 +6547,13 @@ public bool verifiedpkx() }; for (int i = 0; i < 6; i++) { - if ((ToInt32(tba[i].Text) > 252) || (ToInt32(tba[i+6].Text) > 31)) + if (((ToInt32(tba[i].Text) > 252) && !(CHK_HackedStats.Checked && ToInt32(tba[i].Text) < 256)) || (ToInt32(tba[i + 6].Text) > 31)) { tabMain.SelectedIndex = 2; goto invalid; } } - if (Convert.ToUInt32(TB_EVTotal.Text) > 510) + if (Convert.ToUInt32(TB_EVTotal.Text) > 510 && !CHK_HackedStats.Checked) { tabMain.SelectedIndex = 2; goto invalid; @@ -6512,8 +6572,6 @@ public bool verifiedpkx() System.Media.SystemSounds.Exclamation.Play(); return false; } - - } public byte[] preparepkx(byte[] buff) { @@ -6567,7 +6625,8 @@ public byte[] preparepkx(byte[] buff) int fegform = (int)(Convert.ToInt32(CHK_Fateful.Checked)); fegform += (Convert.ToInt32(Label_Gender.Text == "♀") * 2); fegform += (Convert.ToInt32(Label_Gender.Text == "-") * 4); - fegform += ((getIndex(CB_Form)) * 8); + if (MT_Form.Enabled) fegform += (Math.Min(Convert.ToInt32(MT_Form.Text), 32) * 8); + else fegform += ((getIndex(CB_Form)) * 8); pkx[0x1D] = (byte)fegform; pkx[0x1E] = (byte)(ToInt32(TB_HPEV.Text) & 0xFF); // EVs pkx[0x1F] = (byte)(ToInt32(TB_ATKEV.Text) & 0xFF); @@ -6731,16 +6790,24 @@ public byte[] preparepkx(byte[] buff) pkx[0xEA] = 0; pkx[0xEB] = 0; pkx[0xEC] = (byte)ToInt32(TB_Level.Text); // Level pkx[0xED] = 0; pkx[0xEE] = 0; pkx[0xEF] = 0; - Array.Copy(BitConverter.GetBytes(ToInt32(Stat_HP.Text)), 0, pkx, 0xF0, 2); // Current HP - Array.Copy(BitConverter.GetBytes(ToInt32(Stat_HP.Text)), 0, pkx, 0xF2, 2); // Max HP - Array.Copy(BitConverter.GetBytes(ToInt32(Stat_ATK.Text)), 0, pkx, 0xF4, 2); // ATK - Array.Copy(BitConverter.GetBytes(ToInt32(Stat_DEF.Text)), 0, pkx, 0xF6, 2); // DEF - Array.Copy(BitConverter.GetBytes(ToInt32(Stat_SPE.Text)), 0, pkx, 0xF8, 2); // SPE - Array.Copy(BitConverter.GetBytes(ToInt32(Stat_SPA.Text)), 0, pkx, 0xFA, 2); // SPA - Array.Copy(BitConverter.GetBytes(ToInt32(Stat_SPD.Text)), 0, pkx, 0xFC, 2); // SPD + Array.Copy(BitConverter.GetBytes(Math.Min(ToInt32(Stat_HP.Text), 65535)), 0, pkx, 0xF0, 2); // Current HP + Array.Copy(BitConverter.GetBytes(Math.Min(ToInt32(Stat_HP.Text), 65535)), 0, pkx, 0xF2, 2); // Max HP + Array.Copy(BitConverter.GetBytes(Math.Min(ToInt32(Stat_ATK.Text), 65535)), 0, pkx, 0xF4, 2); // ATK + Array.Copy(BitConverter.GetBytes(Math.Min(ToInt32(Stat_DEF.Text), 65535)), 0, pkx, 0xF6, 2); // DEF + Array.Copy(BitConverter.GetBytes(Math.Min(ToInt32(Stat_SPE.Text), 65535)), 0, pkx, 0xF8, 2); // SPE + Array.Copy(BitConverter.GetBytes(Math.Min(ToInt32(Stat_SPA.Text), 65535)), 0, pkx, 0xFA, 2); // SPA + Array.Copy(BitConverter.GetBytes(Math.Min(ToInt32(Stat_SPD.Text), 65535)), 0, pkx, 0xFC, 2); // SPD pkx[0xFE] = 0; pkx[0xFF] = 0; pkx[0x100] = 0; pkx[0x101] = 0; pkx[0x102] = 0; pkx[0x103] = 0; + // DEV Illegality + if (DEV_Ability.Enabled) + { + pkx[0x14] = (byte)getIndex(DEV_Ability); // Ability + pkx[0xEC] = (byte)Math.Min(Convert.ToInt32(MT_Level.Text), 255); // Level + Array.Copy(BitConverter.GetBytes(getEXP(pkx[0xEC], getSpecies())), 0, pkx, 0x10, 4); // EXP + } + // Now we fix the checksum! uint chk = 0; for (int i = 8; i < 232; i += 2) // Loop through the entire PKX @@ -8068,6 +8135,18 @@ private void getSlotFiller(int offset, PictureBox pb) uint XOR = TSV ^ PSV; Image baseImage = (Image)Properties.Resources.ResourceManager.GetObject(file); + if (baseImage == null) + { + if (species < 722 && species != 0) + { + baseImage = PKHeX.Util.layerImage( + (Image)Properties.Resources.ResourceManager.GetObject("_" + species.ToString()), + (Image)Properties.Resources.unknown, + 0, 0, .5); + } + else + baseImage = (Image)Properties.Resources.unknown; + } if (species != 0 && isegg == 1) { file = "_0"; // Start with a partially transparent species @@ -8263,21 +8342,41 @@ private void loadBoxesFromDB(string path) int offset = SaveGame.Box; int size = 232; Array.Clear(savefile, offset, size * 30 * 31); // Clear out the box data array. - string[] filepaths = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories); + string[] filepaths = Directory.GetFiles(path, "*.*", SearchOption.TopDirectoryOnly); int ctr = 0; + int pastctr = 0; + var Converter = new PKHeX.pk2pk(); for (int i = 0; i < filepaths.Length; i++) { long len = new FileInfo(filepaths[i]).Length; - if (len != 232 && len != 260) + if (len != 232 && len != 260 && len != 136 && len != 220 && len != 236) continue; - + string name = filepaths[i]; byte[] data = new Byte[232]; string ext = Path.GetExtension(filepaths[i]); - if (ext == ".pkx" || ext == ".pk6") + if (ext == ".pkm") + { + // Verify PKM (decrypted) + byte[] input = File.ReadAllBytes(filepaths[i]); + if (!Converter.verifychk(input)) + continue; + else + { + try // to convert g5pkm + { + data = encryptArray(Converter.ConvertPKM(input, savefile, savindex)); + pastctr++; + } + catch { continue; } + } + } + else if (ext == ".pkx" || ext == ".pk6") { byte[] input = File.ReadAllBytes(filepaths[i]); if ((input[0xC8] == 0) && (input[0xC9] == 0) && (input[0x58] == 0) && (input[0x59] == 0)) { + if (BitConverter.ToUInt16(input, 0x8) == 0) // if species = 0 + continue; Array.Resize(ref input, 232); uint chk = 0; for (int z = 8; z < 232; z += 2) // Loop through the entire PKX @@ -8288,7 +8387,6 @@ private void loadBoxesFromDB(string path) ushort actualsum = BitConverter.ToUInt16(input, 0x6); if (chk != actualsum) continue; - data = encryptArray(input); } } @@ -8302,6 +8400,8 @@ private void loadBoxesFromDB(string path) if (!(BitConverter.ToUInt16(decrypteddata, 0xC8) == 0) && !(BitConverter.ToUInt16(decrypteddata, 0x58) == 0)) continue; // don't allow improperly encrypted files. they must be encrypted properly. + else if (BitConverter.ToUInt16(decrypteddata, 0x8) == 0) // if species = 0 + continue; uint chk = 0; for (int z = 8; z < 232; z += 2) // Loop through the entire PKX { @@ -8311,8 +8411,8 @@ private void loadBoxesFromDB(string path) ushort actualsum = BitConverter.ToUInt16(decrypteddata, 0x6); if (chk != actualsum) continue; - } + else continue; Array.Copy(data, 0, savefile, offset + ctr * size, 232); ctr++; if (ctr == 30 * 31) break; // break out if we have written all 31 boxes @@ -8326,6 +8426,10 @@ private void loadBoxesFromDB(string path) tabBoxMulti.SelectedIndex = 0; } getPKXBoxes(); + string result = "Loaded " + ctr + " files to boxes."; + if (pastctr > 0) + result += "\n\nConversion successful for " + pastctr + " past-gen files."; + MessageBox.Show(result, "Alert"); } } // Subfunction Save Buttons // @@ -8666,6 +8770,16 @@ private void reportToolStripMenuItem_Click(object sender, EventArgs e) ReportForm.PopulateData(savefile); ReportForm.ShowDialog(); } + + private void CHK_HackedStats_Click(object sender, EventArgs e) + { + Stat_HP.Enabled = + Stat_ATK.Enabled = + Stat_DEF.Enabled = + Stat_SPA.Enabled = + Stat_SPD.Enabled = + Stat_SPE.Enabled = CHK_HackedStats.Checked; + } } #region Structs & Classes public class cbItem diff --git a/PKX/f1-Main.resx b/PKX/f1-Main.resx index 1bd7e51f1..ef449a201 100644 --- a/PKX/f1-Main.resx +++ b/PKX/f1-Main.resx @@ -240,6 +240,9 @@ True + + True + True