public void import_area() { byte[] phl = new byte[4 * 20]; string path = null; FileIO.load_file(ref phl, ref path, "Entree Forest Area data|*.phl|All Files (*.*)|*.*"); UInt32 temp_pkm = 0; indexpkm = 0; if (area > 0 && area < 4) //Area 9 ony holds 10 pokes { for (indexpkm = 0; indexpkm < 10; indexpkm++) { temp_pkm = BitConverter.ToUInt32(phl, indexpkm * 4); edit_pkm(temp_pkm); } } else { for (indexpkm = 0; indexpkm < 20; indexpkm++) { temp_pkm = BitConverter.ToUInt32(phl, indexpkm * 4); edit_pkm(temp_pkm); } } indexpkm = 0; }
void Inject_butClick(object sender, EventArgs e) { string path = null; FileIO.load_file(ref injectfile, ref path, binaryfilter); MainForm.save.setBlock(injectfile, blockindex); //MessageBox.Show(injectfile.Length.ToString()); }
public void import_forest() { byte[] forest = new byte[2304]; string path = null; FileIO.load_file(ref forest, ref path, "Entralink Forest Decrypted Data|*.efdd|All Files (*.*)|*.*"); Data = forest; indexpkm = 0; }
void Memory_importClick(object sender, EventArgs e) { byte[] new_memory = new byte[MEMORIES.Size]; string path = null; int filesize = FileIO.load_file(ref new_memory, ref path, "Memory Link Data|*.mld|All Files (*.*)|*.*"); if (filesize == MEMORIES.Size) { ml = new MEMORIES(new_memory); //Reload all data load_data(); } else { MessageBox.Show("Invalid file"); } }
void B2_importClick(object sender, EventArgs e) { byte[] new_block2 = new byte[MEMORIES.ML_BLOCK2.Size]; string path = null; int filesize = FileIO.load_file(ref new_block2, ref path, "Memory Link Data|*.bin|All Files (*.*)|*.*"); if (filesize == MEMORIES.ML_BLOCK2.Size) { new_block2.CopyTo(ml.block2.Data, 0); //Reload load_data(); } else { MessageBox.Show("Invalid file"); } }
void Import_bw1Click(object sender, EventArgs e) { byte[] bw1 = new byte[SAV5.SIZERAW + 122]; string path = null; int filesize = FileIO.load_file(ref bw1, ref path, "NDS save data|*.sav;*.dsv|All Files (*.*)|*.*"); if (filesize == SAV5.SIZERAW || filesize == SAV5.SIZERAW + 122) { //Convert DSV to SAV if (filesize == SAV5.SIZERAW + 122) { Array.Resize(ref bw1, SAV5.SIZERAW); } SAV5 bw1save = new SAV5(bw1); if (bw1save.B2W2 == false) { ml.block2.name_fromarray(bw1.Skip(0x19404).Take(0xF).ToArray()); ml.block2.TID = BitConverter.ToUInt16(bw1, 0x19414); ml.block2.SID = BitConverter.ToUInt16(bw1, 0x19416); ml.block2.STARTER = bw1save.Data[0x20160]; ml.block2.set_hof(bw1.Skip(0x23B00).Take(0x168).ToArray()); ml.block2.set_props(bw1.Skip(0x1F958).Take(0x13).ToArray()); UInt32 newseed = (UInt32)(rand.Next(0xFFFF + 1) << 16); ml.block1.crypt_seed = newseed; ml.block1_mirror.crypt_seed = newseed; //Reload all data load_data(); MessageBox.Show("Imported: Trainer Name, TID, SID, Starter, Hall of Fame, Props"); } else { MessageBox.Show("Not a valid savegame!"); } } }
void load_savegame(string filepath) { string path = filepath; int filesize = FileIO.load_file(ref savebuffer, ref path, dsfilter); versiontext.Text = ""; if (filesize == SAV5.SIZERAW || filesize == SAV5.SIZERAW + 122) { //Convert DSV to SAV if (filesize == SAV5.SIZERAW + 122) { Array.Resize(ref savebuffer, SAV5.SIZERAW); } savegamename.Text = path; save = new SAV5(savebuffer); if (save.B2W2) { versiontext.Text = "Black/White 2"; dumper_but.Enabled = true; chk_but.Enabled = true; chk_updt_but.Enabled = true; save_but.Enabled = true; grotto_but.Enabled = true; trainer_records_but.Enabled = true; medal_but.Enabled = true; forest_but.Enabled = true; key_but.Enabled = true; join_but.Enabled = true; trainer_but.Enabled = true; memory_but.Enabled = true; dlc_but.Enabled = true; dr_but.Enabled = true; } else if (save.BW) { versiontext.Text = "Black/White 1"; dumper_but.Enabled = true; chk_but.Enabled = true; chk_updt_but.Enabled = true; save_but.Enabled = true; grotto_but.Enabled = false; trainer_records_but.Enabled = false; medal_but.Enabled = false; forest_but.Enabled = true; key_but.Enabled = false; join_but.Enabled = false; trainer_but.Enabled = true; memory_but.Enabled = false; dlc_but.Enabled = true; dr_but.Enabled = false; } else { versiontext.Text = "Invalid file"; } } else { MessageBox.Show("Invalid file."); savegamename.Text = ""; dumper_but.Enabled = false; chk_but.Enabled = false; chk_updt_but.Enabled = false; save_but.Enabled = false; grotto_but.Enabled = false; trainer_records_but.Enabled = false; medal_but.Enabled = false; forest_but.Enabled = false; key_but.Enabled = false; join_but.Enabled = false; trainer_but.Enabled = false; memory_but.Enabled = false; dlc_but.Enabled = false; dr_but.Enabled = false; } }