From 3d29b74c83fb13eb54d0475cda68e3798c857cde Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 17 Aug 2014 11:30:46 -0700 Subject: [PATCH] Give All Pokedex Entries functionality --- Resources/text/changelog.txt | 10 ++++- SAV/SAV_Pokedex.Designer.cs | 4 +- SAV/SAV_Pokedex.cs | 74 +++++++++++++++++++++++++++++++++++- 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/Resources/text/changelog.txt b/Resources/text/changelog.txt index a01d93c0c..bcb650fc6 100644 --- a/Resources/text/changelog.txt +++ b/Resources/text/changelog.txt @@ -301,9 +301,15 @@ http://projectpokemon.org/forums/showthread.php?36986 - Fixed: Setting Pokemon outside of the Party will now add their entries to the Pokedex. - Fixed: Kalos entries erroring out with the Pokedex editor. -08/16/14 - New Update: +08/16/14 - New Update: (720) - Added: Clicking the OT name with a save file will load the Country/Region/3DS Region/Language settings, but not the game. - Added: Import Database can now import past gen files too, as they will be converted to the new PKX format. - Fixed: Importing past gen files with party data will no longer have 'invalid checksums' or fail to load. - Fixed: Externally edited saves with bad data are handled more efficiently (items/sprites). - - Fixed: Users entering values above a certain limit (byte values are capped at 255). \ No newline at end of file + - Fixed: Users entering values above a certain limit (byte values are capped at 255). + +08/18/14 - New Update: + - Added: Import Database will now add the Pokedex entries for the data you load. + - Added: Pokedex Give All Entries added (Fill Dex gives everything, Give All gives all for the specific species). + - Fixed: Level 100 glitching fixed. + - Removed: Backup (.bak) saving when replacing the Cyber Save file "main". \ No newline at end of file diff --git a/SAV/SAV_Pokedex.Designer.cs b/SAV/SAV_Pokedex.Designer.cs index 9cca79e51..1bd40ef0d 100644 --- a/SAV/SAV_Pokedex.Designer.cs +++ b/SAV/SAV_Pokedex.Designer.cs @@ -306,13 +306,13 @@ private void InitializeComponent() // // B_GiveAll // - this.B_GiveAll.Enabled = false; this.B_GiveAll.Location = new System.Drawing.Point(160, 11); this.B_GiveAll.Name = "B_GiveAll"; this.B_GiveAll.Size = new System.Drawing.Size(80, 23); this.B_GiveAll.TabIndex = 23; this.B_GiveAll.Text = "Give All"; this.B_GiveAll.UseVisualStyleBackColor = true; + this.B_GiveAll.Click += new System.EventHandler(this.B_GiveAll_Click); // // B_Save // @@ -326,13 +326,13 @@ private void InitializeComponent() // // B_FillDex // - this.B_FillDex.Enabled = false; this.B_FillDex.Location = new System.Drawing.Point(287, 11); this.B_FillDex.Name = "B_FillDex"; this.B_FillDex.Size = new System.Drawing.Size(80, 23); this.B_FillDex.TabIndex = 25; this.B_FillDex.Text = "Fill Dex"; this.B_FillDex.UseVisualStyleBackColor = true; + this.B_FillDex.Click += new System.EventHandler(this.B_FillDex_Click); // // GB_Language // diff --git a/SAV/SAV_Pokedex.cs b/SAV/SAV_Pokedex.cs index 27066cc2b..85ceb105f 100644 --- a/SAV/SAV_Pokedex.cs +++ b/SAV/SAV_Pokedex.cs @@ -32,8 +32,12 @@ public SAV_Pokedex(Form1 frm1) private void Setup() { // Clear Listbox and ComboBox - LB_Species.Items.Clear(); - CB_Species.Items.Clear(); + try + { + LB_Species.Items.Clear(); + CB_Species.Items.Clear(); + } + catch { } // Fill List #region Species @@ -224,5 +228,71 @@ private void B_Save_Click(object sender, EventArgs e) Array.Copy(sav, m_parent.savefile, sav.Length); this.Close(); } + + private void B_GiveAll_Click(object sender, EventArgs e) + { + CHK_L1.Checked = + CHK_L2.Checked = + CHK_L3.Checked = + CHK_L4.Checked = + CHK_L5.Checked = + CHK_L6.Checked = + CHK_L7.Checked = + + CHK_P1.Checked = + CHK_P2.Checked = + CHK_P3.Checked = + CHK_P4.Checked = + CHK_P5.Checked = + CHK_P6.Checked = + CHK_P7.Checked = + CHK_P8.Checked = + CHK_P9.Checked = + CHK_P10.Checked = !(ModifierKeys == Keys.Control); + + if (CHK_F1.Enabled) + { + CHK_F1.Checked = !(ModifierKeys == Keys.Control); + } + changePartitionBool(null, null); + changeLanguageBool(null, null); + } + + private void B_FillDex_Click(object sender, EventArgs e) + { + { + byte[] sdata = new Byte[0x60]; + + for (int i = 0; i < 0x60; i++) + sdata[i] = 0xFF; + + for (int p = 0; p < 10; p++) // FF out the partitions + Array.Copy(sdata, 0, sav, savshift + 0x1A408 + 0x60 * p, 0x60); + } + // Fill Foreign Obtained + { + byte[] foreigndata = new byte[0x52]; + for (int i = 0; i < 0x52; i++) + foreigndata[i] = 0xFF; + + foreigndata[0x51] = 1; + + Array.Copy(foreigndata, 0, sav, savshift + 0x1AA4C, 0x52); + } + { + byte[] langdata = new Byte[0x280]; + + for (int i = 0; i < 630; i++) + langdata[i] = 0xFF; + + langdata[630] = 0x7F; + + Array.Copy(langdata, 0, sav, savshift + 0x1A7C8, 0x280); + } + editing = true; + Setup(); + editing = false; + LB_Species.SelectedIndex = 0; + } } }