From 8ab19985c5d7fa4d427d306e7a76ad206214217c Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 24 Jan 2015 11:16:20 -0800 Subject: [PATCH] boxdata i/o + changelog --- PKX/f1-Main.Designer.cs | 1 + PKX/f1-Main.cs | 22 ++++++++++++++++++++-- Resources/text/changelog.txt | 6 +++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/PKX/f1-Main.Designer.cs b/PKX/f1-Main.Designer.cs index df0a739be..08db89cb5 100644 --- a/PKX/f1-Main.Designer.cs +++ b/PKX/f1-Main.Designer.cs @@ -3785,6 +3785,7 @@ public void InitializeComponent() this.L_SAVManipulation.Size = new System.Drawing.Size(117, 13); this.L_SAVManipulation.TabIndex = 7; this.L_SAVManipulation.Text = "Save File Manipulation:"; + this.L_SAVManipulation.Click += new System.EventHandler(this.L_SAVManipulation_Click); // // B_SwitchSAV // diff --git a/PKX/f1-Main.cs b/PKX/f1-Main.cs index a7fa7e3ee..e0c8f42e7 100644 --- a/PKX/f1-Main.cs +++ b/PKX/f1-Main.cs @@ -533,8 +533,8 @@ private void openFile(byte[] input, string path, string ext) } #endregion #region Box Data - else if (input.Length == 0xE8 * 30 * 31) - { Array.Copy(input, 0, savefile, SaveGame.Box, input.Length); setPKXBoxes(); Util.Alert("Box Binary loaded."); } + else if (input.Length == 0xE8 * 30) + { Array.Copy(input, 0, savefile, SaveGame.Box + 0xE8 * 30 * C_BoxSelect.SelectedIndex, input.Length); setPKXBoxes(); Util.Alert("Box Binary loaded."); } #endregion else Util.Error("Attempted to load an unsupported file type/size.", "File Loaded:" + Environment.NewLine + path); @@ -2916,6 +2916,8 @@ private void clickVerifySHA(object sender, EventArgs e) } private void clickExportSAV(object sender, EventArgs e) { + if (ModifierKeys == Keys.Control) { exportBoxes(); return; } + // Create another version of the save file. byte[] editedsav = new byte[0x100000]; Array.Copy(savefile, editedsav, savefile.Length); @@ -4056,6 +4058,21 @@ private void loadBoxesFromDB(string path) Util.Alert(result); } } + private void exportBox() + { + if (Util.Prompt(MessageBoxButtons.YesNo, "Export Boxes?") == DialogResult.Yes) + { + SaveFileDialog sfd = new SaveFileDialog(); + sfd.Filter = "Box Data|*.bin"; + sfd.FileName = "boxdata.bin"; + if (sfd.ShowDialog() == DialogResult.OK) + File.WriteAllBytes(sfd.FileName, savefile.Skip(SaveGame.Box + 0xE8 * 30 * C_BoxSelect.SelectedIndex).Take(0xE8 * 30).ToArray()); + } + } + private void L_SAVManipulation_Click(object sender, EventArgs e) + { + exportBoxes(); + } // Subfunction Save Buttons // private void B_OpenWondercards_Click(object sender, EventArgs e) { @@ -4465,5 +4482,6 @@ private void pbBoxSlot_DragEnter(object sender, DragEventArgs e) private int pkm_from_offset = 0; private int pkm_from_slot = -1; #endregion + } } \ No newline at end of file diff --git a/Resources/text/changelog.txt b/Resources/text/changelog.txt index 6ab015520..13f4a0ef3 100644 --- a/Resources/text/changelog.txt +++ b/Resources/text/changelog.txt @@ -443,4 +443,8 @@ http://projectpokemon.org/forums/showthread.php?36986 - Fixed: Super Training copying too much and erroring out. Thanks SoujiSeta! - Fixed: Mono compatibility fix for inventory data editing. Thanks SoujiSeta! - Fixed: Deleting Wondercard recieved flags will actually save. Thanks ifyfg! - - Fixed: X/Y xorpad auto-loading/decryption now works instead of hanging. \ No newline at end of file + - Fixed: X/Y xorpad auto-loading/decryption now works instead of hanging. + +1/25/15 - New Update: + - Added: PK6 Distribution Super Training flags. Still have to unlock the missions ingame with wondercards. Thanks SciresM! + - Added: Box Import functionality for use with the spider web exploit. \ No newline at end of file