From a3a56275a7bb3c62c533d2072e6bd77ff24b3c0b Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 4 Jan 2015 00:52:06 -0800 Subject: [PATCH] Initial Commit Still a WIP but some stuff works. --- pk3DS.sln | 20 + pk3DS/GARCTool.cs | 1153 ++++++++++++ pk3DS/Legal.cs | 120 ++ pk3DS/Main.Designer.cs | 286 +++ pk3DS/Main.cs | 274 +++ pk3DS/Main.resx | 120 ++ pk3DS/Program.cs | 21 + pk3DS/Properties/AssemblyInfo.cs | 36 + pk3DS/Properties/Resources.Designer.cs | 63 + pk3DS/Properties/Resources.resx | 117 ++ pk3DS/Properties/Settings.Designer.cs | 26 + pk3DS/Properties/Settings.settings | 7 + pk3DS/RSTE.Designer.cs | 2259 ++++++++++++++++++++++++ pk3DS/RSTE.cs | 988 +++++++++++ pk3DS/RSTE.resx | 120 ++ pk3DS/TrainerRand.Designer.cs | 215 +++ pk3DS/TrainerRand.cs | 52 + pk3DS/Util.cs | 595 +++++++ pk3DS/pk3DS.csproj | 117 ++ pk3DS/xytext.Designer.cs | 141 ++ pk3DS/xytext.cs | 563 ++++++ pk3DS/xytext.resx | 120 ++ 22 files changed, 7413 insertions(+) create mode 100644 pk3DS.sln create mode 100644 pk3DS/GARCTool.cs create mode 100644 pk3DS/Legal.cs create mode 100644 pk3DS/Main.Designer.cs create mode 100644 pk3DS/Main.cs create mode 100644 pk3DS/Main.resx create mode 100644 pk3DS/Program.cs create mode 100644 pk3DS/Properties/AssemblyInfo.cs create mode 100644 pk3DS/Properties/Resources.Designer.cs create mode 100644 pk3DS/Properties/Resources.resx create mode 100644 pk3DS/Properties/Settings.Designer.cs create mode 100644 pk3DS/Properties/Settings.settings create mode 100644 pk3DS/RSTE.Designer.cs create mode 100644 pk3DS/RSTE.cs create mode 100644 pk3DS/RSTE.resx create mode 100644 pk3DS/TrainerRand.Designer.cs create mode 100644 pk3DS/TrainerRand.cs create mode 100644 pk3DS/Util.cs create mode 100644 pk3DS/pk3DS.csproj create mode 100644 pk3DS/xytext.Designer.cs create mode 100644 pk3DS/xytext.cs create mode 100644 pk3DS/xytext.resx diff --git a/pk3DS.sln b/pk3DS.sln new file mode 100644 index 0000000..2964303 --- /dev/null +++ b/pk3DS.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C# Express 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pk3DS", "pk3DS\pk3DS.csproj", "{C4CB2488-2DB9-489F-8B02-A8E872C6C6AB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C4CB2488-2DB9-489F-8B02-A8E872C6C6AB}.Debug|x86.ActiveCfg = Debug|x86 + {C4CB2488-2DB9-489F-8B02-A8E872C6C6AB}.Debug|x86.Build.0 = Debug|x86 + {C4CB2488-2DB9-489F-8B02-A8E872C6C6AB}.Release|x86.ActiveCfg = Release|x86 + {C4CB2488-2DB9-489F-8B02-A8E872C6C6AB}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/pk3DS/GARCTool.cs b/pk3DS/GARCTool.cs new file mode 100644 index 0000000..7f55342 --- /dev/null +++ b/pk3DS/GARCTool.cs @@ -0,0 +1,1153 @@ +using System; +using System.IO; +using System.Windows.Forms; +using System.Threading; +using System.Collections.Generic; + +namespace pk3DS +{ + public class GARCTool + { + public static bool garcPack(string folderPath, string garcPath, ProgressBar pBar1 = null, Label label = null, bool supress = false) + { + // Check to see if our input folder exists. + if (!new DirectoryInfo(folderPath).Exists) { Util.Error("Folder does not exist."); return false; } + + // Okay some basic proofing is done. Proceed. + + // Get the paths of the files to pack up. + string[] filepaths = Directory.GetFiles(folderPath, "*.*", SearchOption.TopDirectoryOnly); + + // Initialize ProgressBar + if (pBar1 == null) pBar1 = new ProgressBar(); + if (label == null) label = new Label(); + if (pBar1.InvokeRequired) + pBar1.Invoke((MethodInvoker)delegate { pBar1.Minimum = 0; pBar1.Step = 1; pBar1.Value = 0; pBar1.Maximum = filepaths.Length; }); + else { pBar1.Minimum = 0; pBar1.Step = 1; pBar1.Value = 0; pBar1.Maximum = filepaths.Length; } + if (label.InvokeRequired) + label.Invoke((MethodInvoker)delegate { label.Visible = true; }); + else { label.Visible = true; } + + // Copy the files to the working directory so our compression doesn't overwrite anything. + + + // Scan through to see if we have to compress anything. + try + { + File.Delete(garcPath); // Delete the old garc if it exists, then write our new one + } + catch { } + + using (var newGARC = File.Create(garcPath)) + using (BinaryWriter gw = new BinaryWriter(newGARC)) + { + + // Write GARC header + gw.Write((uint)0x47415243); // Write "CRAG" + gw.Write((uint)0x0000001C); // Header Length + gw.Write((ushort)0xFEFF); // FEFF BOM + gw.Write((ushort)0x0400); // + gw.Write((uint)0x00000004); // + gw.Write((uint)0x00000000); // Data Offset + gw.Write((uint)0x00000000); // File Length + gw.Write((uint)0x00000000); // FATB chunk last word + + // Write OTAF + gw.Write((uint)0x4641544F); // OTAF + gw.Write((uint)(0xC + 4 * filepaths.Length)); // Section Size + gw.Write((ushort)filepaths.Length); // Count: n + gw.Write((ushort)0xFFFF); // padding? dunno + + // write BTAF jump offsets + for (int i = 0; i < filepaths.Length; i++) + gw.Write((uint)i * 0x10); + + // Start BTAF + gw.Write((uint)0x46415442); // BTAF + gw.Write((uint)(0xC + 0x10 * filepaths.Length)); // Chunk Size + gw.Write((uint)filepaths.Length); + + uint offset = 0; + uint largest = 0; + + // Sort out the files to get the actual order + int[] fp = new int[filepaths.Length]; + try + { + for (int i = 0; i < fp.Length; i++) + { + string fn = Path.GetFileNameWithoutExtension(filepaths[i]); + int compressed = fn.IndexOf("dec_"); + if (compressed < 0) + fp[Int32.Parse(fn)] = i; + else + fp[Int32.Parse(fn.Substring(compressed + 4))] = i; + } + } + catch (Exception e) { Util.Error("Invalid packing filenames", e.ToString()); return false; } + + string garcName = Util.getRandomFileName(); + using (var GARCdata = File.Create(garcName)) + for (int i = 0; i < filepaths.Length; i++) + { + string name = filepaths[fp[i]]; + try + { + if (label.InvokeRequired) + label.Invoke((MethodInvoker)delegate { label.Text = String.Format("{0:P2} - {1}/{2} - {3}", ((float)i) / ((float)filepaths.Length), i, filepaths.Length, Path.GetFileName(name)); }); + else { label.Text = String.Format("{0:P2} - {1}/{2} - {3}", ((float)i) / ((float)filepaths.Length), i, filepaths.Length, Path.GetFileName(name)); } + } + catch { } + int compressed = Path.GetFileName(name).IndexOf("dec_"); + if (compressed > -1) + { + // File needs to be compressed and replaced. + string compressedName = Path.Combine(Path.GetDirectoryName(name), Path.GetFileNameWithoutExtension(name).Substring(compressed + 4) + ".bin"); + + try { dsdecmp.Compress(name, compressedName); } + catch { throw new Exception("Compression failed"); } + + // Replace file name with compressed name so we can delete after packing. + name = compressedName; + } + FileInfo fi = new FileInfo(name); + using (var input = File.OpenRead(name)) + { + gw.Write((uint)1); // garc.btaf.entries[i].bits = br.ReadUInt32(); + gw.Write((uint)offset); // Start/Begin Offset + uint round = (uint)Math.Ceiling(((double)fi.Length / 4)) * 4; + offset += (uint)(round); // Round up Offset. + gw.Write((uint)offset); // End/Stop Offset + gw.Write((uint)fi.Length); // Length/Size + + if (fi.Length > largest) largest = (uint)fi.Length; + + // Write the data to the BMIF data section + input.CopyTo(GARCdata); // then pad with FF's if not /4 + while (GARCdata.Length % 4 > 0) GARCdata.WriteByte(0xFF); + } + + // Delete file if it is compressed. + if (compressed > -1) File.Delete(name); + + // Advance the ProgressBar. + if (pBar1.InvokeRequired) + pBar1.Invoke((MethodInvoker)delegate { pBar1.PerformStep(); }); + else { pBar1.PerformStep(); } + } + + gw.Write((uint)0x46494D42); + gw.Write((uint)0x0000000C); + gw.Write((uint)offset); + + using (var GARCdatainfo = new FileStream(garcName, FileMode.Open)) + { + gw.Seek(0x10, SeekOrigin.Begin); // Goto the start of the un-set 0 data we set earlier and set it. + gw.Write((uint)newGARC.Length); // Write Data Offset + gw.Write((uint)(newGARC.Length + GARCdatainfo.Length)); // Write total GARC Length + gw.Write((uint)largest); // Write Largest File stat (?) + + newGARC.Seek(0, SeekOrigin.End); // Goto the end so we can copy the filedata after the GARC headers. + + // Write in the data + GARCdatainfo.CopyTo(newGARC); // Copy the data. + } + // New File is ready to be saved (memstream newGARC) + try + { + File.Delete(garcName); + if (label.InvokeRequired) + label.Invoke((MethodInvoker)delegate { label.Visible = false; }); + else { label.Visible = false; } + + // We're done. + System.Media.SystemSounds.Exclamation.Play(); + if (!supress) Util.Alert("Pack Successful!", filepaths.Length + " files packed to the GARC!"); + return true; + } + catch (Exception e) { Util.Error("Packing Failed!", e.ToString()); return false; } + } + } + public static bool garcUnpack(string garcPath, string outPath, bool skipDecompression, ProgressBar pBar1 = null, Label label = null, bool supress = false, bool bypassExt = false) + { + if (!File.Exists(garcPath) && !supress) { Util.Alert("File does not exist"); return false; } + + // Unpack the GARC + GARC garc = ARC.unpackGARC(garcPath); + + // Initialize ProgressBar + if (pBar1 == null) pBar1 = new ProgressBar(); + if (label == null) label = new Label(); + + + if (pBar1.InvokeRequired) + pBar1.Invoke((MethodInvoker)delegate { pBar1.Minimum = 0; pBar1.Step = 1; pBar1.Value = 0; pBar1.Maximum = garc.otaf.nFiles; }); + else { pBar1.Minimum = 0; pBar1.Step = 1; pBar1.Value = 0; pBar1.Maximum = garc.otaf.nFiles; } + + if (label.InvokeRequired) + label.Invoke((MethodInvoker)delegate { label.Visible = true; }); + else { label.Visible = true; } + + using (BinaryReader br = new BinaryReader(System.IO.File.OpenRead(garcPath))) + { + // Create Extraction folder if it does not exist. + if (!Directory.Exists(outPath)) + Directory.CreateDirectory(outPath); + + // Pull out all the files + for (int o = 0; o < garc.otaf.nFiles; o++) + { + for (int i = 0; i < garc.btaf.nFiles; i++) + { + string ext = "bin"; + bool compressed = false; + + br.BaseStream.Position = garc.btaf.entries[i].start_offset + garc.data_offset; + byte lzss; + try + { lzss = (byte)br.PeekChar(); } + catch { lzss = 0; } + + if (lzss == 0x11) + compressed = true; + else + { + ext = Util.GuessExtension(br, "bin", bypassExt); + br.BaseStream.Seek(0, SeekOrigin.Begin); + } + + // Set File Name + string filename = o.ToString("D" + Math.Ceiling(Math.Log10(garc.otaf.nFiles))); + if (garc.btaf.nFiles == garc.otaf.nFiles) filename = i.ToString("D" + Math.Ceiling(Math.Log10(garc.otaf.nFiles))); + else if (garc.btaf.nFiles > 1 && garc.btaf.nFiles != garc.otaf.nFiles) filename += "." + i; + string fileout = Path.Combine(outPath, filename + "." + ext); + using (BinaryWriter bw = new BinaryWriter(File.OpenWrite(fileout))) + { + // Write out the data for the file + br.BaseStream.Position = garc.btaf.entries[i].start_offset + garc.data_offset; + for (int x = 0; x < garc.btaf.entries[i].length; x++) + bw.Write(br.ReadByte()); + } + // See if decompression should be attempted. + #region Decompression + if (compressed && !skipDecompression) + { + string decout = Path.Combine(outPath, "dec_" + filename + ".bin"); + try + { + long n = dsdecmp.Decompress(fileout, decout); + try { File.Delete(fileout); } + catch (Exception e) { Util.Error("A compressed file could not be deleted.", fileout, e.ToString()); } + + // Try to detect for extension now + ext = Util.GuessExtension(decout, bypassExt); + + File.Move(decout, Path.Combine(outPath, "dec_" + filename + "." + ext)); + } + catch + { + // File is really not encrypted. + try { File.Delete(decout); } + catch (Exception e) { Util.Error("This shouldn't happen", e.ToString()); } + } + } + if (pBar1.InvokeRequired) + pBar1.Invoke((MethodInvoker)delegate { pBar1.PerformStep(); }); + else + pBar1.PerformStep(); + if (label.InvokeRequired) + label.Invoke((MethodInvoker)delegate { label.Text = String.Format("{0:P2} - {1}/{2}", ((float)i) / ((float)garc.otaf.nFiles), i, garc.otaf.nFiles); }); + else { label.Text = String.Format("{0:P2} - {1}/{2}", ((float)i) / ((float)garc.otaf.nFiles), i, garc.otaf.nFiles); } + #endregion + } + if (garc.otaf.nFiles == garc.btaf.nFiles) break; + } + } + if (label.InvokeRequired) + label.Invoke((MethodInvoker)delegate { label.Visible = false; }); + else { label.Visible = false; } + System.Media.SystemSounds.Exclamation.Play(); + if (!supress) Util.Alert("Unpack Successful!", garc.otaf.nFiles + " files unpacked from the GARC!"); + return true; + } + } + + // Sub-classes + #region GARC Class & Struct + public class ARC + { + public static GARC unpackGARC(string path) + { + GARC garc = new GARC(); + BinaryReader br = new BinaryReader(System.IO.File.OpenRead(path)); + + // GARC Header + garc.id = br.ReadChars(4); + garc.header_size = br.ReadUInt32(); + garc.id_endian = br.ReadUInt16(); + if (garc.id_endian == 0xFEFF) + Util.Reverse(garc.id); + garc.constant = br.ReadUInt16(); + garc.file_size = br.ReadUInt32(); + + garc.data_offset = br.ReadUInt32(); + garc.file_length = br.ReadUInt32(); + garc.lastsize = br.ReadUInt32(); + + // OTAF + garc.otaf.id = br.ReadChars(4); + garc.otaf.section_size = br.ReadUInt32(); + garc.otaf.nFiles = br.ReadUInt16(); + garc.otaf.padding = br.ReadUInt16(); + + garc.otaf.entries = new OTAF_Entry[garc.otaf.nFiles]; + // not really needed; plus it's wrong + for (int i = 0; i < garc.otaf.nFiles; i++) + { + uint val = br.ReadUInt32(); + if (garc.otaf.padding == 0xffff) + { + val = Util.Reverse(val); + } + garc.otaf.entries[i].name = val.ToString(); + } + + // BTAF (File Allocation TaBle) + garc.btaf.id = br.ReadChars(4); + garc.btaf.section_size = br.ReadUInt32(); + garc.btaf.nFiles = br.ReadUInt32(); + + garc.btaf.entries = new BTAF_Entry[garc.btaf.nFiles]; + garc.btaf.entries[0].bits = br.ReadUInt32(); + for (int i = 0; i < garc.btaf.nFiles; i++) + { + if (i != 0 && garc.btaf.nFiles == garc.otaf.nFiles) + garc.btaf.entries[i].bits = br.ReadUInt32(); + garc.btaf.entries[i].start_offset = br.ReadUInt32(); + garc.btaf.entries[i].end_offset = br.ReadUInt32(); + garc.btaf.entries[i].length = br.ReadUInt32(); + } + + // BMIF + garc.gmif.id = br.ReadChars(4); + garc.gmif.section_size = br.ReadUInt32(); + garc.gmif.data_size = br.ReadUInt32(); + + // Files data + + br.Close(); + return garc; + } + } + public struct GARC + { + public char[] id; // Always GARC = 0x4E415243 + public UInt32 header_size; // Always 0x001C + public UInt16 id_endian; // 0xFFFE + public UInt16 constant; // Always 0x0400 chunk count + public UInt32 file_size; + + public UInt32 data_offset; + public UInt32 file_length; + public UInt32 lastsize; + + public OTAF otaf; + public BTAF btaf; + public GMIF gmif; + } + public struct OTAF + { + public char[] id; + public UInt32 section_size; + public UInt16 nFiles; + public UInt16 padding; + + public OTAF_Entry[] entries; + } + public struct OTAF_Entry + { + public string name; + } + public struct BTAF + { + public char[] id; + public UInt32 section_size; + public UInt32 nFiles; + public BTAF_Entry[] entries; + } + public struct BTAF_Entry + { + public UInt32 bits; + public UInt32 start_offset; + public UInt32 end_offset; + public UInt32 length; + } + public struct GMIF + { + public char[] id; + public UInt32 section_size; + public UInt32 data_size; + } + #endregion + #region dsdecmp Classes + public class dsdecmp // LZ11 (de)compression + { + public static long Decompress(string infile, string outfile) + { + // make sure the output directory exists + string outDirectory = Path.GetDirectoryName(outfile); + if (!Directory.Exists(outDirectory)) + Directory.CreateDirectory(outDirectory); + // open the two given files, and delegate to the format-specific code. + using (FileStream inStream = new FileStream(infile, FileMode.Open), + outStream = new FileStream(outfile, FileMode.Create)) + { + return Decompress(inStream, inStream.Length, outStream); + } + } + /// + /// Decompresses the given stream, writing the decompressed data to the given output stream. + /// Assumes Supports(instream) returns true. + /// After this call, the input stream will be positioned at the end of the compressed stream, + /// or at the initial position + inLength, whichever comes first. + /// + /// The stream to decompress. At the end of this method, the position + /// of this stream is directly after the compressed data. + /// The length of the input data. Not necessarily all of the + /// input data may be read (if there is padding, for example), however never more than + /// this number of bytes is read from the input stream. + /// The stream to write the decompressed data to. + /// The length of the output data. + /// When the given length of the input data + /// is not enough to properly decompress the input. + public static long Decompress(Stream instream, long inLength, Stream outstream) + { + #region Format definition in NDSTEK style + /* Data header (32bit) + Bit 0-3 Reserved + Bit 4-7 Compressed type (must be 1 for LZ77) + Bit 8-31 Size of decompressed data. if 0, the next 4 bytes are decompressed length + Repeat below. Each Flag Byte followed by eight Blocks. + Flag data (8bit) + Bit 0-7 Type Flags for next 8 Blocks, MSB first + Block Type 0 - Uncompressed - Copy 1 Byte from Source to Dest + Bit 0-7 One data byte to be copied to dest + Block Type 1 - Compressed - Copy LEN Bytes from Dest-Disp-1 to Dest + If Reserved is 0: - Default + Bit 0-3 Disp MSBs + Bit 4-7 LEN - 3 + Bit 8-15 Disp LSBs + If Reserved is 1: - Higher compression rates for files with (lots of) long repetitions + Bit 4-7 Indicator + If Indicator > 1: + Bit 0-3 Disp MSBs + Bit 4-7 LEN - 1 (same bits as Indicator) + Bit 8-15 Disp LSBs + If Indicator is 1: A(B CD E)(F GH) + Bit 0-3 (LEN - 0x111) MSBs + Bit 4-7 Indicator; unused + Bit 8-15 (LEN- 0x111) 'middle'-SBs + Bit 16-19 Disp MSBs + Bit 20-23 (LEN - 0x111) LSBs + Bit 24-31 Disp LSBs + If Indicator is 0: + Bit 0-3 (LEN - 0x11) MSBs + Bit 4-7 Indicator; unused + Bit 8-11 Disp MSBs + Bit 12-15 (LEN - 0x11) LSBs + Bit 16-23 Disp LSBs + */ + #endregion + + long readBytes = 0; + + byte type = (byte)instream.ReadByte(); + if (type != 0x11) + throw new InvalidDataException("The provided stream is not a valid LZ-0x11 " + + "compressed stream (invalid type 0x" + type.ToString("X") + ")"); + byte[] sizeBytes = new byte[3]; + instream.Read(sizeBytes, 0, 3); + int decompressedSize = IOUtils.ToNDSu24(sizeBytes, 0); + readBytes += 4; + if (decompressedSize == 0) + { + sizeBytes = new byte[4]; + instream.Read(sizeBytes, 0, 4); + decompressedSize = IOUtils.ToNDSs32(sizeBytes, 0); + readBytes += 4; + } + + // the maximum 'DISP-1' is still 0xFFF. + int bufferLength = 0x1000; + byte[] buffer = new byte[bufferLength]; + int bufferOffset = 0; + + int currentOutSize = 0; + int flags = 0, mask = 1; + while (currentOutSize < decompressedSize) + { + // (throws when requested new flags byte is not available) + #region Update the mask. If all flag bits have been read, get a new set. + // the current mask is the mask used in the previous run. So if it masks the + // last flag bit, get a new flags byte. + if (mask == 1) + { + if (readBytes >= inLength) + throw new NotEnoughDataException(currentOutSize, decompressedSize); + flags = instream.ReadByte(); readBytes++; + if (flags < 0) + throw new StreamTooShortException(); + mask = 0x80; + } + else + { + mask >>= 1; + } + #endregion + + // bit = 1 <=> compressed. + if ((flags & mask) > 0) + { + // (throws when not enough bytes are available) + #region Get length and displacement('disp') values from next 2, 3 or 4 bytes + + // read the first byte first, which also signals the size of the compressed block + if (readBytes >= inLength) + throw new NotEnoughDataException(currentOutSize, decompressedSize); + int byte1 = instream.ReadByte(); readBytes++; + if (byte1 < 0) + throw new StreamTooShortException(); + + int length = byte1 >> 4; + int disp = -1; + if (length == 0) + { + #region case 0; 0(B C)(D EF) + (0x11)(0x1) = (LEN)(DISP) + + // case 0: + // data = AB CD EF (with A=0) + // LEN = ABC + 0x11 == BC + 0x11 + // DISP = DEF + 1 + + // we need two more bytes available + if (readBytes + 1 >= inLength) + throw new NotEnoughDataException(currentOutSize, decompressedSize); + int byte2 = instream.ReadByte(); readBytes++; + int byte3 = instream.ReadByte(); readBytes++; + if (byte3 < 0) + throw new StreamTooShortException(); + + length = (((byte1 & 0x0F) << 4) | (byte2 >> 4)) + 0x11; + disp = (((byte2 & 0x0F) << 8) | byte3) + 0x1; + + #endregion + } + else if (length == 1) + { + #region case 1: 1(B CD E)(F GH) + (0x111)(0x1) = (LEN)(DISP) + + // case 1: + // data = AB CD EF GH (with A=1) + // LEN = BCDE + 0x111 + // DISP = FGH + 1 + + // we need three more bytes available + if (readBytes + 2 >= inLength) + throw new NotEnoughDataException(currentOutSize, decompressedSize); + int byte2 = instream.ReadByte(); readBytes++; + int byte3 = instream.ReadByte(); readBytes++; + int byte4 = instream.ReadByte(); readBytes++; + if (byte4 < 0) + throw new StreamTooShortException(); + + length = (((byte1 & 0x0F) << 12) | (byte2 << 4) | (byte3 >> 4)) + 0x111; + disp = (((byte3 & 0x0F) << 8) | byte4) + 0x1; + + #endregion + } + else + { + #region case > 1: (A)(B CD) + (0x1)(0x1) = (LEN)(DISP) + + // case other: + // data = AB CD + // LEN = A + 1 + // DISP = BCD + 1 + + // we need only one more byte available + if (readBytes >= inLength) + throw new NotEnoughDataException(currentOutSize, decompressedSize); + int byte2 = instream.ReadByte(); readBytes++; + if (byte2 < 0) + throw new StreamTooShortException(); + + length = ((byte1 & 0xF0) >> 4) + 0x1; + disp = (((byte1 & 0x0F) << 8) | byte2) + 0x1; + + #endregion + } + + if (disp > currentOutSize) + throw new InvalidDataException("Cannot go back more than already written. " + + "DISP = " + disp + ", #written bytes = 0x" + currentOutSize.ToString("X") + + " before 0x" + instream.Position.ToString("X") + " with indicator 0x" + + (byte1 >> 4).ToString("X")); + #endregion + + int bufIdx = bufferOffset + bufferLength - disp; + for (int i = 0; i < length; i++) + { + byte next = buffer[bufIdx % bufferLength]; + bufIdx++; + outstream.WriteByte(next); + buffer[bufferOffset] = next; + bufferOffset = (bufferOffset + 1) % bufferLength; + } + currentOutSize += length; + } + else + { + if (readBytes >= inLength) + throw new NotEnoughDataException(currentOutSize, decompressedSize); + int next = instream.ReadByte(); readBytes++; + if (next < 0) + throw new StreamTooShortException(); + + outstream.WriteByte((byte)next); currentOutSize++; + buffer[bufferOffset] = (byte)next; + bufferOffset = (bufferOffset + 1) % bufferLength; + } + } + + if (readBytes < inLength) + { + // the input may be 4-byte aligned. + if ((readBytes ^ (readBytes & 3)) + 4 < inLength) + throw new TooMuchInputException(readBytes, inLength); + } + + return decompressedSize; + } + + public static int Compress(string infile, string outfile) + { + // make sure the output directory exists + string outDirectory = Path.GetDirectoryName(outfile); + if (!Directory.Exists(outDirectory)) + Directory.CreateDirectory(outDirectory); + // open the proper Streams, and delegate to the format-specific code. + using (FileStream inStream = File.Open(infile, FileMode.Open), + outStream = File.Create(outfile)) + { + return dsdecmp.Compress(inStream, inStream.Length, outStream, true); + } + } + #region Original compression method + /// + /// Compresses the input using the 'original', unoptimized compression algorithm. + /// This algorithm should yield files that are the same as those found in the games. + /// (delegates to the optimized method if LookAhead is set) + /// + public unsafe static int Compress(Stream instream, long inLength, Stream outstream, bool original) + { + // make sure the decompressed size fits in 3 bytes. + // There should be room for four bytes, however I'm not 100% sure if that can be used + // in every game, as it may not be a built-in function. + if (inLength > 0xFFFFFF) + throw new InputTooLargeException(); + + // use the other method if lookahead is enabled + if (!original) + { + return CompressWithLA(instream, inLength, outstream); + } + + // save the input data in an array to prevent having to go back and forth in a file + byte[] indata = new byte[inLength]; + int numReadBytes = instream.Read(indata, 0, (int)inLength); + if (numReadBytes != inLength) + throw new StreamTooShortException(); + + // write the compression header first + outstream.WriteByte(0x11); + outstream.WriteByte((byte)(inLength & 0xFF)); + outstream.WriteByte((byte)((inLength >> 8) & 0xFF)); + outstream.WriteByte((byte)((inLength >> 16) & 0xFF)); + + int compressedLength = 4; + + fixed (byte* instart = &indata[0]) + { + // we do need to buffer the output, as the first byte indicates which blocks are compressed. + // this version does not use a look-ahead, so we do not need to buffer more than 8 blocks at a time. + // (a block is at most 4 bytes long) + byte[] outbuffer = new byte[8 * 4 + 1]; + outbuffer[0] = 0; + int bufferlength = 1, bufferedBlocks = 0; + int readBytes = 0; + while (readBytes < inLength) + { + #region If 8 blocks are bufferd, write them and reset the buffer + // we can only buffer 8 blocks at a time. + if (bufferedBlocks == 8) + { + outstream.Write(outbuffer, 0, bufferlength); + compressedLength += bufferlength; + // reset the buffer + outbuffer[0] = 0; + bufferlength = 1; + bufferedBlocks = 0; + } + #endregion + + // determine if we're dealing with a compressed or raw block. + // it is a compressed block when the next 3 or more bytes can be copied from + // somewhere in the set of already compressed bytes. + int disp; + int oldLength = Math.Min(readBytes, 0x1000); + int length = LZUtil.GetOccurrenceLength(instart + readBytes, (int)Math.Min(inLength - readBytes, 0x10110), + instart + readBytes - oldLength, oldLength, out disp); + + // length not 3 or more? next byte is raw data + if (length < 3) + { + outbuffer[bufferlength++] = *(instart + (readBytes++)); + } + else + { + // 3 or more bytes can be copied? next (length) bytes will be compressed into 2 bytes + readBytes += length; + + // mark the next block as compressed + outbuffer[0] |= (byte)(1 << (7 - bufferedBlocks)); + + if (length > 0x110) + { + // case 1: 1(B CD E)(F GH) + (0x111)(0x1) = (LEN)(DISP) + outbuffer[bufferlength] = 0x10; + outbuffer[bufferlength] |= (byte)(((length - 0x111) >> 12) & 0x0F); + bufferlength++; + outbuffer[bufferlength] = (byte)(((length - 0x111) >> 4) & 0xFF); + bufferlength++; + outbuffer[bufferlength] = (byte)(((length - 0x111) << 4) & 0xF0); + } + else if (length > 0x10) + { + // case 0; 0(B C)(D EF) + (0x11)(0x1) = (LEN)(DISP) + outbuffer[bufferlength] = 0x00; + outbuffer[bufferlength] |= (byte)(((length - 0x111) >> 4) & 0x0F); + bufferlength++; + outbuffer[bufferlength] = (byte)(((length - 0x111) << 4) & 0xF0); + } + else + { + // case > 1: (A)(B CD) + (0x1)(0x1) = (LEN)(DISP) + outbuffer[bufferlength] = (byte)(((length - 1) << 4) & 0xF0); + } + // the last 1.5 bytes are always the disp + outbuffer[bufferlength] |= (byte)(((disp - 1) >> 8) & 0x0F); + bufferlength++; + outbuffer[bufferlength] = (byte)((disp - 1) & 0xFF); + bufferlength++; + } + bufferedBlocks++; + } + + // copy the remaining blocks to the output + if (bufferedBlocks > 0) + { + outstream.Write(outbuffer, 0, bufferlength); + compressedLength += bufferlength; + /*/ make the compressed file 4-byte aligned. + while ((compressedLength % 4) != 0) + { + outstream.WriteByte(0); + compressedLength++; + }/**/ + } + } + + return compressedLength; + } + #region Dynamic Programming compression method + /// + /// Variation of the original compression method, making use of Dynamic Programming to 'look ahead' + /// and determine the optimal 'length' values for the compressed blocks. Is not 100% optimal, + /// as the flag-bytes are not taken into account. + /// + private unsafe static int CompressWithLA(Stream instream, long inLength, Stream outstream) + { + // save the input data in an array to prevent having to go back and forth in a file + byte[] indata = new byte[inLength]; + int numReadBytes = instream.Read(indata, 0, (int)inLength); + if (numReadBytes != inLength) + throw new StreamTooShortException(); + + // write the compression header first + outstream.WriteByte(0x11); + outstream.WriteByte((byte)(inLength & 0xFF)); + outstream.WriteByte((byte)((inLength >> 8) & 0xFF)); + outstream.WriteByte((byte)((inLength >> 16) & 0xFF)); + + int compressedLength = 4; + + fixed (byte* instart = &indata[0]) + { + // we do need to buffer the output, as the first byte indicates which blocks are compressed. + // this version does not use a look-ahead, so we do not need to buffer more than 8 blocks at a time. + // blocks are at most 4 bytes long. + byte[] outbuffer = new byte[8 * 4 + 1]; + outbuffer[0] = 0; + int bufferlength = 1, bufferedBlocks = 0; + int readBytes = 0; + + // get the optimal choices for len and disp + int[] lengths, disps; + GetOptimalCompressionLengths(instart, indata.Length, out lengths, out disps); + while (readBytes < inLength) + { + // we can only buffer 8 blocks at a time. + if (bufferedBlocks == 8) + { + outstream.Write(outbuffer, 0, bufferlength); + compressedLength += bufferlength; + // reset the buffer + outbuffer[0] = 0; + bufferlength = 1; + bufferedBlocks = 0; + } + + + if (lengths[readBytes] == 1) + { + outbuffer[bufferlength++] = *(instart + (readBytes++)); + } + else + { + // mark the next block as compressed + outbuffer[0] |= (byte)(1 << (7 - bufferedBlocks)); + + if (lengths[readBytes] > 0x110) + { + // case 1: 1(B CD E)(F GH) + (0x111)(0x1) = (LEN)(DISP) + outbuffer[bufferlength] = 0x10; + outbuffer[bufferlength] |= (byte)(((lengths[readBytes] - 0x111) >> 12) & 0x0F); + bufferlength++; + outbuffer[bufferlength] = (byte)(((lengths[readBytes] - 0x111) >> 4) & 0xFF); + bufferlength++; + outbuffer[bufferlength] = (byte)(((lengths[readBytes] - 0x111) << 4) & 0xF0); + } + else if (lengths[readBytes] > 0x10) + { + // case 0; 0(B C)(D EF) + (0x11)(0x1) = (LEN)(DISP) + outbuffer[bufferlength] = 0x00; + outbuffer[bufferlength] |= (byte)(((lengths[readBytes] - 0x111) >> 4) & 0x0F); + bufferlength++; + outbuffer[bufferlength] = (byte)(((lengths[readBytes] - 0x111) << 4) & 0xF0); + } + else + { + // case > 1: (A)(B CD) + (0x1)(0x1) = (LEN)(DISP) + outbuffer[bufferlength] = (byte)(((lengths[readBytes] - 1) << 4) & 0xF0); + } + // the last 1.5 bytes are always the disp + outbuffer[bufferlength] |= (byte)(((disps[readBytes] - 1) >> 8) & 0x0F); + bufferlength++; + outbuffer[bufferlength] = (byte)((disps[readBytes] - 1) & 0xFF); + bufferlength++; + + readBytes += lengths[readBytes]; + } + + + bufferedBlocks++; + } + + // copy the remaining blocks to the output + if (bufferedBlocks > 0) + { + outstream.Write(outbuffer, 0, bufferlength); + compressedLength += bufferlength; + /*/ make the compressed file 4-byte aligned. + while ((compressedLength % 4) != 0) + { + outstream.WriteByte(0); + compressedLength++; + }/**/ + } + } + + return compressedLength; + } + #endregion + + #region DP compression helper method; GetOptimalCompressionLengths + /// + /// Gets the optimal compression lengths for each start of a compressed block using Dynamic Programming. + /// This takes O(n^2) time, although in practice it will often be O(n^3) since one of the constants is 0x10110 + /// (the maximum length of a compressed block) + /// + /// The data to compress. + /// The length of the data to compress. + /// The optimal 'length' of the compressed blocks. For each byte in the input data, + /// this value is the optimal 'length' value. If it is 1, the block should not be compressed. + /// The 'disp' values of the compressed blocks. May be 0, in which case the + /// corresponding length will never be anything other than 1. + private unsafe static void GetOptimalCompressionLengths(byte* indata, int inLength, out int[] lengths, out int[] disps) + { + lengths = new int[inLength]; + disps = new int[inLength]; + int[] minLengths = new int[inLength]; + + for (int i = inLength - 1; i >= 0; i--) + { + // first get the compression length when the next byte is not compressed + minLengths[i] = int.MaxValue; + lengths[i] = 1; + if (i + 1 >= inLength) + minLengths[i] = 1; + else + minLengths[i] = 1 + minLengths[i + 1]; + // then the optimal compressed length + int oldLength = Math.Min(0x1000, i); + // get the appropriate disp while at it. Takes at most O(n) time if oldLength is considered O(n) and 0x10110 constant. + // however since a lot of files will not be larger than 0x10110, this will often take ~O(n^2) time. + // be sure to bound the input length with 0x10110, as that's the maximum length for LZ-11 compressed blocks. + int maxLen = LZUtil.GetOccurrenceLength(indata + i, Math.Min(inLength - i, 0x10110), + indata + i - oldLength, oldLength, out disps[i]); + if (disps[i] > i) + throw new Exception("disp is too large"); + for (int j = 3; j <= maxLen; j++) + { + int blocklen; + if (j > 0x110) + blocklen = 4; + else if (j > 0x10) + blocklen = 3; + else + blocklen = 2; + int newCompLen; + if (i + j >= inLength) + newCompLen = blocklen; + else + newCompLen = blocklen + minLengths[i + j]; + if (newCompLen < minLengths[i]) + { + lengths[i] = j; + minLengths[i] = newCompLen; + } + } + } + + // we could optimize this further to also optimize it with regard to the flag-bytes, but that would require 8 times + // more space and time (one for each position in the block) for only a potentially tiny increase in compression ratio. + } + #endregion + #endregion + } + #region Exceptions + /// + /// An exception indicating that the file cannot be compressed, because the decompressed size + /// cannot be represented in the current compression format. + /// + public class InputTooLargeException : Exception + { + /// + /// Creates a new exception that indicates that the input is too big to be compressed. + /// + public InputTooLargeException() + : base("The compression ratio is not high enough to fit the input " + + "in a single compressed file.") { } + } + /// + /// An exception that is thrown by the decompression functions when there + /// is not enough data available in order to properly decompress the input. + /// + public class NotEnoughDataException : IOException + { + private long currentOutSize; + private long totalOutSize; + /// + /// Gets the actual number of written bytes. + /// + public long WrittenLength { get { return this.currentOutSize; } } + /// + /// Gets the number of bytes that was supposed to be written. + /// + public long DesiredLength { get { return this.totalOutSize; } } + + /// + /// Creates a new NotEnoughDataException. + /// + /// The actual number of written bytes. + /// The desired number of written bytes. + public NotEnoughDataException(long currentOutSize, long totalOutSize) + : base("Not enough data availble; 0x" + currentOutSize.ToString("X") + + " of " + (totalOutSize < 0 ? "???" : ("0x" + totalOutSize.ToString("X"))) + + " bytes written.") + { + this.currentOutSize = currentOutSize; + this.totalOutSize = totalOutSize; + } + } + /// + /// An exception thrown by the compression or decompression function, indicating that the + /// given input length was too large for the given input stream. + /// + public class StreamTooShortException : EndOfStreamException + { + /// + /// Creates a new exception that indicates that the stream was shorter than the given input length. + /// + public StreamTooShortException() + : base("The end of the stream was reached " + + "before the given amout of data was read.") + { } + } + /// + /// An exception indication that the input has more data than required in order + /// to decompress it. This may indicate that more sub-files are present in the file. + /// + public class TooMuchInputException : Exception + { + /// + /// Gets the number of bytes read by the decompressed to decompress the stream. + /// + public long ReadBytes { get; private set; } + + /// + /// Creates a new exception indicating that the input has more data than necessary for + /// decompressing th stream. It may indicate that other data is present after the compressed + /// stream. + /// + /// The number of bytes read by the decompressor. + /// The indicated length of the input stream. + public TooMuchInputException(long readBytes, long totLength) + : base("The input contains more data than necessary. Only used 0x" + + readBytes.ToString("X") + " of 0x" + totLength.ToString("X") + " bytes") + { + this.ReadBytes = readBytes; + } + } + #endregion + #region Supplementary + /// + /// Class for I/O-related utility methods. + /// + public static class LZUtil + { + /// + /// Determine the maximum size of a LZ-compressed block starting at newPtr, using the already compressed data + /// starting at oldPtr. Takes O(inLength * oldLength) = O(n^2) time. + /// + /// The start of the data that needs to be compressed. + /// The number of bytes that still need to be compressed. + /// (or: the maximum number of bytes that _may_ be compressed into one block) + /// The start of the raw file. + /// The number of bytes already compressed. + /// The offset of the start of the longest block to refer to. + /// The minimum allowed value for 'disp'. + /// The length of the longest sequence of bytes that can be copied from the already decompressed data. + public static unsafe int GetOccurrenceLength(byte* newPtr, int newLength, byte* oldPtr, int oldLength, out int disp, int minDisp = 1) + { + disp = 0; + if (newLength == 0) + return 0; + int maxLength = 0; + // try every possible 'disp' value (disp = oldLength - i) + for (int i = 0; i < oldLength - minDisp; i++) + { + // work from the start of the old data to the end, to mimic the original implementation's behaviour + // (and going from start to end or from end to start does not influence the compression ratio anyway) + byte* currentOldStart = oldPtr + i; + int currentLength = 0; + // determine the length we can copy if we go back (oldLength - i) bytes + // always check the next 'newLength' bytes, and not just the available 'old' bytes, + // as the copied data can also originate from what we're currently trying to compress. + for (int j = 0; j < newLength; j++) + { + // stop when the bytes are no longer the same + if (*(currentOldStart + j) != *(newPtr + j)) + break; + currentLength++; + } + + // update the optimal value + if (currentLength > maxLength) + { + maxLength = currentLength; + disp = oldLength - i; + + // if we cannot do better anyway, stop trying. + if (maxLength == newLength) + break; + } + } + return maxLength; + } + } + public static class IOUtils + { + #region byte[] <-> (u)int + /// + /// Returns a 4-byte unsigned integer as used on the NDS converted from four bytes + /// at a specified position in a byte array. + /// + /// The source of the data. + /// The location of the data in the source. + /// The indicated 4 bytes converted to uint + public static uint ToNDSu32(byte[] buffer, int offset) + { + return (uint)(buffer[offset] + | (buffer[offset + 1] << 8) + | (buffer[offset + 2] << 16) + | (buffer[offset + 3] << 24)); + } + + /// + /// Returns a 4-byte signed integer as used on the NDS converted from four bytes + /// at a specified position in a byte array. + /// + /// The source of the data. + /// The location of the data in the source. + /// The indicated 4 bytes converted to int + public static int ToNDSs32(byte[] buffer, int offset) + { + return (int)(buffer[offset] + | (buffer[offset + 1] << 8) + | (buffer[offset + 2] << 16) + | (buffer[offset + 3] << 24)); + } + + /// + /// Converts a u32 value into a sequence of bytes that would make ToNDSu32 return + /// the given input value. + /// + public static byte[] FromNDSu32(uint value) + { + return new byte[] { + (byte)(value & 0xFF), + (byte)((value >> 8) & 0xFF), + (byte)((value >> 16) & 0xFF), + (byte)((value >> 24) & 0xFF) + }; + } + + /// + /// Returns a 3-byte integer as used in the built-in compression + /// formats in the DS, converted from three bytes at a specified position in a byte array, + /// + /// The source of the data. + /// The location of the data in the source. + /// The indicated 3 bytes converted to an integer. + public static int ToNDSu24(byte[] buffer, int offset) + { + return (int)(buffer[offset] + | (buffer[offset + 1] << 8) + | (buffer[offset + 2] << 16)); + } + #endregion + } + #endregion + #endregion +} \ No newline at end of file diff --git a/pk3DS/Legal.cs b/pk3DS/Legal.cs new file mode 100644 index 0000000..c4618bd --- /dev/null +++ b/pk3DS/Legal.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace pk3DS +{ + class Legal + { + internal static readonly ushort[] Pouch_Items_XY = { + 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015,016,055,056, + 057,058,059,060,061,062,063,064,065,066,067,068,069,070,071,072,073,074,075, + 076,077,078,079,080,081,082,083,084,085,086,087,088,089,090,091,092,093,094, + 099,100,101,102,103,104,105,106,107,108,109,110,112,116,117,118,119,135,136, + 213,214,215,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232, + 233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251, + 252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270, + 271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289, + 290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308, + 309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327, + 492,493,494,495,496,497,498,499,500,537,538,539,540,541,542,543,544,545,546, + 547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,571, + 572,573,576,577,580,581,582,583,584,585,586,587,588,589,590,639,640,644,646, + 647,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, + 699,704,710,711,715, + }; + internal static readonly ushort[] Pouch_Items_ORAS = { + 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015,016,055,056, + 057,058,059,060,061,062,063,064,068,069,070,071,072,073,074,075, + 076,077,078,079,080,081,082,083,084,085,086,087,088,089,090,091,092,093,094, + 099,100,101,102,103,104,105,106,107,108,109,110,112,116,117,118,119,135,136, + 213,214,215,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232, + 233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251, + 252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270, + 271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289, + 290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308, + 309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327, + 492,493,494,495,496,497,498,499,500,537,538,539,540,541,542,543,544,545,546, + 547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,571, + 572,573,576,577,580,581,582,583,584,585,586,587,588,589,590,639,640,644,646, + 647,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, + 699,704,710,711,715, + + // ORAS + 534,535, + 752,753,754,755,756,757,758,759,760,761,762,763,764,767,768,769,770, + }; + internal static readonly ushort[] Pouch_Key_XY = { + 000,216,431,442,445,446,447,450,465,466,471,628, + 629,631,632,638,641,642,643,689,695,696,697,698, + 700,701,702,703,705,706,707,712,713,714, + + // Illegal + 716,717, // For the cheaters who want useless items... + }; + internal static readonly ushort[] Pouch_Key_ORAS = { + 000,216, 445,446,447, 465,466,471,628, + 629,631,632,638, 697, + + // Illegal + 716,717,745,746,747,748,749,750, // For the cheaters who want useless items... + + // ORAS + 457,474,503, + + 718,719, + 720,721,722,723,724,725,726,727,728,729, + 730,731,732,733,734,735,736, 738,739, + 740,741,742,743,744, + 751,765,766,771,772,774,775, + }; + internal static readonly ushort[] Pouch_TMHM_XY = { + 0, + 328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345, + 346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363, + 364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381, + 382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399, + 400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417, + 418,419,618,619,620,690,691,692,693,694, + + 420,421,422,423,424, + }; + internal static readonly ushort[] Pouch_TMHM_ORAS = { + 0, + 328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345, + 346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363, + 364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381, + 382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399, + 400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417, + 418,419,618,619,620,690,691,692,693,694, + + 420,421,422,423,424, + + // ORAS + 425,737, + }; + internal static readonly ushort[] Pouch_Medicine_XY = { + 000,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031,032,033, + 034,035,036,037,038,039,040,041,042,043,044,045,046,047,048,049,050,051, + 052,053,054,134,504,565,566,567,568,569,570,571,591,645,708,709, + }; + internal static readonly ushort[] Pouch_Medicine_ORAS = { + 000,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031,032,033, + 034,035,036,037,038,039,040,041,042,043,044,045,046,047,048,049,050,051, + 052,053,054,134,504,565,566,567,568,569,570,571,591,645,708,709, + + //ORAS + 065,066,067 + }; + internal static readonly ushort[] Pouch_Berry_XY = { + 0,149,150,151,152,153,154,155,156,157,158,159,160,161,162, + 163,164,165,166,167,168,169,170,171,172,173,174,175,176,177, + 178,179,180,181,182,183,184,185,186,187,188,189,190,191,192, + 193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,686,687,688, + }; + } +} diff --git a/pk3DS/Main.Designer.cs b/pk3DS/Main.Designer.cs new file mode 100644 index 0000000..b18a724 --- /dev/null +++ b/pk3DS/Main.Designer.cs @@ -0,0 +1,286 @@ +namespace pk3DS +{ + partial class Main + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.B_Open = new System.Windows.Forms.Button(); + this.TB_Path = new System.Windows.Forms.TextBox(); + this.GB_Tools = new System.Windows.Forms.GroupBox(); + this.B_StoryText = new System.Windows.Forms.Button(); + this.B_Item = new System.Windows.Forms.Button(); + this.B_Move = new System.Windows.Forms.Button(); + this.B_Evolution = new System.Windows.Forms.Button(); + this.B_Personal = new System.Windows.Forms.Button(); + this.B_MegaEvo = new System.Windows.Forms.Button(); + this.B_Wild = new System.Windows.Forms.Button(); + this.B_Trainer = new System.Windows.Forms.Button(); + this.B_GameText = new System.Windows.Forms.Button(); + this.CB_Lang = new System.Windows.Forms.ComboBox(); + this.L_Lang = new System.Windows.Forms.Label(); + this.L_Game = new System.Windows.Forms.Label(); + this.pBar1 = new System.Windows.Forms.ProgressBar(); + this.L_About = new System.Windows.Forms.Label(); + this.GB_Tools.SuspendLayout(); + this.SuspendLayout(); + // + // B_Open + // + this.B_Open.Location = new System.Drawing.Point(12, 12); + this.B_Open.Name = "B_Open"; + this.B_Open.Size = new System.Drawing.Size(75, 23); + this.B_Open.TabIndex = 0; + this.B_Open.Text = "Open \'a\'"; + this.B_Open.UseVisualStyleBackColor = true; + this.B_Open.Click += new System.EventHandler(this.B_Open_Click); + // + // TB_Path + // + this.TB_Path.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.TB_Path.Location = new System.Drawing.Point(93, 14); + this.TB_Path.Name = "TB_Path"; + this.TB_Path.ReadOnly = true; + this.TB_Path.Size = new System.Drawing.Size(244, 20); + this.TB_Path.TabIndex = 1; + // + // GB_Tools + // + this.GB_Tools.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.GB_Tools.Controls.Add(this.B_StoryText); + this.GB_Tools.Controls.Add(this.B_Item); + this.GB_Tools.Controls.Add(this.B_Move); + this.GB_Tools.Controls.Add(this.B_Evolution); + this.GB_Tools.Controls.Add(this.B_Personal); + this.GB_Tools.Controls.Add(this.B_MegaEvo); + this.GB_Tools.Controls.Add(this.B_Wild); + this.GB_Tools.Controls.Add(this.B_Trainer); + this.GB_Tools.Controls.Add(this.B_GameText); + this.GB_Tools.Enabled = false; + this.GB_Tools.Location = new System.Drawing.Point(12, 67); + this.GB_Tools.Name = "GB_Tools"; + this.GB_Tools.Size = new System.Drawing.Size(325, 110); + this.GB_Tools.TabIndex = 2; + this.GB_Tools.TabStop = false; + this.GB_Tools.Text = "ROM Editing Tools"; + // + // B_StoryText + // + this.B_StoryText.Location = new System.Drawing.Point(6, 48); + this.B_StoryText.Name = "B_StoryText"; + this.B_StoryText.Size = new System.Drawing.Size(100, 23); + this.B_StoryText.TabIndex = 8; + this.B_StoryText.Text = "Story Text Editor"; + this.B_StoryText.UseVisualStyleBackColor = true; + this.B_StoryText.Click += new System.EventHandler(this.B_StoryText_Click); + // + // B_Item + // + this.B_Item.Location = new System.Drawing.Point(218, 48); + this.B_Item.Name = "B_Item"; + this.B_Item.Size = new System.Drawing.Size(100, 23); + this.B_Item.TabIndex = 7; + this.B_Item.Text = "Item Editor"; + this.B_Item.UseVisualStyleBackColor = true; + this.B_Item.Click += new System.EventHandler(this.B_Item_Click); + // + // B_Move + // + this.B_Move.Location = new System.Drawing.Point(218, 19); + this.B_Move.Name = "B_Move"; + this.B_Move.Size = new System.Drawing.Size(100, 23); + this.B_Move.TabIndex = 6; + this.B_Move.Text = "Move Editor"; + this.B_Move.UseVisualStyleBackColor = true; + this.B_Move.Click += new System.EventHandler(this.B_Move_Click); + // + // B_Evolution + // + this.B_Evolution.Location = new System.Drawing.Point(112, 48); + this.B_Evolution.Name = "B_Evolution"; + this.B_Evolution.Size = new System.Drawing.Size(100, 23); + this.B_Evolution.TabIndex = 5; + this.B_Evolution.Text = "Evolution Editor"; + this.B_Evolution.UseVisualStyleBackColor = true; + this.B_Evolution.Click += new System.EventHandler(this.B_Evolution_Click); + // + // B_Personal + // + this.B_Personal.Location = new System.Drawing.Point(112, 19); + this.B_Personal.Name = "B_Personal"; + this.B_Personal.Size = new System.Drawing.Size(100, 23); + this.B_Personal.TabIndex = 4; + this.B_Personal.Text = "Personal Editor"; + this.B_Personal.UseVisualStyleBackColor = true; + this.B_Personal.Click += new System.EventHandler(this.B_Personal_Click); + // + // B_MegaEvo + // + this.B_MegaEvo.Location = new System.Drawing.Point(112, 77); + this.B_MegaEvo.Name = "B_MegaEvo"; + this.B_MegaEvo.Size = new System.Drawing.Size(100, 23); + this.B_MegaEvo.TabIndex = 3; + this.B_MegaEvo.Text = "Mega Evo Editor"; + this.B_MegaEvo.UseVisualStyleBackColor = true; + this.B_MegaEvo.Click += new System.EventHandler(this.B_MegaEvo_Click); + // + // B_Wild + // + this.B_Wild.Location = new System.Drawing.Point(6, 77); + this.B_Wild.Name = "B_Wild"; + this.B_Wild.Size = new System.Drawing.Size(100, 23); + this.B_Wild.TabIndex = 2; + this.B_Wild.Text = "Wild Editor"; + this.B_Wild.UseVisualStyleBackColor = true; + this.B_Wild.Click += new System.EventHandler(this.B_Wild_Click); + // + // B_Trainer + // + this.B_Trainer.Location = new System.Drawing.Point(218, 77); + this.B_Trainer.Name = "B_Trainer"; + this.B_Trainer.Size = new System.Drawing.Size(100, 23); + this.B_Trainer.TabIndex = 1; + this.B_Trainer.Text = "Trainer Editor"; + this.B_Trainer.UseVisualStyleBackColor = true; + this.B_Trainer.Click += new System.EventHandler(this.B_Trainer_Click); + // + // B_GameText + // + this.B_GameText.Location = new System.Drawing.Point(6, 19); + this.B_GameText.Name = "B_GameText"; + this.B_GameText.Size = new System.Drawing.Size(100, 23); + this.B_GameText.TabIndex = 0; + this.B_GameText.Text = "Game Text Editor"; + this.B_GameText.UseVisualStyleBackColor = true; + this.B_GameText.Click += new System.EventHandler(this.B_GameText_Click); + // + // CB_Lang + // + this.CB_Lang.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.CB_Lang.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_Lang.FormattingEnabled = true; + this.CB_Lang.Items.AddRange(new object[] { + "カタカナ", + "漢字", + "English", + "Français", + "Italiano", + "Deutsch", + "Español", + "한국"}); + this.CB_Lang.Location = new System.Drawing.Point(216, 40); + this.CB_Lang.Name = "CB_Lang"; + this.CB_Lang.Size = new System.Drawing.Size(121, 21); + this.CB_Lang.TabIndex = 3; + this.CB_Lang.SelectedIndexChanged += new System.EventHandler(this.changeLanguage); + // + // L_Lang + // + this.L_Lang.AutoSize = true; + this.L_Lang.Location = new System.Drawing.Point(152, 43); + this.L_Lang.Name = "L_Lang"; + this.L_Lang.Size = new System.Drawing.Size(58, 13); + this.L_Lang.TabIndex = 4; + this.L_Lang.Text = "Language:"; + // + // L_Game + // + this.L_Game.AutoSize = true; + this.L_Game.ForeColor = System.Drawing.Color.Red; + this.L_Game.Location = new System.Drawing.Point(15, 43); + this.L_Game.Name = "L_Game"; + this.L_Game.Size = new System.Drawing.Size(91, 13); + this.L_Game.TabIndex = 5; + this.L_Game.Text = "No Game Loaded"; + // + // pBar1 + // + this.pBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pBar1.Location = new System.Drawing.Point(12, 182); + this.pBar1.Name = "pBar1"; + this.pBar1.Size = new System.Drawing.Size(325, 14); + this.pBar1.TabIndex = 6; + // + // L_About + // + this.L_About.AutoSize = true; + this.L_About.Location = new System.Drawing.Point(-2, -1); + this.L_About.Name = "L_About"; + this.L_About.Size = new System.Drawing.Size(20, 13); + this.L_About.TabIndex = 7; + this.L_About.Text = "[A]"; + this.L_About.Click += new System.EventHandler(this.L_About_Click); + // + // Main + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(349, 202); + this.Controls.Add(this.L_About); + this.Controls.Add(this.pBar1); + this.Controls.Add(this.L_Game); + this.Controls.Add(this.L_Lang); + this.Controls.Add(this.CB_Lang); + this.Controls.Add(this.GB_Tools); + this.Controls.Add(this.TB_Path); + this.Controls.Add(this.B_Open); + this.MaximumSize = new System.Drawing.Size(800, 240); + this.MinimumSize = new System.Drawing.Size(365, 240); + this.Name = "Main"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "pk3DS"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.formClosing); + this.GB_Tools.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button B_Open; + private System.Windows.Forms.TextBox TB_Path; + private System.Windows.Forms.GroupBox GB_Tools; + private System.Windows.Forms.Button B_Trainer; + private System.Windows.Forms.Button B_GameText; + private System.Windows.Forms.Button B_Wild; + private System.Windows.Forms.Button B_Item; + private System.Windows.Forms.Button B_Move; + private System.Windows.Forms.Button B_Evolution; + private System.Windows.Forms.Button B_Personal; + private System.Windows.Forms.Button B_MegaEvo; + private System.Windows.Forms.Button B_StoryText; + private System.Windows.Forms.ComboBox CB_Lang; + private System.Windows.Forms.Label L_Lang; + private System.Windows.Forms.Label L_Game; + private System.Windows.Forms.ProgressBar pBar1; + private System.Windows.Forms.Label L_About; + } +} + diff --git a/pk3DS/Main.cs b/pk3DS/Main.cs new file mode 100644 index 0000000..bd0c32e --- /dev/null +++ b/pk3DS/Main.cs @@ -0,0 +1,274 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.Threading; + +namespace pk3DS +{ + public partial class Main : Form + { + public Main() + { + InitializeComponent(); + this.AllowDrop = GB_Tools.AllowDrop = TB_Path.AllowDrop = true; + this.DragEnter += tabMain_DragEnter; + this.DragDrop += tabMain_DragDrop; + GB_Tools.DragEnter += tabMain_DragEnter; + GB_Tools.DragDrop += tabMain_DragDrop; + TB_Path.DragEnter += tabMain_DragEnter; + TB_Path.DragDrop += tabMain_DragDrop; + CB_Lang.SelectedIndex = 2; + } + public bool oras = false; + public volatile int threads = 0; + private void B_Open_Click(object sender, EventArgs e) + { + FolderBrowserDialog fbd = new FolderBrowserDialog(); + if (fbd.ShowDialog() == DialogResult.OK) + openQuick(fbd.SelectedPath); + } + private void openQuick(string path) + { + // Check to see if the folder is romfs + FileInfo fi = new FileInfo(path); + if (fi.Name.Contains("a")) + { + string[] files = Directory.GetFiles(path, "*", SearchOption.AllDirectories); + System.Media.SystemSounds.Asterisk.Play(); + if (files.Length == 299) // ORAS + oras = true; + else if (files.Length == 301) // ORAS demo + oras = true; + else if (files.Length == 271) + oras = false; + else + { + TB_Path.Text = ""; GB_Tools.Enabled = false; + L_Game.Text = "No Game Loaded"; + return; + } + + TB_Path.Text = path; GB_Tools.Enabled = true; + L_Game.Text = (oras) ? "Game Loaded: ORAS" : "Game Loaded: XY"; + changeLanguage(null, null); // Trigger Text Loading + } + } + private void tabMain_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy; + } + private void tabMain_DragDrop(object sender, DragEventArgs e) + { + string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); + string path = files[0]; // open first D&D + openQuick(path); + } + + // Subform Items + private void B_GameText_Click(object sender, EventArgs e) + { + new Thread(() => + { + string toEdit = "gametext"; + string GARC = getGARCFileName(toEdit); + // threadGet(TB_Path.Text + getGARCFileName(toEdit), toEdit); // We don't need this because loading and changing language does it for us. + + Invoke((Action)(() => { new xytext(Directory.GetFiles(toEdit)).ShowDialog(); })); + // When closed, create a new thread to set the GARC back. + threadSet(TB_Path.Text + GARC, toEdit); + }).Start(); + } + private void B_StoryText_Click(object sender, EventArgs e) + { + if (threads > 0) { Util.Alert("Please wait for all operations to finish first."); return; } + new Thread(() => + { + string toEdit = "storytext"; + string GARC = getGARCFileName(toEdit); + threadGet(TB_Path.Text + GARC, toEdit, true, true); + while (threads > 0) // Let threads complete + Thread.Sleep(100); + + Invoke((Action)(() => { new xytext(Directory.GetFiles(toEdit)).ShowDialog(); })); + // When closed, create a new thread to set the GARC back. + threadSet(TB_Path.Text + GARC, toEdit); + while (threads > 0) // Let threads complete + Thread.Sleep(100); + if (Directory.Exists(toEdit)) Directory.Delete(toEdit, true); + }).Start(); + } volatile bool StoryTextOpen = false; + private void B_Wild_Click(object sender, EventArgs e) + { + Util.Alert("Not implemented yet."); + } + private void B_Personal_Click(object sender, EventArgs e) + { + Util.Alert("Not implemented yet."); + } + private void B_Evolution_Click(object sender, EventArgs e) + { + Util.Alert("Not implemented yet."); + } + private void B_MegaEvo_Click(object sender, EventArgs e) + { + Util.Alert("Not implemented yet."); + } + private void B_Move_Click(object sender, EventArgs e) + { + Util.Alert("Not implemented yet."); + } + private void B_Item_Click(object sender, EventArgs e) + { + Util.Alert("Not implemented yet."); + } + private void B_Trainer_Click(object sender, EventArgs e) + { + if (threads > 0) { Util.Alert("Please wait for all operations to finish first."); return; } + if (!oras) { Util.Alert("X/Y not supported yet."); return; } + new Thread(() => + { + string trdata = "trdata"; + string trdataGARC = getGARCFileName(trdata); + threadGet(TB_Path.Text + trdataGARC, trdata, true, true); + while (threads > 0) // Let threads complete + Thread.Sleep(50); + + string trpoke = "trpoke"; + string trpokeGARC = getGARCFileName(trpoke); + threadGet(TB_Path.Text + trpokeGARC, trpoke, true, true); + while (threads > 0) // Let threads complete + Thread.Sleep(50); + + string personal = "personal"; + string personalGARC = getGARCFileName(personal); + threadGet(TB_Path.Text + personalGARC, personal, true, true); + while (threads > 0) // Let threads complete + Thread.Sleep(100); + + Invoke((Action)(() => { new RSTE(oras, Directory.GetFiles(trdata), Directory.GetFiles(trpoke)).ShowDialog(); })); + // When closed, create a new thread to set the GARC back. + + threadSet(TB_Path.Text + trdataGARC, trdata); + while (threads > 0) // Let threads complete + Thread.Sleep(100); + if (Directory.Exists(trdata)) Directory.Delete(trdata, true); + + threadSet(TB_Path.Text + trpokeGARC, trpoke); + while (threads > 0) // Let threads complete + Thread.Sleep(100); + if (Directory.Exists(trpoke)) Directory.Delete(trpoke, true); + }).Start(); + } + + // GARC Requests + public bool getGARC(string infile, string outfolder, bool PB, bool bypassExt = false) + { + bool success = GARCTool.garcUnpack(infile, outfolder, bypassExt, (PB) ? pBar1 : null, null, true, bypassExt); + Console.WriteLine("Get Status: " + success.ToString()); + threads--; + return success; + } + public bool setGARC(string outfile, string infolder, bool PB) + { + string temp = Util.getRandomFileName(); + bool success = GARCTool.garcPack(infolder, temp, (PB) ? pBar1 : null, null, true); + Console.WriteLine("Set Status: " + success.ToString()); + try { File.Delete(outfile); File.Move(temp, outfile); } + catch (Exception e) { Util.Error("Could not set the GARC back:", e.ToString()); } + threads--; + return success; + } + public void threadGet(string infile, string outfolder, bool PB = true, bool bypassExt = false) + { + if (Directory.Exists(outfolder)) Directory.Delete(outfolder, true); + Thread thread = new Thread(() => getGARC(infile, outfolder, PB, bypassExt)); + thread.Start(); threads++; + } + public void threadSet(string outfile, string infolder, bool PB = true) + { + Thread thread = new Thread(() => setGARC(outfile, infolder, PB)); + thread.Start(); threads++; + } + public string getGARCFileName(string request) + { + int lang = 0; + if (CB_Lang.InvokeRequired) + CB_Lang.Invoke((MethodInvoker)delegate { lang = CB_Lang.SelectedIndex; }); + else lang = CB_Lang.SelectedIndex; + + string ans = ""; + switch (request) + { + case "gametext": ans = (oras) ? getFileName(0, 7, 1 + lang) : getFileName(0, 7, 2 + lang); + break; + case "storytext": ans = (oras) ? getFileName(0, 7 + ((lang + 9) / 10), (10 + (lang + 9)) % 10) : getFileName(0, 8, lang); + break; + case "personal": ans = (oras) ? getFileName(1, 9, 5) : getFileName(2, 1, 8); + break; + case "trdata": ans = (oras) ? getFileName(0, 3, 6) : getFileName(0, 3, 8); + break; + case "trpoke": ans = (oras) ? getFileName(0, 3, 8) : getFileName(0, 4, 0); + break; + } + return ans; + } + + // Text Requests + internal static string[] getText(int file) + { + return xytext.getStringsFromFile("gametext" + Path.DirectorySeparatorChar + file.ToString("000") + ".bin"); + } + public bool setText(int file, string[] strings) + { + byte[] data = xytext.getBytesForFile(strings); + string path = "text" + Path.DirectorySeparatorChar + file.ToString("000") + ".bin"; + File.WriteAllBytes(path, data); + return true; + } + + private void changeLanguage(object sender, EventArgs e) + { + if (!GB_Tools.Enabled) return; + // Gather the Text Language Strings + threadGet(TB_Path.Text + getGARCFileName("gametext"), "gametext", true, true); + } + private string getFileName(int A, int B, int C) + { + return Path.DirectorySeparatorChar + A.ToString() + Path.DirectorySeparatorChar + B.ToString() + Path.DirectorySeparatorChar + C.ToString(); + } + + private void formClosing(object sender, FormClosingEventArgs e) + { + this.Hide(); + if (!GB_Tools.Enabled) return; // No data/threads need to be addressed if we haven't loaded anything. + // Set the GameText back as other forms may have edited it. + threadSet(TB_Path.Text + getGARCFileName("gametext"), "gametext", false); + threadSet(TB_Path.Text + getGARCFileName("personal"), "personal", false); + int timeout = 0; // Time out after 7 seconds. + while (threads > 0 && timeout++ < 70) + Thread.Sleep(100); + + if (Directory.Exists("gametext")) Directory.Delete("gametext", true); + if (Directory.Exists("personal")) Directory.Delete("personal", true); + } + private void L_About_Click(object sender, EventArgs e) + { + Util.Alert( + "pk3DS: A package of Pokémon X/Y/OR/AS tools by various contributors.", + "GARCTool (Backbone): Kaphotics" + Environment.NewLine + + "Text Editing (xytext): Kaphotics" + Environment.NewLine + + "Wild Editor (**WE): SciresM & Kaphotics" + Environment.NewLine + + "Trainer Editor (**TE): SciresM & Kaphotics" + Environment.NewLine + + "Personal Editor: SciresM" + Environment.NewLine + + "Mega Evolution Editor (MEE): Huntereb & SciresM" + Environment.NewLine + + "Evolutions, Moves, and Items and more have yet to be implemented.", + "Big thanks to the ProjectPokemon community!"); + } + } +} \ No newline at end of file diff --git a/pk3DS/Main.resx b/pk3DS/Main.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/pk3DS/Main.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/pk3DS/Program.cs b/pk3DS/Program.cs new file mode 100644 index 0000000..66ba958 --- /dev/null +++ b/pk3DS/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace pk3DS +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Main()); + } + } +} diff --git a/pk3DS/Properties/AssemblyInfo.cs b/pk3DS/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..629623e --- /dev/null +++ b/pk3DS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("pk3DS")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("pk3DS")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("dcec1a61-b0cd-4982-a8d8-9024970c4f16")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/pk3DS/Properties/Resources.Designer.cs b/pk3DS/Properties/Resources.Designer.cs new file mode 100644 index 0000000..d087318 --- /dev/null +++ b/pk3DS/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.17929 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace pk3DS.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("pk3DS.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/pk3DS/Properties/Resources.resx b/pk3DS/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/pk3DS/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/pk3DS/Properties/Settings.Designer.cs b/pk3DS/Properties/Settings.Designer.cs new file mode 100644 index 0000000..101382a --- /dev/null +++ b/pk3DS/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.17929 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace pk3DS.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/pk3DS/Properties/Settings.settings b/pk3DS/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/pk3DS/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/pk3DS/RSTE.Designer.cs b/pk3DS/RSTE.Designer.cs new file mode 100644 index 0000000..3713309 --- /dev/null +++ b/pk3DS/RSTE.Designer.cs @@ -0,0 +1,2259 @@ +namespace pk3DS +{ + partial class RSTE + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.B_Dump = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.CB_TrainerID = new System.Windows.Forms.ComboBox(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.checkBox_Healer = new System.Windows.Forms.CheckBox(); + this.label83 = new System.Windows.Forms.Label(); + this.CB_Prize = new System.Windows.Forms.ComboBox(); + this.label39 = new System.Windows.Forms.Label(); + this.CB_AI = new System.Windows.Forms.ComboBox(); + this.label38 = new System.Windows.Forms.Label(); + this.CB_Money = new System.Windows.Forms.ComboBox(); + this.label30 = new System.Windows.Forms.Label(); + this.CB_Battle_Type = new System.Windows.Forms.ComboBox(); + this.label29 = new System.Windows.Forms.Label(); + this.CB_Trainer_Class = new System.Windows.Forms.ComboBox(); + this.checkBox_Moves = new System.Windows.Forms.CheckBox(); + this.checkBox_Item = new System.Windows.Forms.CheckBox(); + this.label58 = new System.Windows.Forms.Label(); + this.CB_Item_4 = new System.Windows.Forms.ComboBox(); + this.label59 = new System.Windows.Forms.Label(); + this.CB_Item_3 = new System.Windows.Forms.ComboBox(); + this.label60 = new System.Windows.Forms.Label(); + this.CB_Item_2 = new System.Windows.Forms.ComboBox(); + this.label61 = new System.Windows.Forms.Label(); + this.CB_Item_1 = new System.Windows.Forms.ComboBox(); + this.label64 = new System.Windows.Forms.Label(); + this.CB_numPokemon = new System.Windows.Forms.ComboBox(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.label67 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Ability = new System.Windows.Forms.ComboBox(); + this.label65 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Gender = new System.Windows.Forms.ComboBox(); + this.label47 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Form = new System.Windows.Forms.ComboBox(); + this.label9 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_IVs = new System.Windows.Forms.ComboBox(); + this.label8 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Move_4 = new System.Windows.Forms.ComboBox(); + this.label7 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Move_3 = new System.Windows.Forms.ComboBox(); + this.label6 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Move_2 = new System.Windows.Forms.ComboBox(); + this.label5 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Move_1 = new System.Windows.Forms.ComboBox(); + this.label4 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Item = new System.Windows.Forms.ComboBox(); + this.label3 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Level = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.CB_Pokemon_1_Pokemon = new System.Windows.Forms.ComboBox(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.label69 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Gender = new System.Windows.Forms.ComboBox(); + this.label70 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Ability = new System.Windows.Forms.ComboBox(); + this.label48 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Form = new System.Windows.Forms.ComboBox(); + this.label10 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_IVs = new System.Windows.Forms.ComboBox(); + this.label13 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Move_4 = new System.Windows.Forms.ComboBox(); + this.label14 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Move_3 = new System.Windows.Forms.ComboBox(); + this.label15 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Move_2 = new System.Windows.Forms.ComboBox(); + this.label16 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Move_1 = new System.Windows.Forms.ComboBox(); + this.label17 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Item = new System.Windows.Forms.ComboBox(); + this.label18 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Level = new System.Windows.Forms.ComboBox(); + this.label19 = new System.Windows.Forms.Label(); + this.CB_Pokemon_2_Pokemon = new System.Windows.Forms.ComboBox(); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.label72 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Gender = new System.Windows.Forms.ComboBox(); + this.label73 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Ability = new System.Windows.Forms.ComboBox(); + this.label56 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Form = new System.Windows.Forms.ComboBox(); + this.label11 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_IVs = new System.Windows.Forms.ComboBox(); + this.label22 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Move_4 = new System.Windows.Forms.ComboBox(); + this.label23 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Move_3 = new System.Windows.Forms.ComboBox(); + this.label24 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Move_2 = new System.Windows.Forms.ComboBox(); + this.label25 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Move_1 = new System.Windows.Forms.ComboBox(); + this.label26 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Item = new System.Windows.Forms.ComboBox(); + this.label27 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Level = new System.Windows.Forms.ComboBox(); + this.label28 = new System.Windows.Forms.Label(); + this.CB_Pokemon_3_Pokemon = new System.Windows.Forms.ComboBox(); + this.tabPage5 = new System.Windows.Forms.TabPage(); + this.label75 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Gender = new System.Windows.Forms.ComboBox(); + this.label76 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Ability = new System.Windows.Forms.ComboBox(); + this.label57 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Form = new System.Windows.Forms.ComboBox(); + this.label12 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_IVs = new System.Windows.Forms.ComboBox(); + this.label31 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Move_4 = new System.Windows.Forms.ComboBox(); + this.label32 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Move_3 = new System.Windows.Forms.ComboBox(); + this.label33 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Move_2 = new System.Windows.Forms.ComboBox(); + this.label34 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Move_1 = new System.Windows.Forms.ComboBox(); + this.label35 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Item = new System.Windows.Forms.ComboBox(); + this.label36 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Level = new System.Windows.Forms.ComboBox(); + this.label37 = new System.Windows.Forms.Label(); + this.CB_Pokemon_4_Pokemon = new System.Windows.Forms.ComboBox(); + this.tabPage6 = new System.Windows.Forms.TabPage(); + this.label78 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Gender = new System.Windows.Forms.ComboBox(); + this.label79 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Ability = new System.Windows.Forms.ComboBox(); + this.label62 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Form = new System.Windows.Forms.ComboBox(); + this.label20 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_IVs = new System.Windows.Forms.ComboBox(); + this.label40 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Move_4 = new System.Windows.Forms.ComboBox(); + this.label41 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Move_3 = new System.Windows.Forms.ComboBox(); + this.label42 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Move_2 = new System.Windows.Forms.ComboBox(); + this.label43 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Move_1 = new System.Windows.Forms.ComboBox(); + this.label44 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Item = new System.Windows.Forms.ComboBox(); + this.label45 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Level = new System.Windows.Forms.ComboBox(); + this.label46 = new System.Windows.Forms.Label(); + this.CB_Pokemon_5_Pokemon = new System.Windows.Forms.ComboBox(); + this.tabPage7 = new System.Windows.Forms.TabPage(); + this.label81 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Gender = new System.Windows.Forms.ComboBox(); + this.label82 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Ability = new System.Windows.Forms.ComboBox(); + this.label63 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Form = new System.Windows.Forms.ComboBox(); + this.label21 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_IVs = new System.Windows.Forms.ComboBox(); + this.label49 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Move_4 = new System.Windows.Forms.ComboBox(); + this.label50 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Move_3 = new System.Windows.Forms.ComboBox(); + this.label51 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Move_2 = new System.Windows.Forms.ComboBox(); + this.label52 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Move_1 = new System.Windows.Forms.ComboBox(); + this.label53 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Item = new System.Windows.Forms.ComboBox(); + this.label54 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Level = new System.Windows.Forms.ComboBox(); + this.label55 = new System.Windows.Forms.Label(); + this.CB_Pokemon_6_Pokemon = new System.Windows.Forms.ComboBox(); + this.B_Randomize = new System.Windows.Forms.Button(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.tabPage3.SuspendLayout(); + this.tabPage4.SuspendLayout(); + this.tabPage5.SuspendLayout(); + this.tabPage6.SuspendLayout(); + this.tabPage7.SuspendLayout(); + this.SuspendLayout(); + // + // B_Dump + // + this.B_Dump.Location = new System.Drawing.Point(483, 4); + this.B_Dump.Name = "B_Dump"; + this.B_Dump.Size = new System.Drawing.Size(93, 23); + this.B_Dump.TabIndex = 67; + this.B_Dump.Text = "Dump to .TXT"; + this.B_Dump.UseVisualStyleBackColor = true; + this.B_Dump.Click += new System.EventHandler(this.B_Dump_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(57, 13); + this.label1.TabIndex = 63; + this.label1.Text = "Trainer ID:"; + // + // CB_TrainerID + // + this.CB_TrainerID.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_TrainerID.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_TrainerID.FormattingEnabled = true; + this.CB_TrainerID.Location = new System.Drawing.Point(75, 6); + this.CB_TrainerID.Name = "CB_TrainerID"; + this.CB_TrainerID.Size = new System.Drawing.Size(134, 21); + this.CB_TrainerID.TabIndex = 62; + this.CB_TrainerID.SelectedIndexChanged += new System.EventHandler(this.changeTrainerIndex); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Controls.Add(this.tabPage3); + this.tabControl1.Controls.Add(this.tabPage4); + this.tabControl1.Controls.Add(this.tabPage5); + this.tabControl1.Controls.Add(this.tabPage6); + this.tabControl1.Controls.Add(this.tabPage7); + this.tabControl1.Location = new System.Drawing.Point(12, 33); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(565, 153); + this.tabControl1.TabIndex = 61; + // + // tabPage1 + // + this.tabPage1.BackColor = System.Drawing.SystemColors.Control; + this.tabPage1.Controls.Add(this.checkBox_Healer); + this.tabPage1.Controls.Add(this.label83); + this.tabPage1.Controls.Add(this.CB_Prize); + this.tabPage1.Controls.Add(this.label39); + this.tabPage1.Controls.Add(this.CB_AI); + this.tabPage1.Controls.Add(this.label38); + this.tabPage1.Controls.Add(this.CB_Money); + this.tabPage1.Controls.Add(this.label30); + this.tabPage1.Controls.Add(this.CB_Battle_Type); + this.tabPage1.Controls.Add(this.label29); + this.tabPage1.Controls.Add(this.CB_Trainer_Class); + this.tabPage1.Controls.Add(this.checkBox_Moves); + this.tabPage1.Controls.Add(this.checkBox_Item); + this.tabPage1.Controls.Add(this.label58); + this.tabPage1.Controls.Add(this.CB_Item_4); + this.tabPage1.Controls.Add(this.label59); + this.tabPage1.Controls.Add(this.CB_Item_3); + this.tabPage1.Controls.Add(this.label60); + this.tabPage1.Controls.Add(this.CB_Item_2); + this.tabPage1.Controls.Add(this.label61); + this.tabPage1.Controls.Add(this.CB_Item_1); + this.tabPage1.Controls.Add(this.label64); + this.tabPage1.Controls.Add(this.CB_numPokemon); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(557, 127); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Trainer info"; + // + // checkBox_Healer + // + this.checkBox_Healer.AutoSize = true; + this.checkBox_Healer.Location = new System.Drawing.Point(7, 35); + this.checkBox_Healer.Name = "checkBox_Healer"; + this.checkBox_Healer.Size = new System.Drawing.Size(57, 17); + this.checkBox_Healer.TabIndex = 58; + this.checkBox_Healer.Text = "Healer"; + this.checkBox_Healer.UseVisualStyleBackColor = true; + // + // label83 + // + this.label83.AutoSize = true; + this.label83.Location = new System.Drawing.Point(454, 3); + this.label83.Name = "label83"; + this.label83.Size = new System.Drawing.Size(33, 13); + this.label83.TabIndex = 57; + this.label83.Text = "Prize:"; + // + // CB_Prize + // + this.CB_Prize.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Prize.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Prize.FormattingEnabled = true; + this.CB_Prize.Location = new System.Drawing.Point(457, 19); + this.CB_Prize.Name = "CB_Prize"; + this.CB_Prize.Size = new System.Drawing.Size(93, 21); + this.CB_Prize.TabIndex = 56; + // + // label39 + // + this.label39.AutoSize = true; + this.label39.Location = new System.Drawing.Point(11, 103); + this.label39.Name = "label39"; + this.label39.Size = new System.Drawing.Size(49, 13); + this.label39.TabIndex = 55; + this.label39.Text = "AI Level:"; + // + // CB_AI + // + this.CB_AI.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_AI.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_AI.FormattingEnabled = true; + this.CB_AI.Location = new System.Drawing.Point(66, 100); + this.CB_AI.Name = "CB_AI"; + this.CB_AI.Size = new System.Drawing.Size(74, 21); + this.CB_AI.TabIndex = 54; + // + // label38 + // + this.label38.AutoSize = true; + this.label38.Location = new System.Drawing.Point(146, 103); + this.label38.Name = "label38"; + this.label38.Size = new System.Drawing.Size(42, 13); + this.label38.TabIndex = 53; + this.label38.Text = "Money:"; + // + // CB_Money + // + this.CB_Money.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Money.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Money.FormattingEnabled = true; + this.CB_Money.Location = new System.Drawing.Point(195, 100); + this.CB_Money.Name = "CB_Money"; + this.CB_Money.Size = new System.Drawing.Size(77, 21); + this.CB_Money.TabIndex = 52; + // + // label30 + // + this.label30.AutoSize = true; + this.label30.Location = new System.Drawing.Point(86, 76); + this.label30.Name = "label30"; + this.label30.Size = new System.Drawing.Size(64, 13); + this.label30.TabIndex = 51; + this.label30.Text = "Battle Type:"; + // + // CB_Battle_Type + // + this.CB_Battle_Type.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Battle_Type.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Battle_Type.FormattingEnabled = true; + this.CB_Battle_Type.Items.AddRange(new object[] { + "Single Battle", + "Double Battle", + "Triple Battle", + "Rotation Battle", + "Horde Battle"}); + this.CB_Battle_Type.Location = new System.Drawing.Point(156, 73); + this.CB_Battle_Type.Name = "CB_Battle_Type"; + this.CB_Battle_Type.Size = new System.Drawing.Size(116, 21); + this.CB_Battle_Type.TabIndex = 50; + // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(79, 49); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(71, 13); + this.label29.TabIndex = 49; + this.label29.Text = "Trainer Class:"; + // + // CB_Trainer_Class + // + this.CB_Trainer_Class.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Trainer_Class.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Trainer_Class.FormattingEnabled = true; + this.CB_Trainer_Class.Location = new System.Drawing.Point(156, 46); + this.CB_Trainer_Class.Name = "CB_Trainer_Class"; + this.CB_Trainer_Class.Size = new System.Drawing.Size(116, 21); + this.CB_Trainer_Class.TabIndex = 48; + // + // checkBox_Moves + // + this.checkBox_Moves.AutoSize = true; + this.checkBox_Moves.Location = new System.Drawing.Point(7, 58); + this.checkBox_Moves.Name = "checkBox_Moves"; + this.checkBox_Moves.Size = new System.Drawing.Size(58, 17); + this.checkBox_Moves.TabIndex = 40; + this.checkBox_Moves.Text = "Moves"; + this.checkBox_Moves.UseVisualStyleBackColor = true; + this.checkBox_Moves.CheckedChanged += new System.EventHandler(this.changeTrainerType); + // + // checkBox_Item + // + this.checkBox_Item.AutoSize = true; + this.checkBox_Item.Location = new System.Drawing.Point(7, 81); + this.checkBox_Item.Name = "checkBox_Item"; + this.checkBox_Item.Size = new System.Drawing.Size(51, 17); + this.checkBox_Item.TabIndex = 39; + this.checkBox_Item.Text = "Items"; + this.checkBox_Item.UseVisualStyleBackColor = true; + this.checkBox_Item.CheckedChanged += new System.EventHandler(this.changeTrainerType); + // + // label58 + // + this.label58.AutoSize = true; + this.label58.Location = new System.Drawing.Point(278, 103); + this.label58.Name = "label58"; + this.label58.Size = new System.Drawing.Size(39, 13); + this.label58.TabIndex = 34; + this.label58.Text = "Item 4:"; + // + // CB_Item_4 + // + this.CB_Item_4.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Item_4.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Item_4.FormattingEnabled = true; + this.CB_Item_4.Location = new System.Drawing.Point(330, 100); + this.CB_Item_4.Name = "CB_Item_4"; + this.CB_Item_4.Size = new System.Drawing.Size(121, 21); + this.CB_Item_4.TabIndex = 33; + // + // label59 + // + this.label59.AutoSize = true; + this.label59.Location = new System.Drawing.Point(278, 76); + this.label59.Name = "label59"; + this.label59.Size = new System.Drawing.Size(39, 13); + this.label59.TabIndex = 32; + this.label59.Text = "Item 3:"; + // + // CB_Item_3 + // + this.CB_Item_3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Item_3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Item_3.FormattingEnabled = true; + this.CB_Item_3.Location = new System.Drawing.Point(330, 73); + this.CB_Item_3.Name = "CB_Item_3"; + this.CB_Item_3.Size = new System.Drawing.Size(121, 21); + this.CB_Item_3.TabIndex = 31; + // + // label60 + // + this.label60.AutoSize = true; + this.label60.Location = new System.Drawing.Point(278, 49); + this.label60.Name = "label60"; + this.label60.Size = new System.Drawing.Size(39, 13); + this.label60.TabIndex = 30; + this.label60.Text = "Item 2:"; + // + // CB_Item_2 + // + this.CB_Item_2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Item_2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Item_2.FormattingEnabled = true; + this.CB_Item_2.Location = new System.Drawing.Point(330, 46); + this.CB_Item_2.Name = "CB_Item_2"; + this.CB_Item_2.Size = new System.Drawing.Size(121, 21); + this.CB_Item_2.TabIndex = 29; + // + // label61 + // + this.label61.AutoSize = true; + this.label61.Location = new System.Drawing.Point(278, 22); + this.label61.Name = "label61"; + this.label61.Size = new System.Drawing.Size(39, 13); + this.label61.TabIndex = 28; + this.label61.Text = "Item 1:"; + // + // CB_Item_1 + // + this.CB_Item_1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Item_1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Item_1.FormattingEnabled = true; + this.CB_Item_1.Location = new System.Drawing.Point(330, 19); + this.CB_Item_1.Name = "CB_Item_1"; + this.CB_Item_1.Size = new System.Drawing.Size(121, 21); + this.CB_Item_1.TabIndex = 27; + // + // label64 + // + this.label64.AutoSize = true; + this.label64.Location = new System.Drawing.Point(43, 22); + this.label64.Name = "label64"; + this.label64.Size = new System.Drawing.Size(107, 13); + this.label64.TabIndex = 22; + this.label64.Text = "Number of Pokemon:"; + // + // CB_numPokemon + // + this.CB_numPokemon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_numPokemon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_numPokemon.FormattingEnabled = true; + this.CB_numPokemon.Items.AddRange(new object[] { + "0", + "1", + "2", + "3", + "4", + "5", + "6"}); + this.CB_numPokemon.Location = new System.Drawing.Point(156, 19); + this.CB_numPokemon.Name = "CB_numPokemon"; + this.CB_numPokemon.Size = new System.Drawing.Size(116, 21); + this.CB_numPokemon.TabIndex = 21; + this.CB_numPokemon.SelectedIndexChanged += new System.EventHandler(this.changeTrainerType); + // + // tabPage2 + // + this.tabPage2.BackColor = System.Drawing.SystemColors.Control; + this.tabPage2.Controls.Add(this.label67); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Ability); + this.tabPage2.Controls.Add(this.label65); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Gender); + this.tabPage2.Controls.Add(this.label47); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Form); + this.tabPage2.Controls.Add(this.label9); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_IVs); + this.tabPage2.Controls.Add(this.label8); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Move_4); + this.tabPage2.Controls.Add(this.label7); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Move_3); + this.tabPage2.Controls.Add(this.label6); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Move_2); + this.tabPage2.Controls.Add(this.label5); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Move_1); + this.tabPage2.Controls.Add(this.label4); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Item); + this.tabPage2.Controls.Add(this.label3); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Level); + this.tabPage2.Controls.Add(this.label2); + this.tabPage2.Controls.Add(this.CB_Pokemon_1_Pokemon); + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(557, 127); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "Pokemon 1"; + // + // label67 + // + this.label67.AutoSize = true; + this.label67.Location = new System.Drawing.Point(33, 36); + this.label67.Name = "label67"; + this.label67.Size = new System.Drawing.Size(33, 13); + this.label67.TabIndex = 63; + this.label67.Text = "Form:"; + // + // CB_Pokemon_1_Ability + // + this.CB_Pokemon_1_Ability.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Ability.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Ability.Enabled = false; + this.CB_Pokemon_1_Ability.FormattingEnabled = true; + this.CB_Pokemon_1_Ability.Location = new System.Drawing.Point(429, 33); + this.CB_Pokemon_1_Ability.Name = "CB_Pokemon_1_Ability"; + this.CB_Pokemon_1_Ability.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Ability.TabIndex = 62; + // + // label65 + // + this.label65.AutoSize = true; + this.label65.Location = new System.Drawing.Point(378, 63); + this.label65.Name = "label65"; + this.label65.Size = new System.Drawing.Size(45, 13); + this.label65.TabIndex = 59; + this.label65.Text = "Gender:"; + // + // CB_Pokemon_1_Gender + // + this.CB_Pokemon_1_Gender.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Gender.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Gender.Enabled = false; + this.CB_Pokemon_1_Gender.FormattingEnabled = true; + this.CB_Pokemon_1_Gender.Location = new System.Drawing.Point(429, 60); + this.CB_Pokemon_1_Gender.Name = "CB_Pokemon_1_Gender"; + this.CB_Pokemon_1_Gender.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Gender.TabIndex = 58; + // + // label47 + // + this.label47.AutoSize = true; + this.label47.Location = new System.Drawing.Point(386, 36); + this.label47.Name = "label47"; + this.label47.Size = new System.Drawing.Size(37, 13); + this.label47.TabIndex = 57; + this.label47.Text = "Ability:"; + // + // CB_Pokemon_1_Form + // + this.CB_Pokemon_1_Form.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Form.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Form.Enabled = false; + this.CB_Pokemon_1_Form.FormattingEnabled = true; + this.CB_Pokemon_1_Form.Location = new System.Drawing.Point(72, 33); + this.CB_Pokemon_1_Form.Name = "CB_Pokemon_1_Form"; + this.CB_Pokemon_1_Form.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Form.TabIndex = 56; + this.CB_Pokemon_1_Form.SelectedIndexChanged += new System.EventHandler(this.refreshFormAbility); + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(398, 9); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(25, 13); + this.label9.TabIndex = 36; + this.label9.Text = "IVs:"; + // + // CB_Pokemon_1_IVs + // + this.CB_Pokemon_1_IVs.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_IVs.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_IVs.Enabled = false; + this.CB_Pokemon_1_IVs.FormattingEnabled = true; + this.CB_Pokemon_1_IVs.Location = new System.Drawing.Point(429, 6); + this.CB_Pokemon_1_IVs.Name = "CB_Pokemon_1_IVs"; + this.CB_Pokemon_1_IVs.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_IVs.TabIndex = 35; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(199, 90); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(46, 13); + this.label8.TabIndex = 34; + this.label8.Text = "Move 4:"; + // + // CB_Pokemon_1_Move_4 + // + this.CB_Pokemon_1_Move_4.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Move_4.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Move_4.Enabled = false; + this.CB_Pokemon_1_Move_4.FormattingEnabled = true; + this.CB_Pokemon_1_Move_4.Location = new System.Drawing.Point(251, 87); + this.CB_Pokemon_1_Move_4.Name = "CB_Pokemon_1_Move_4"; + this.CB_Pokemon_1_Move_4.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Move_4.TabIndex = 33; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(199, 63); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(46, 13); + this.label7.TabIndex = 32; + this.label7.Text = "Move 3:"; + // + // CB_Pokemon_1_Move_3 + // + this.CB_Pokemon_1_Move_3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Move_3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Move_3.Enabled = false; + this.CB_Pokemon_1_Move_3.FormattingEnabled = true; + this.CB_Pokemon_1_Move_3.Location = new System.Drawing.Point(251, 60); + this.CB_Pokemon_1_Move_3.Name = "CB_Pokemon_1_Move_3"; + this.CB_Pokemon_1_Move_3.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Move_3.TabIndex = 31; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(199, 36); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(46, 13); + this.label6.TabIndex = 30; + this.label6.Text = "Move 2:"; + // + // CB_Pokemon_1_Move_2 + // + this.CB_Pokemon_1_Move_2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Move_2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Move_2.Enabled = false; + this.CB_Pokemon_1_Move_2.FormattingEnabled = true; + this.CB_Pokemon_1_Move_2.Location = new System.Drawing.Point(251, 33); + this.CB_Pokemon_1_Move_2.Name = "CB_Pokemon_1_Move_2"; + this.CB_Pokemon_1_Move_2.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Move_2.TabIndex = 29; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(199, 9); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(46, 13); + this.label5.TabIndex = 28; + this.label5.Text = "Move 1:"; + // + // CB_Pokemon_1_Move_1 + // + this.CB_Pokemon_1_Move_1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Move_1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Move_1.Enabled = false; + this.CB_Pokemon_1_Move_1.FormattingEnabled = true; + this.CB_Pokemon_1_Move_1.Location = new System.Drawing.Point(251, 6); + this.CB_Pokemon_1_Move_1.Name = "CB_Pokemon_1_Move_1"; + this.CB_Pokemon_1_Move_1.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Move_1.TabIndex = 27; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(36, 90); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(30, 13); + this.label4.TabIndex = 26; + this.label4.Text = "Item:"; + // + // CB_Pokemon_1_Item + // + this.CB_Pokemon_1_Item.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Item.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Item.Enabled = false; + this.CB_Pokemon_1_Item.FormattingEnabled = true; + this.CB_Pokemon_1_Item.Location = new System.Drawing.Point(72, 87); + this.CB_Pokemon_1_Item.Name = "CB_Pokemon_1_Item"; + this.CB_Pokemon_1_Item.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Item.TabIndex = 25; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(30, 63); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(36, 13); + this.label3.TabIndex = 24; + this.label3.Text = "Level:"; + // + // CB_Pokemon_1_Level + // + this.CB_Pokemon_1_Level.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Level.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Level.Enabled = false; + this.CB_Pokemon_1_Level.FormattingEnabled = true; + this.CB_Pokemon_1_Level.Location = new System.Drawing.Point(72, 60); + this.CB_Pokemon_1_Level.Name = "CB_Pokemon_1_Level"; + this.CB_Pokemon_1_Level.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Level.TabIndex = 23; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(11, 9); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(55, 13); + this.label2.TabIndex = 22; + this.label2.Text = "Pokemon:"; + // + // CB_Pokemon_1_Pokemon + // + this.CB_Pokemon_1_Pokemon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_1_Pokemon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_1_Pokemon.Enabled = false; + this.CB_Pokemon_1_Pokemon.FormattingEnabled = true; + this.CB_Pokemon_1_Pokemon.Location = new System.Drawing.Point(72, 6); + this.CB_Pokemon_1_Pokemon.Name = "CB_Pokemon_1_Pokemon"; + this.CB_Pokemon_1_Pokemon.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_1_Pokemon.TabIndex = 21; + this.CB_Pokemon_1_Pokemon.SelectedIndexChanged += new System.EventHandler(this.refreshSpeciesAbility); + // + // tabPage3 + // + this.tabPage3.BackColor = System.Drawing.SystemColors.Control; + this.tabPage3.Controls.Add(this.label69); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Gender); + this.tabPage3.Controls.Add(this.label70); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Ability); + this.tabPage3.Controls.Add(this.label48); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Form); + this.tabPage3.Controls.Add(this.label10); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_IVs); + this.tabPage3.Controls.Add(this.label13); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Move_4); + this.tabPage3.Controls.Add(this.label14); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Move_3); + this.tabPage3.Controls.Add(this.label15); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Move_2); + this.tabPage3.Controls.Add(this.label16); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Move_1); + this.tabPage3.Controls.Add(this.label17); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Item); + this.tabPage3.Controls.Add(this.label18); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Level); + this.tabPage3.Controls.Add(this.label19); + this.tabPage3.Controls.Add(this.CB_Pokemon_2_Pokemon); + this.tabPage3.Location = new System.Drawing.Point(4, 22); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(557, 127); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "Pokemon 2"; + // + // label69 + // + this.label69.AutoSize = true; + this.label69.Location = new System.Drawing.Point(378, 63); + this.label69.Name = "label69"; + this.label69.Size = new System.Drawing.Size(45, 13); + this.label69.TabIndex = 65; + this.label69.Text = "Gender:"; + // + // CB_Pokemon_2_Gender + // + this.CB_Pokemon_2_Gender.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Gender.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Gender.Enabled = false; + this.CB_Pokemon_2_Gender.FormattingEnabled = true; + this.CB_Pokemon_2_Gender.Location = new System.Drawing.Point(429, 60); + this.CB_Pokemon_2_Gender.Name = "CB_Pokemon_2_Gender"; + this.CB_Pokemon_2_Gender.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Gender.TabIndex = 64; + // + // label70 + // + this.label70.AutoSize = true; + this.label70.Location = new System.Drawing.Point(386, 36); + this.label70.Name = "label70"; + this.label70.Size = new System.Drawing.Size(37, 13); + this.label70.TabIndex = 63; + this.label70.Text = "Ability:"; + // + // CB_Pokemon_2_Ability + // + this.CB_Pokemon_2_Ability.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Ability.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Ability.Enabled = false; + this.CB_Pokemon_2_Ability.FormattingEnabled = true; + this.CB_Pokemon_2_Ability.Location = new System.Drawing.Point(429, 33); + this.CB_Pokemon_2_Ability.Name = "CB_Pokemon_2_Ability"; + this.CB_Pokemon_2_Ability.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Ability.TabIndex = 62; + // + // label48 + // + this.label48.AutoSize = true; + this.label48.Location = new System.Drawing.Point(33, 36); + this.label48.Name = "label48"; + this.label48.Size = new System.Drawing.Size(33, 13); + this.label48.TabIndex = 59; + this.label48.Text = "Form:"; + // + // CB_Pokemon_2_Form + // + this.CB_Pokemon_2_Form.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Form.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Form.Enabled = false; + this.CB_Pokemon_2_Form.FormattingEnabled = true; + this.CB_Pokemon_2_Form.Location = new System.Drawing.Point(72, 33); + this.CB_Pokemon_2_Form.Name = "CB_Pokemon_2_Form"; + this.CB_Pokemon_2_Form.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Form.TabIndex = 58; + this.CB_Pokemon_2_Form.SelectedIndexChanged += new System.EventHandler(this.refreshFormAbility); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(398, 9); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(25, 13); + this.label10.TabIndex = 38; + this.label10.Text = "IVs:"; + // + // CB_Pokemon_2_IVs + // + this.CB_Pokemon_2_IVs.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_IVs.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_IVs.Enabled = false; + this.CB_Pokemon_2_IVs.FormattingEnabled = true; + this.CB_Pokemon_2_IVs.Location = new System.Drawing.Point(429, 6); + this.CB_Pokemon_2_IVs.Name = "CB_Pokemon_2_IVs"; + this.CB_Pokemon_2_IVs.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_IVs.TabIndex = 37; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(199, 90); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(46, 13); + this.label13.TabIndex = 34; + this.label13.Text = "Move 4:"; + // + // CB_Pokemon_2_Move_4 + // + this.CB_Pokemon_2_Move_4.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Move_4.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Move_4.Enabled = false; + this.CB_Pokemon_2_Move_4.FormattingEnabled = true; + this.CB_Pokemon_2_Move_4.Location = new System.Drawing.Point(251, 87); + this.CB_Pokemon_2_Move_4.Name = "CB_Pokemon_2_Move_4"; + this.CB_Pokemon_2_Move_4.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Move_4.TabIndex = 33; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(199, 63); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(46, 13); + this.label14.TabIndex = 32; + this.label14.Text = "Move 3:"; + // + // CB_Pokemon_2_Move_3 + // + this.CB_Pokemon_2_Move_3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Move_3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Move_3.Enabled = false; + this.CB_Pokemon_2_Move_3.FormattingEnabled = true; + this.CB_Pokemon_2_Move_3.Location = new System.Drawing.Point(251, 60); + this.CB_Pokemon_2_Move_3.Name = "CB_Pokemon_2_Move_3"; + this.CB_Pokemon_2_Move_3.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Move_3.TabIndex = 31; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(199, 36); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(46, 13); + this.label15.TabIndex = 30; + this.label15.Text = "Move 2:"; + // + // CB_Pokemon_2_Move_2 + // + this.CB_Pokemon_2_Move_2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Move_2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Move_2.Enabled = false; + this.CB_Pokemon_2_Move_2.FormattingEnabled = true; + this.CB_Pokemon_2_Move_2.Location = new System.Drawing.Point(251, 33); + this.CB_Pokemon_2_Move_2.Name = "CB_Pokemon_2_Move_2"; + this.CB_Pokemon_2_Move_2.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Move_2.TabIndex = 29; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(199, 9); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(46, 13); + this.label16.TabIndex = 28; + this.label16.Text = "Move 1:"; + // + // CB_Pokemon_2_Move_1 + // + this.CB_Pokemon_2_Move_1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Move_1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Move_1.Enabled = false; + this.CB_Pokemon_2_Move_1.FormattingEnabled = true; + this.CB_Pokemon_2_Move_1.Location = new System.Drawing.Point(251, 6); + this.CB_Pokemon_2_Move_1.Name = "CB_Pokemon_2_Move_1"; + this.CB_Pokemon_2_Move_1.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Move_1.TabIndex = 27; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(36, 90); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(30, 13); + this.label17.TabIndex = 26; + this.label17.Text = "Item:"; + // + // CB_Pokemon_2_Item + // + this.CB_Pokemon_2_Item.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Item.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Item.Enabled = false; + this.CB_Pokemon_2_Item.FormattingEnabled = true; + this.CB_Pokemon_2_Item.Location = new System.Drawing.Point(72, 87); + this.CB_Pokemon_2_Item.Name = "CB_Pokemon_2_Item"; + this.CB_Pokemon_2_Item.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Item.TabIndex = 25; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(30, 63); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(36, 13); + this.label18.TabIndex = 24; + this.label18.Text = "Level:"; + // + // CB_Pokemon_2_Level + // + this.CB_Pokemon_2_Level.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Level.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Level.Enabled = false; + this.CB_Pokemon_2_Level.FormattingEnabled = true; + this.CB_Pokemon_2_Level.Location = new System.Drawing.Point(72, 60); + this.CB_Pokemon_2_Level.Name = "CB_Pokemon_2_Level"; + this.CB_Pokemon_2_Level.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Level.TabIndex = 23; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(11, 9); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(55, 13); + this.label19.TabIndex = 22; + this.label19.Text = "Pokemon:"; + // + // CB_Pokemon_2_Pokemon + // + this.CB_Pokemon_2_Pokemon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_2_Pokemon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_2_Pokemon.Enabled = false; + this.CB_Pokemon_2_Pokemon.FormattingEnabled = true; + this.CB_Pokemon_2_Pokemon.Location = new System.Drawing.Point(72, 6); + this.CB_Pokemon_2_Pokemon.Name = "CB_Pokemon_2_Pokemon"; + this.CB_Pokemon_2_Pokemon.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_2_Pokemon.TabIndex = 21; + this.CB_Pokemon_2_Pokemon.SelectedIndexChanged += new System.EventHandler(this.refreshSpeciesAbility); + // + // tabPage4 + // + this.tabPage4.BackColor = System.Drawing.SystemColors.Control; + this.tabPage4.Controls.Add(this.label72); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Gender); + this.tabPage4.Controls.Add(this.label73); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Ability); + this.tabPage4.Controls.Add(this.label56); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Form); + this.tabPage4.Controls.Add(this.label11); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_IVs); + this.tabPage4.Controls.Add(this.label22); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Move_4); + this.tabPage4.Controls.Add(this.label23); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Move_3); + this.tabPage4.Controls.Add(this.label24); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Move_2); + this.tabPage4.Controls.Add(this.label25); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Move_1); + this.tabPage4.Controls.Add(this.label26); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Item); + this.tabPage4.Controls.Add(this.label27); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Level); + this.tabPage4.Controls.Add(this.label28); + this.tabPage4.Controls.Add(this.CB_Pokemon_3_Pokemon); + this.tabPage4.Location = new System.Drawing.Point(4, 22); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Padding = new System.Windows.Forms.Padding(3); + this.tabPage4.Size = new System.Drawing.Size(557, 127); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "Pokemon 3"; + // + // label72 + // + this.label72.AutoSize = true; + this.label72.Location = new System.Drawing.Point(378, 63); + this.label72.Name = "label72"; + this.label72.Size = new System.Drawing.Size(45, 13); + this.label72.TabIndex = 65; + this.label72.Text = "Gender:"; + // + // CB_Pokemon_3_Gender + // + this.CB_Pokemon_3_Gender.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Gender.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Gender.Enabled = false; + this.CB_Pokemon_3_Gender.FormattingEnabled = true; + this.CB_Pokemon_3_Gender.Location = new System.Drawing.Point(429, 60); + this.CB_Pokemon_3_Gender.Name = "CB_Pokemon_3_Gender"; + this.CB_Pokemon_3_Gender.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Gender.TabIndex = 64; + // + // label73 + // + this.label73.AutoSize = true; + this.label73.Location = new System.Drawing.Point(386, 36); + this.label73.Name = "label73"; + this.label73.Size = new System.Drawing.Size(37, 13); + this.label73.TabIndex = 63; + this.label73.Text = "Ability:"; + // + // CB_Pokemon_3_Ability + // + this.CB_Pokemon_3_Ability.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Ability.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Ability.Enabled = false; + this.CB_Pokemon_3_Ability.FormattingEnabled = true; + this.CB_Pokemon_3_Ability.Location = new System.Drawing.Point(429, 33); + this.CB_Pokemon_3_Ability.Name = "CB_Pokemon_3_Ability"; + this.CB_Pokemon_3_Ability.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Ability.TabIndex = 62; + // + // label56 + // + this.label56.AutoSize = true; + this.label56.Location = new System.Drawing.Point(33, 36); + this.label56.Name = "label56"; + this.label56.Size = new System.Drawing.Size(33, 13); + this.label56.TabIndex = 59; + this.label56.Text = "Form:"; + // + // CB_Pokemon_3_Form + // + this.CB_Pokemon_3_Form.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Form.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Form.Enabled = false; + this.CB_Pokemon_3_Form.FormattingEnabled = true; + this.CB_Pokemon_3_Form.Location = new System.Drawing.Point(72, 33); + this.CB_Pokemon_3_Form.Name = "CB_Pokemon_3_Form"; + this.CB_Pokemon_3_Form.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Form.TabIndex = 58; + this.CB_Pokemon_3_Form.SelectedIndexChanged += new System.EventHandler(this.refreshFormAbility); + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(398, 9); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(25, 13); + this.label11.TabIndex = 38; + this.label11.Text = "IVs:"; + // + // CB_Pokemon_3_IVs + // + this.CB_Pokemon_3_IVs.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_IVs.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_IVs.Enabled = false; + this.CB_Pokemon_3_IVs.FormattingEnabled = true; + this.CB_Pokemon_3_IVs.Location = new System.Drawing.Point(429, 6); + this.CB_Pokemon_3_IVs.Name = "CB_Pokemon_3_IVs"; + this.CB_Pokemon_3_IVs.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_IVs.TabIndex = 37; + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(199, 90); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(46, 13); + this.label22.TabIndex = 34; + this.label22.Text = "Move 4:"; + // + // CB_Pokemon_3_Move_4 + // + this.CB_Pokemon_3_Move_4.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Move_4.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Move_4.Enabled = false; + this.CB_Pokemon_3_Move_4.FormattingEnabled = true; + this.CB_Pokemon_3_Move_4.Location = new System.Drawing.Point(251, 87); + this.CB_Pokemon_3_Move_4.Name = "CB_Pokemon_3_Move_4"; + this.CB_Pokemon_3_Move_4.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Move_4.TabIndex = 33; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(199, 63); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(46, 13); + this.label23.TabIndex = 32; + this.label23.Text = "Move 3:"; + // + // CB_Pokemon_3_Move_3 + // + this.CB_Pokemon_3_Move_3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Move_3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Move_3.Enabled = false; + this.CB_Pokemon_3_Move_3.FormattingEnabled = true; + this.CB_Pokemon_3_Move_3.Location = new System.Drawing.Point(251, 60); + this.CB_Pokemon_3_Move_3.Name = "CB_Pokemon_3_Move_3"; + this.CB_Pokemon_3_Move_3.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Move_3.TabIndex = 31; + // + // label24 + // + this.label24.AutoSize = true; + this.label24.Location = new System.Drawing.Point(199, 36); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(46, 13); + this.label24.TabIndex = 30; + this.label24.Text = "Move 2:"; + // + // CB_Pokemon_3_Move_2 + // + this.CB_Pokemon_3_Move_2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Move_2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Move_2.Enabled = false; + this.CB_Pokemon_3_Move_2.FormattingEnabled = true; + this.CB_Pokemon_3_Move_2.Location = new System.Drawing.Point(251, 33); + this.CB_Pokemon_3_Move_2.Name = "CB_Pokemon_3_Move_2"; + this.CB_Pokemon_3_Move_2.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Move_2.TabIndex = 29; + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(199, 9); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(46, 13); + this.label25.TabIndex = 28; + this.label25.Text = "Move 1:"; + // + // CB_Pokemon_3_Move_1 + // + this.CB_Pokemon_3_Move_1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Move_1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Move_1.Enabled = false; + this.CB_Pokemon_3_Move_1.FormattingEnabled = true; + this.CB_Pokemon_3_Move_1.Location = new System.Drawing.Point(251, 6); + this.CB_Pokemon_3_Move_1.Name = "CB_Pokemon_3_Move_1"; + this.CB_Pokemon_3_Move_1.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Move_1.TabIndex = 27; + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(36, 90); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(30, 13); + this.label26.TabIndex = 26; + this.label26.Text = "Item:"; + // + // CB_Pokemon_3_Item + // + this.CB_Pokemon_3_Item.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Item.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Item.Enabled = false; + this.CB_Pokemon_3_Item.FormattingEnabled = true; + this.CB_Pokemon_3_Item.Location = new System.Drawing.Point(72, 87); + this.CB_Pokemon_3_Item.Name = "CB_Pokemon_3_Item"; + this.CB_Pokemon_3_Item.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Item.TabIndex = 25; + // + // label27 + // + this.label27.AutoSize = true; + this.label27.Location = new System.Drawing.Point(30, 63); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(36, 13); + this.label27.TabIndex = 24; + this.label27.Text = "Level:"; + // + // CB_Pokemon_3_Level + // + this.CB_Pokemon_3_Level.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Level.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Level.Enabled = false; + this.CB_Pokemon_3_Level.FormattingEnabled = true; + this.CB_Pokemon_3_Level.Location = new System.Drawing.Point(72, 60); + this.CB_Pokemon_3_Level.Name = "CB_Pokemon_3_Level"; + this.CB_Pokemon_3_Level.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Level.TabIndex = 23; + // + // label28 + // + this.label28.AutoSize = true; + this.label28.Location = new System.Drawing.Point(11, 9); + this.label28.Name = "label28"; + this.label28.Size = new System.Drawing.Size(55, 13); + this.label28.TabIndex = 22; + this.label28.Text = "Pokemon:"; + // + // CB_Pokemon_3_Pokemon + // + this.CB_Pokemon_3_Pokemon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_3_Pokemon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_3_Pokemon.Enabled = false; + this.CB_Pokemon_3_Pokemon.FormattingEnabled = true; + this.CB_Pokemon_3_Pokemon.Location = new System.Drawing.Point(72, 6); + this.CB_Pokemon_3_Pokemon.Name = "CB_Pokemon_3_Pokemon"; + this.CB_Pokemon_3_Pokemon.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_3_Pokemon.TabIndex = 21; + this.CB_Pokemon_3_Pokemon.SelectedIndexChanged += new System.EventHandler(this.refreshSpeciesAbility); + // + // tabPage5 + // + this.tabPage5.BackColor = System.Drawing.SystemColors.Control; + this.tabPage5.Controls.Add(this.label75); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Gender); + this.tabPage5.Controls.Add(this.label76); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Ability); + this.tabPage5.Controls.Add(this.label57); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Form); + this.tabPage5.Controls.Add(this.label12); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_IVs); + this.tabPage5.Controls.Add(this.label31); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Move_4); + this.tabPage5.Controls.Add(this.label32); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Move_3); + this.tabPage5.Controls.Add(this.label33); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Move_2); + this.tabPage5.Controls.Add(this.label34); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Move_1); + this.tabPage5.Controls.Add(this.label35); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Item); + this.tabPage5.Controls.Add(this.label36); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Level); + this.tabPage5.Controls.Add(this.label37); + this.tabPage5.Controls.Add(this.CB_Pokemon_4_Pokemon); + this.tabPage5.Location = new System.Drawing.Point(4, 22); + this.tabPage5.Name = "tabPage5"; + this.tabPage5.Padding = new System.Windows.Forms.Padding(3); + this.tabPage5.Size = new System.Drawing.Size(557, 127); + this.tabPage5.TabIndex = 4; + this.tabPage5.Text = "Pokemon 4"; + // + // label75 + // + this.label75.AutoSize = true; + this.label75.Location = new System.Drawing.Point(378, 63); + this.label75.Name = "label75"; + this.label75.Size = new System.Drawing.Size(45, 13); + this.label75.TabIndex = 65; + this.label75.Text = "Gender:"; + // + // CB_Pokemon_4_Gender + // + this.CB_Pokemon_4_Gender.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Gender.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Gender.Enabled = false; + this.CB_Pokemon_4_Gender.FormattingEnabled = true; + this.CB_Pokemon_4_Gender.Location = new System.Drawing.Point(429, 60); + this.CB_Pokemon_4_Gender.Name = "CB_Pokemon_4_Gender"; + this.CB_Pokemon_4_Gender.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Gender.TabIndex = 64; + // + // label76 + // + this.label76.AutoSize = true; + this.label76.Location = new System.Drawing.Point(386, 36); + this.label76.Name = "label76"; + this.label76.Size = new System.Drawing.Size(37, 13); + this.label76.TabIndex = 63; + this.label76.Text = "Ability:"; + // + // CB_Pokemon_4_Ability + // + this.CB_Pokemon_4_Ability.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Ability.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Ability.Enabled = false; + this.CB_Pokemon_4_Ability.FormattingEnabled = true; + this.CB_Pokemon_4_Ability.Location = new System.Drawing.Point(429, 33); + this.CB_Pokemon_4_Ability.Name = "CB_Pokemon_4_Ability"; + this.CB_Pokemon_4_Ability.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Ability.TabIndex = 62; + // + // label57 + // + this.label57.AutoSize = true; + this.label57.Location = new System.Drawing.Point(33, 36); + this.label57.Name = "label57"; + this.label57.Size = new System.Drawing.Size(33, 13); + this.label57.TabIndex = 59; + this.label57.Text = "Form:"; + // + // CB_Pokemon_4_Form + // + this.CB_Pokemon_4_Form.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Form.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Form.Enabled = false; + this.CB_Pokemon_4_Form.FormattingEnabled = true; + this.CB_Pokemon_4_Form.Location = new System.Drawing.Point(72, 33); + this.CB_Pokemon_4_Form.Name = "CB_Pokemon_4_Form"; + this.CB_Pokemon_4_Form.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Form.TabIndex = 58; + this.CB_Pokemon_4_Form.SelectedIndexChanged += new System.EventHandler(this.refreshFormAbility); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(398, 9); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(25, 13); + this.label12.TabIndex = 38; + this.label12.Text = "IVs:"; + // + // CB_Pokemon_4_IVs + // + this.CB_Pokemon_4_IVs.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_IVs.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_IVs.Enabled = false; + this.CB_Pokemon_4_IVs.FormattingEnabled = true; + this.CB_Pokemon_4_IVs.Location = new System.Drawing.Point(429, 6); + this.CB_Pokemon_4_IVs.Name = "CB_Pokemon_4_IVs"; + this.CB_Pokemon_4_IVs.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_IVs.TabIndex = 37; + // + // label31 + // + this.label31.AutoSize = true; + this.label31.Location = new System.Drawing.Point(199, 90); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(46, 13); + this.label31.TabIndex = 34; + this.label31.Text = "Move 4:"; + // + // CB_Pokemon_4_Move_4 + // + this.CB_Pokemon_4_Move_4.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Move_4.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Move_4.Enabled = false; + this.CB_Pokemon_4_Move_4.FormattingEnabled = true; + this.CB_Pokemon_4_Move_4.Location = new System.Drawing.Point(251, 87); + this.CB_Pokemon_4_Move_4.Name = "CB_Pokemon_4_Move_4"; + this.CB_Pokemon_4_Move_4.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Move_4.TabIndex = 33; + // + // label32 + // + this.label32.AutoSize = true; + this.label32.Location = new System.Drawing.Point(199, 63); + this.label32.Name = "label32"; + this.label32.Size = new System.Drawing.Size(46, 13); + this.label32.TabIndex = 32; + this.label32.Text = "Move 3:"; + // + // CB_Pokemon_4_Move_3 + // + this.CB_Pokemon_4_Move_3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Move_3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Move_3.Enabled = false; + this.CB_Pokemon_4_Move_3.FormattingEnabled = true; + this.CB_Pokemon_4_Move_3.Location = new System.Drawing.Point(251, 60); + this.CB_Pokemon_4_Move_3.Name = "CB_Pokemon_4_Move_3"; + this.CB_Pokemon_4_Move_3.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Move_3.TabIndex = 31; + // + // label33 + // + this.label33.AutoSize = true; + this.label33.Location = new System.Drawing.Point(199, 36); + this.label33.Name = "label33"; + this.label33.Size = new System.Drawing.Size(46, 13); + this.label33.TabIndex = 30; + this.label33.Text = "Move 2:"; + // + // CB_Pokemon_4_Move_2 + // + this.CB_Pokemon_4_Move_2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Move_2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Move_2.Enabled = false; + this.CB_Pokemon_4_Move_2.FormattingEnabled = true; + this.CB_Pokemon_4_Move_2.Location = new System.Drawing.Point(251, 33); + this.CB_Pokemon_4_Move_2.Name = "CB_Pokemon_4_Move_2"; + this.CB_Pokemon_4_Move_2.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Move_2.TabIndex = 29; + // + // label34 + // + this.label34.AutoSize = true; + this.label34.Location = new System.Drawing.Point(199, 9); + this.label34.Name = "label34"; + this.label34.Size = new System.Drawing.Size(46, 13); + this.label34.TabIndex = 28; + this.label34.Text = "Move 1:"; + // + // CB_Pokemon_4_Move_1 + // + this.CB_Pokemon_4_Move_1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Move_1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Move_1.Enabled = false; + this.CB_Pokemon_4_Move_1.FormattingEnabled = true; + this.CB_Pokemon_4_Move_1.Location = new System.Drawing.Point(251, 6); + this.CB_Pokemon_4_Move_1.Name = "CB_Pokemon_4_Move_1"; + this.CB_Pokemon_4_Move_1.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Move_1.TabIndex = 27; + // + // label35 + // + this.label35.AutoSize = true; + this.label35.Location = new System.Drawing.Point(36, 90); + this.label35.Name = "label35"; + this.label35.Size = new System.Drawing.Size(30, 13); + this.label35.TabIndex = 26; + this.label35.Text = "Item:"; + // + // CB_Pokemon_4_Item + // + this.CB_Pokemon_4_Item.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Item.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Item.Enabled = false; + this.CB_Pokemon_4_Item.FormattingEnabled = true; + this.CB_Pokemon_4_Item.Location = new System.Drawing.Point(72, 87); + this.CB_Pokemon_4_Item.Name = "CB_Pokemon_4_Item"; + this.CB_Pokemon_4_Item.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Item.TabIndex = 25; + // + // label36 + // + this.label36.AutoSize = true; + this.label36.Location = new System.Drawing.Point(30, 63); + this.label36.Name = "label36"; + this.label36.Size = new System.Drawing.Size(36, 13); + this.label36.TabIndex = 24; + this.label36.Text = "Level:"; + // + // CB_Pokemon_4_Level + // + this.CB_Pokemon_4_Level.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Level.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Level.Enabled = false; + this.CB_Pokemon_4_Level.FormattingEnabled = true; + this.CB_Pokemon_4_Level.Location = new System.Drawing.Point(72, 60); + this.CB_Pokemon_4_Level.Name = "CB_Pokemon_4_Level"; + this.CB_Pokemon_4_Level.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Level.TabIndex = 23; + // + // label37 + // + this.label37.AutoSize = true; + this.label37.Location = new System.Drawing.Point(11, 9); + this.label37.Name = "label37"; + this.label37.Size = new System.Drawing.Size(55, 13); + this.label37.TabIndex = 22; + this.label37.Text = "Pokemon:"; + // + // CB_Pokemon_4_Pokemon + // + this.CB_Pokemon_4_Pokemon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_4_Pokemon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_4_Pokemon.Enabled = false; + this.CB_Pokemon_4_Pokemon.FormattingEnabled = true; + this.CB_Pokemon_4_Pokemon.Location = new System.Drawing.Point(72, 6); + this.CB_Pokemon_4_Pokemon.Name = "CB_Pokemon_4_Pokemon"; + this.CB_Pokemon_4_Pokemon.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_4_Pokemon.TabIndex = 21; + this.CB_Pokemon_4_Pokemon.SelectedIndexChanged += new System.EventHandler(this.refreshSpeciesAbility); + // + // tabPage6 + // + this.tabPage6.BackColor = System.Drawing.SystemColors.Control; + this.tabPage6.Controls.Add(this.label78); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Gender); + this.tabPage6.Controls.Add(this.label79); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Ability); + this.tabPage6.Controls.Add(this.label62); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Form); + this.tabPage6.Controls.Add(this.label20); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_IVs); + this.tabPage6.Controls.Add(this.label40); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Move_4); + this.tabPage6.Controls.Add(this.label41); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Move_3); + this.tabPage6.Controls.Add(this.label42); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Move_2); + this.tabPage6.Controls.Add(this.label43); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Move_1); + this.tabPage6.Controls.Add(this.label44); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Item); + this.tabPage6.Controls.Add(this.label45); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Level); + this.tabPage6.Controls.Add(this.label46); + this.tabPage6.Controls.Add(this.CB_Pokemon_5_Pokemon); + this.tabPage6.Location = new System.Drawing.Point(4, 22); + this.tabPage6.Name = "tabPage6"; + this.tabPage6.Padding = new System.Windows.Forms.Padding(3); + this.tabPage6.Size = new System.Drawing.Size(557, 127); + this.tabPage6.TabIndex = 5; + this.tabPage6.Text = "Pokemon 5"; + // + // label78 + // + this.label78.AutoSize = true; + this.label78.Location = new System.Drawing.Point(378, 63); + this.label78.Name = "label78"; + this.label78.Size = new System.Drawing.Size(45, 13); + this.label78.TabIndex = 65; + this.label78.Text = "Gender:"; + // + // CB_Pokemon_5_Gender + // + this.CB_Pokemon_5_Gender.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Gender.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Gender.Enabled = false; + this.CB_Pokemon_5_Gender.FormattingEnabled = true; + this.CB_Pokemon_5_Gender.Location = new System.Drawing.Point(429, 60); + this.CB_Pokemon_5_Gender.Name = "CB_Pokemon_5_Gender"; + this.CB_Pokemon_5_Gender.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Gender.TabIndex = 64; + // + // label79 + // + this.label79.AutoSize = true; + this.label79.Location = new System.Drawing.Point(386, 36); + this.label79.Name = "label79"; + this.label79.Size = new System.Drawing.Size(37, 13); + this.label79.TabIndex = 63; + this.label79.Text = "Ability:"; + // + // CB_Pokemon_5_Ability + // + this.CB_Pokemon_5_Ability.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Ability.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Ability.Enabled = false; + this.CB_Pokemon_5_Ability.FormattingEnabled = true; + this.CB_Pokemon_5_Ability.Location = new System.Drawing.Point(429, 33); + this.CB_Pokemon_5_Ability.Name = "CB_Pokemon_5_Ability"; + this.CB_Pokemon_5_Ability.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Ability.TabIndex = 62; + // + // label62 + // + this.label62.AutoSize = true; + this.label62.Location = new System.Drawing.Point(33, 36); + this.label62.Name = "label62"; + this.label62.Size = new System.Drawing.Size(33, 13); + this.label62.TabIndex = 59; + this.label62.Text = "Form:"; + // + // CB_Pokemon_5_Form + // + this.CB_Pokemon_5_Form.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Form.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Form.Enabled = false; + this.CB_Pokemon_5_Form.FormattingEnabled = true; + this.CB_Pokemon_5_Form.Location = new System.Drawing.Point(72, 33); + this.CB_Pokemon_5_Form.Name = "CB_Pokemon_5_Form"; + this.CB_Pokemon_5_Form.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Form.TabIndex = 58; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(398, 9); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(25, 13); + this.label20.TabIndex = 38; + this.label20.Text = "IVs:"; + // + // CB_Pokemon_5_IVs + // + this.CB_Pokemon_5_IVs.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_IVs.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_IVs.Enabled = false; + this.CB_Pokemon_5_IVs.FormattingEnabled = true; + this.CB_Pokemon_5_IVs.Location = new System.Drawing.Point(429, 6); + this.CB_Pokemon_5_IVs.Name = "CB_Pokemon_5_IVs"; + this.CB_Pokemon_5_IVs.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_IVs.TabIndex = 37; + // + // label40 + // + this.label40.AutoSize = true; + this.label40.Location = new System.Drawing.Point(199, 90); + this.label40.Name = "label40"; + this.label40.Size = new System.Drawing.Size(46, 13); + this.label40.TabIndex = 34; + this.label40.Text = "Move 4:"; + // + // CB_Pokemon_5_Move_4 + // + this.CB_Pokemon_5_Move_4.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Move_4.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Move_4.Enabled = false; + this.CB_Pokemon_5_Move_4.FormattingEnabled = true; + this.CB_Pokemon_5_Move_4.Location = new System.Drawing.Point(251, 87); + this.CB_Pokemon_5_Move_4.Name = "CB_Pokemon_5_Move_4"; + this.CB_Pokemon_5_Move_4.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Move_4.TabIndex = 33; + // + // label41 + // + this.label41.AutoSize = true; + this.label41.Location = new System.Drawing.Point(199, 63); + this.label41.Name = "label41"; + this.label41.Size = new System.Drawing.Size(46, 13); + this.label41.TabIndex = 32; + this.label41.Text = "Move 3:"; + // + // CB_Pokemon_5_Move_3 + // + this.CB_Pokemon_5_Move_3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Move_3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Move_3.Enabled = false; + this.CB_Pokemon_5_Move_3.FormattingEnabled = true; + this.CB_Pokemon_5_Move_3.Location = new System.Drawing.Point(251, 60); + this.CB_Pokemon_5_Move_3.Name = "CB_Pokemon_5_Move_3"; + this.CB_Pokemon_5_Move_3.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Move_3.TabIndex = 31; + // + // label42 + // + this.label42.AutoSize = true; + this.label42.Location = new System.Drawing.Point(199, 36); + this.label42.Name = "label42"; + this.label42.Size = new System.Drawing.Size(46, 13); + this.label42.TabIndex = 30; + this.label42.Text = "Move 2:"; + // + // CB_Pokemon_5_Move_2 + // + this.CB_Pokemon_5_Move_2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Move_2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Move_2.Enabled = false; + this.CB_Pokemon_5_Move_2.FormattingEnabled = true; + this.CB_Pokemon_5_Move_2.Location = new System.Drawing.Point(251, 33); + this.CB_Pokemon_5_Move_2.Name = "CB_Pokemon_5_Move_2"; + this.CB_Pokemon_5_Move_2.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Move_2.TabIndex = 29; + // + // label43 + // + this.label43.AutoSize = true; + this.label43.Location = new System.Drawing.Point(199, 9); + this.label43.Name = "label43"; + this.label43.Size = new System.Drawing.Size(46, 13); + this.label43.TabIndex = 28; + this.label43.Text = "Move 1:"; + // + // CB_Pokemon_5_Move_1 + // + this.CB_Pokemon_5_Move_1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Move_1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Move_1.Enabled = false; + this.CB_Pokemon_5_Move_1.FormattingEnabled = true; + this.CB_Pokemon_5_Move_1.Location = new System.Drawing.Point(251, 6); + this.CB_Pokemon_5_Move_1.Name = "CB_Pokemon_5_Move_1"; + this.CB_Pokemon_5_Move_1.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Move_1.TabIndex = 27; + // + // label44 + // + this.label44.AutoSize = true; + this.label44.Location = new System.Drawing.Point(36, 90); + this.label44.Name = "label44"; + this.label44.Size = new System.Drawing.Size(30, 13); + this.label44.TabIndex = 26; + this.label44.Text = "Item:"; + // + // CB_Pokemon_5_Item + // + this.CB_Pokemon_5_Item.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Item.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Item.Enabled = false; + this.CB_Pokemon_5_Item.FormattingEnabled = true; + this.CB_Pokemon_5_Item.Location = new System.Drawing.Point(72, 87); + this.CB_Pokemon_5_Item.Name = "CB_Pokemon_5_Item"; + this.CB_Pokemon_5_Item.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Item.TabIndex = 25; + // + // label45 + // + this.label45.AutoSize = true; + this.label45.Location = new System.Drawing.Point(30, 63); + this.label45.Name = "label45"; + this.label45.Size = new System.Drawing.Size(36, 13); + this.label45.TabIndex = 24; + this.label45.Text = "Level:"; + // + // CB_Pokemon_5_Level + // + this.CB_Pokemon_5_Level.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Level.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Level.Enabled = false; + this.CB_Pokemon_5_Level.FormattingEnabled = true; + this.CB_Pokemon_5_Level.Location = new System.Drawing.Point(72, 60); + this.CB_Pokemon_5_Level.Name = "CB_Pokemon_5_Level"; + this.CB_Pokemon_5_Level.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Level.TabIndex = 23; + // + // label46 + // + this.label46.AutoSize = true; + this.label46.Location = new System.Drawing.Point(11, 9); + this.label46.Name = "label46"; + this.label46.Size = new System.Drawing.Size(55, 13); + this.label46.TabIndex = 22; + this.label46.Text = "Pokemon:"; + // + // CB_Pokemon_5_Pokemon + // + this.CB_Pokemon_5_Pokemon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_5_Pokemon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_5_Pokemon.Enabled = false; + this.CB_Pokemon_5_Pokemon.FormattingEnabled = true; + this.CB_Pokemon_5_Pokemon.Location = new System.Drawing.Point(72, 6); + this.CB_Pokemon_5_Pokemon.Name = "CB_Pokemon_5_Pokemon"; + this.CB_Pokemon_5_Pokemon.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_5_Pokemon.TabIndex = 21; + this.CB_Pokemon_5_Pokemon.SelectedIndexChanged += new System.EventHandler(this.refreshSpeciesAbility); + // + // tabPage7 + // + this.tabPage7.BackColor = System.Drawing.SystemColors.Control; + this.tabPage7.Controls.Add(this.label81); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Gender); + this.tabPage7.Controls.Add(this.label82); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Ability); + this.tabPage7.Controls.Add(this.label63); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Form); + this.tabPage7.Controls.Add(this.label21); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_IVs); + this.tabPage7.Controls.Add(this.label49); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Move_4); + this.tabPage7.Controls.Add(this.label50); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Move_3); + this.tabPage7.Controls.Add(this.label51); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Move_2); + this.tabPage7.Controls.Add(this.label52); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Move_1); + this.tabPage7.Controls.Add(this.label53); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Item); + this.tabPage7.Controls.Add(this.label54); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Level); + this.tabPage7.Controls.Add(this.label55); + this.tabPage7.Controls.Add(this.CB_Pokemon_6_Pokemon); + this.tabPage7.Location = new System.Drawing.Point(4, 22); + this.tabPage7.Name = "tabPage7"; + this.tabPage7.Padding = new System.Windows.Forms.Padding(3); + this.tabPage7.Size = new System.Drawing.Size(557, 127); + this.tabPage7.TabIndex = 6; + this.tabPage7.Text = "Pokemon 6"; + // + // label81 + // + this.label81.AutoSize = true; + this.label81.Location = new System.Drawing.Point(378, 63); + this.label81.Name = "label81"; + this.label81.Size = new System.Drawing.Size(45, 13); + this.label81.TabIndex = 65; + this.label81.Text = "Gender:"; + // + // CB_Pokemon_6_Gender + // + this.CB_Pokemon_6_Gender.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Gender.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Gender.Enabled = false; + this.CB_Pokemon_6_Gender.FormattingEnabled = true; + this.CB_Pokemon_6_Gender.Location = new System.Drawing.Point(429, 60); + this.CB_Pokemon_6_Gender.Name = "CB_Pokemon_6_Gender"; + this.CB_Pokemon_6_Gender.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Gender.TabIndex = 64; + // + // label82 + // + this.label82.AutoSize = true; + this.label82.Location = new System.Drawing.Point(386, 36); + this.label82.Name = "label82"; + this.label82.Size = new System.Drawing.Size(37, 13); + this.label82.TabIndex = 63; + this.label82.Text = "Ability:"; + // + // CB_Pokemon_6_Ability + // + this.CB_Pokemon_6_Ability.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Ability.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Ability.Enabled = false; + this.CB_Pokemon_6_Ability.FormattingEnabled = true; + this.CB_Pokemon_6_Ability.Location = new System.Drawing.Point(429, 33); + this.CB_Pokemon_6_Ability.Name = "CB_Pokemon_6_Ability"; + this.CB_Pokemon_6_Ability.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Ability.TabIndex = 62; + // + // label63 + // + this.label63.AutoSize = true; + this.label63.Location = new System.Drawing.Point(33, 36); + this.label63.Name = "label63"; + this.label63.Size = new System.Drawing.Size(33, 13); + this.label63.TabIndex = 59; + this.label63.Text = "Form:"; + // + // CB_Pokemon_6_Form + // + this.CB_Pokemon_6_Form.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Form.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Form.Enabled = false; + this.CB_Pokemon_6_Form.FormattingEnabled = true; + this.CB_Pokemon_6_Form.Location = new System.Drawing.Point(72, 33); + this.CB_Pokemon_6_Form.Name = "CB_Pokemon_6_Form"; + this.CB_Pokemon_6_Form.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Form.TabIndex = 58; + this.CB_Pokemon_6_Form.SelectedIndexChanged += new System.EventHandler(this.refreshFormAbility); + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(398, 9); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(25, 13); + this.label21.TabIndex = 38; + this.label21.Text = "IVs:"; + // + // CB_Pokemon_6_IVs + // + this.CB_Pokemon_6_IVs.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_IVs.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_IVs.Enabled = false; + this.CB_Pokemon_6_IVs.FormattingEnabled = true; + this.CB_Pokemon_6_IVs.Location = new System.Drawing.Point(429, 6); + this.CB_Pokemon_6_IVs.Name = "CB_Pokemon_6_IVs"; + this.CB_Pokemon_6_IVs.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_IVs.TabIndex = 37; + // + // label49 + // + this.label49.AutoSize = true; + this.label49.Location = new System.Drawing.Point(199, 90); + this.label49.Name = "label49"; + this.label49.Size = new System.Drawing.Size(46, 13); + this.label49.TabIndex = 34; + this.label49.Text = "Move 4:"; + // + // CB_Pokemon_6_Move_4 + // + this.CB_Pokemon_6_Move_4.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Move_4.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Move_4.Enabled = false; + this.CB_Pokemon_6_Move_4.FormattingEnabled = true; + this.CB_Pokemon_6_Move_4.Location = new System.Drawing.Point(251, 87); + this.CB_Pokemon_6_Move_4.Name = "CB_Pokemon_6_Move_4"; + this.CB_Pokemon_6_Move_4.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Move_4.TabIndex = 33; + // + // label50 + // + this.label50.AutoSize = true; + this.label50.Location = new System.Drawing.Point(199, 63); + this.label50.Name = "label50"; + this.label50.Size = new System.Drawing.Size(46, 13); + this.label50.TabIndex = 32; + this.label50.Text = "Move 3:"; + // + // CB_Pokemon_6_Move_3 + // + this.CB_Pokemon_6_Move_3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Move_3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Move_3.Enabled = false; + this.CB_Pokemon_6_Move_3.FormattingEnabled = true; + this.CB_Pokemon_6_Move_3.Location = new System.Drawing.Point(251, 60); + this.CB_Pokemon_6_Move_3.Name = "CB_Pokemon_6_Move_3"; + this.CB_Pokemon_6_Move_3.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Move_3.TabIndex = 31; + // + // label51 + // + this.label51.AutoSize = true; + this.label51.Location = new System.Drawing.Point(199, 36); + this.label51.Name = "label51"; + this.label51.Size = new System.Drawing.Size(46, 13); + this.label51.TabIndex = 30; + this.label51.Text = "Move 2:"; + // + // CB_Pokemon_6_Move_2 + // + this.CB_Pokemon_6_Move_2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Move_2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Move_2.Enabled = false; + this.CB_Pokemon_6_Move_2.FormattingEnabled = true; + this.CB_Pokemon_6_Move_2.Location = new System.Drawing.Point(251, 33); + this.CB_Pokemon_6_Move_2.Name = "CB_Pokemon_6_Move_2"; + this.CB_Pokemon_6_Move_2.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Move_2.TabIndex = 29; + // + // label52 + // + this.label52.AutoSize = true; + this.label52.Location = new System.Drawing.Point(199, 9); + this.label52.Name = "label52"; + this.label52.Size = new System.Drawing.Size(46, 13); + this.label52.TabIndex = 28; + this.label52.Text = "Move 1:"; + // + // CB_Pokemon_6_Move_1 + // + this.CB_Pokemon_6_Move_1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Move_1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Move_1.Enabled = false; + this.CB_Pokemon_6_Move_1.FormattingEnabled = true; + this.CB_Pokemon_6_Move_1.Location = new System.Drawing.Point(251, 6); + this.CB_Pokemon_6_Move_1.Name = "CB_Pokemon_6_Move_1"; + this.CB_Pokemon_6_Move_1.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Move_1.TabIndex = 27; + // + // label53 + // + this.label53.AutoSize = true; + this.label53.Location = new System.Drawing.Point(36, 90); + this.label53.Name = "label53"; + this.label53.Size = new System.Drawing.Size(30, 13); + this.label53.TabIndex = 26; + this.label53.Text = "Item:"; + // + // CB_Pokemon_6_Item + // + this.CB_Pokemon_6_Item.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Item.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Item.Enabled = false; + this.CB_Pokemon_6_Item.FormattingEnabled = true; + this.CB_Pokemon_6_Item.Location = new System.Drawing.Point(72, 87); + this.CB_Pokemon_6_Item.Name = "CB_Pokemon_6_Item"; + this.CB_Pokemon_6_Item.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Item.TabIndex = 25; + // + // label54 + // + this.label54.AutoSize = true; + this.label54.Location = new System.Drawing.Point(30, 63); + this.label54.Name = "label54"; + this.label54.Size = new System.Drawing.Size(36, 13); + this.label54.TabIndex = 24; + this.label54.Text = "Level:"; + // + // CB_Pokemon_6_Level + // + this.CB_Pokemon_6_Level.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Level.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Level.Enabled = false; + this.CB_Pokemon_6_Level.FormattingEnabled = true; + this.CB_Pokemon_6_Level.Location = new System.Drawing.Point(72, 60); + this.CB_Pokemon_6_Level.Name = "CB_Pokemon_6_Level"; + this.CB_Pokemon_6_Level.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Level.TabIndex = 23; + // + // label55 + // + this.label55.AutoSize = true; + this.label55.Location = new System.Drawing.Point(11, 9); + this.label55.Name = "label55"; + this.label55.Size = new System.Drawing.Size(55, 13); + this.label55.TabIndex = 22; + this.label55.Text = "Pokemon:"; + // + // CB_Pokemon_6_Pokemon + // + this.CB_Pokemon_6_Pokemon.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.CB_Pokemon_6_Pokemon.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.CB_Pokemon_6_Pokemon.Enabled = false; + this.CB_Pokemon_6_Pokemon.FormattingEnabled = true; + this.CB_Pokemon_6_Pokemon.Location = new System.Drawing.Point(72, 6); + this.CB_Pokemon_6_Pokemon.Name = "CB_Pokemon_6_Pokemon"; + this.CB_Pokemon_6_Pokemon.Size = new System.Drawing.Size(121, 21); + this.CB_Pokemon_6_Pokemon.TabIndex = 21; + this.CB_Pokemon_6_Pokemon.SelectedIndexChanged += new System.EventHandler(this.refreshSpeciesAbility); + // + // B_Randomize + // + this.B_Randomize.Location = new System.Drawing.Point(384, 4); + this.B_Randomize.Name = "B_Randomize"; + this.B_Randomize.Size = new System.Drawing.Size(93, 23); + this.B_Randomize.TabIndex = 68; + this.B_Randomize.Text = "Randomize All"; + this.B_Randomize.UseVisualStyleBackColor = true; + this.B_Randomize.Click += new System.EventHandler(this.B_Randomize_Click); + // + // RSTE + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(584, 192); + this.Controls.Add(this.B_Randomize); + this.Controls.Add(this.B_Dump); + this.Controls.Add(this.label1); + this.Controls.Add(this.CB_TrainerID); + this.Controls.Add(this.tabControl1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "RSTE"; + this.Text = "Trainer Editor"; + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage1.PerformLayout(); + this.tabPage2.ResumeLayout(false); + this.tabPage2.PerformLayout(); + this.tabPage3.ResumeLayout(false); + this.tabPage3.PerformLayout(); + this.tabPage4.ResumeLayout(false); + this.tabPage4.PerformLayout(); + this.tabPage5.ResumeLayout(false); + this.tabPage5.PerformLayout(); + this.tabPage6.ResumeLayout(false); + this.tabPage6.PerformLayout(); + this.tabPage7.ResumeLayout(false); + this.tabPage7.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button B_Dump; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox CB_TrainerID; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.CheckBox checkBox_Healer; + private System.Windows.Forms.Label label83; + private System.Windows.Forms.ComboBox CB_Prize; + private System.Windows.Forms.Label label39; + private System.Windows.Forms.ComboBox CB_AI; + private System.Windows.Forms.Label label38; + private System.Windows.Forms.ComboBox CB_Money; + private System.Windows.Forms.Label label30; + private System.Windows.Forms.ComboBox CB_Battle_Type; + private System.Windows.Forms.Label label29; + private System.Windows.Forms.ComboBox CB_Trainer_Class; + private System.Windows.Forms.CheckBox checkBox_Moves; + private System.Windows.Forms.CheckBox checkBox_Item; + private System.Windows.Forms.Label label58; + private System.Windows.Forms.ComboBox CB_Item_4; + private System.Windows.Forms.Label label59; + private System.Windows.Forms.ComboBox CB_Item_3; + private System.Windows.Forms.Label label60; + private System.Windows.Forms.ComboBox CB_Item_2; + private System.Windows.Forms.Label label61; + private System.Windows.Forms.ComboBox CB_Item_1; + private System.Windows.Forms.Label label64; + private System.Windows.Forms.ComboBox CB_numPokemon; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.Label label67; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Ability; + private System.Windows.Forms.Label label65; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Gender; + private System.Windows.Forms.Label label47; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Form; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.ComboBox CB_Pokemon_1_IVs; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Move_4; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Move_3; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Move_2; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Move_1; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Item; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Level; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox CB_Pokemon_1_Pokemon; + private System.Windows.Forms.TabPage tabPage3; + private System.Windows.Forms.Label label69; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Gender; + private System.Windows.Forms.Label label70; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Ability; + private System.Windows.Forms.Label label48; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Form; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.ComboBox CB_Pokemon_2_IVs; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Move_4; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Move_3; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Move_2; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Move_1; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Item; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Level; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.ComboBox CB_Pokemon_2_Pokemon; + private System.Windows.Forms.TabPage tabPage4; + private System.Windows.Forms.Label label72; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Gender; + private System.Windows.Forms.Label label73; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Ability; + private System.Windows.Forms.Label label56; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Form; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.ComboBox CB_Pokemon_3_IVs; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Move_4; + private System.Windows.Forms.Label label23; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Move_3; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Move_2; + private System.Windows.Forms.Label label25; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Move_1; + private System.Windows.Forms.Label label26; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Item; + private System.Windows.Forms.Label label27; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Level; + private System.Windows.Forms.Label label28; + private System.Windows.Forms.ComboBox CB_Pokemon_3_Pokemon; + private System.Windows.Forms.TabPage tabPage5; + private System.Windows.Forms.Label label75; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Gender; + private System.Windows.Forms.Label label76; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Ability; + private System.Windows.Forms.Label label57; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Form; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.ComboBox CB_Pokemon_4_IVs; + private System.Windows.Forms.Label label31; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Move_4; + private System.Windows.Forms.Label label32; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Move_3; + private System.Windows.Forms.Label label33; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Move_2; + private System.Windows.Forms.Label label34; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Move_1; + private System.Windows.Forms.Label label35; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Item; + private System.Windows.Forms.Label label36; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Level; + private System.Windows.Forms.Label label37; + private System.Windows.Forms.ComboBox CB_Pokemon_4_Pokemon; + private System.Windows.Forms.TabPage tabPage6; + private System.Windows.Forms.Label label78; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Gender; + private System.Windows.Forms.Label label79; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Ability; + private System.Windows.Forms.Label label62; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Form; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.ComboBox CB_Pokemon_5_IVs; + private System.Windows.Forms.Label label40; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Move_4; + private System.Windows.Forms.Label label41; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Move_3; + private System.Windows.Forms.Label label42; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Move_2; + private System.Windows.Forms.Label label43; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Move_1; + private System.Windows.Forms.Label label44; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Item; + private System.Windows.Forms.Label label45; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Level; + private System.Windows.Forms.Label label46; + private System.Windows.Forms.ComboBox CB_Pokemon_5_Pokemon; + private System.Windows.Forms.TabPage tabPage7; + private System.Windows.Forms.Label label81; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Gender; + private System.Windows.Forms.Label label82; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Ability; + private System.Windows.Forms.Label label63; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Form; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.ComboBox CB_Pokemon_6_IVs; + private System.Windows.Forms.Label label49; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Move_4; + private System.Windows.Forms.Label label50; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Move_3; + private System.Windows.Forms.Label label51; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Move_2; + private System.Windows.Forms.Label label52; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Move_1; + private System.Windows.Forms.Label label53; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Item; + private System.Windows.Forms.Label label54; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Level; + private System.Windows.Forms.Label label55; + private System.Windows.Forms.ComboBox CB_Pokemon_6_Pokemon; + private System.Windows.Forms.Button B_Randomize; + } +} diff --git a/pk3DS/RSTE.cs b/pk3DS/RSTE.cs new file mode 100644 index 0000000..f68c33c --- /dev/null +++ b/pk3DS/RSTE.cs @@ -0,0 +1,988 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace pk3DS +{ + public partial class RSTE : Form + { + public RSTE(bool rom_oras, string[] trdata, string[] trpoke) + { + oras = rom_oras; + trdatapaths = trdata; + trpokepaths = trpoke; + abilitylist = Main.getText((oras) ? 37 : 34); + movelist = Main.getText((oras) ? 14 : 13); + itemlist = Main.getText((oras) ? 114 : 96); + specieslist = Main.getText((oras) ? 98 : 80); + types = Main.getText((oras) ? 18 : 17); + forms = Main.getText((oras) ? 5 : 5); + trName = Main.getText((oras) ? 22 : 21); + trClass = Main.getText((oras) ? 21 : 20); + InitializeComponent(); + // String Fetching + #region Combo Box Arrays + trpk_pkm = new ComboBox[] + { + CB_Pokemon_1_Pokemon, + CB_Pokemon_2_Pokemon, + CB_Pokemon_3_Pokemon, + CB_Pokemon_4_Pokemon, + CB_Pokemon_5_Pokemon, + CB_Pokemon_6_Pokemon, + }; + trpk_lvl = new ComboBox[] + { + CB_Pokemon_1_Level, + CB_Pokemon_2_Level, + CB_Pokemon_3_Level, + CB_Pokemon_4_Level, + CB_Pokemon_5_Level, + CB_Pokemon_6_Level, + }; + trpk_item = new ComboBox[] + { + CB_Pokemon_1_Item, + CB_Pokemon_2_Item, + CB_Pokemon_3_Item, + CB_Pokemon_4_Item, + CB_Pokemon_5_Item, + CB_Pokemon_6_Item, + }; + trpk_abil = new ComboBox[] + { + CB_Pokemon_1_Ability, + CB_Pokemon_2_Ability, + CB_Pokemon_3_Ability, + CB_Pokemon_4_Ability, + CB_Pokemon_5_Ability, + CB_Pokemon_6_Ability, + }; + trpk_m1 = new ComboBox[] + { + CB_Pokemon_1_Move_1, + CB_Pokemon_2_Move_1, + CB_Pokemon_3_Move_1, + CB_Pokemon_4_Move_1, + CB_Pokemon_5_Move_1, + CB_Pokemon_6_Move_1, + }; + trpk_m2 = new ComboBox[] + { + CB_Pokemon_1_Move_2, + CB_Pokemon_2_Move_2, + CB_Pokemon_3_Move_2, + CB_Pokemon_4_Move_2, + CB_Pokemon_5_Move_2, + CB_Pokemon_6_Move_2, + }; + trpk_m3 = new ComboBox[] + { + CB_Pokemon_1_Move_3, + CB_Pokemon_2_Move_3, + CB_Pokemon_3_Move_3, + CB_Pokemon_4_Move_3, + CB_Pokemon_5_Move_3, + CB_Pokemon_6_Move_3, + }; + trpk_m4 = new ComboBox[] + { + CB_Pokemon_1_Move_4, + CB_Pokemon_2_Move_4, + CB_Pokemon_3_Move_4, + CB_Pokemon_4_Move_4, + CB_Pokemon_5_Move_4, + CB_Pokemon_6_Move_4, + }; + trpk_IV = new ComboBox[] + { + CB_Pokemon_1_IVs, + CB_Pokemon_2_IVs, + CB_Pokemon_3_IVs, + CB_Pokemon_4_IVs, + CB_Pokemon_5_IVs, + CB_Pokemon_6_IVs, + }; + trpk_form = new ComboBox[] + { + CB_Pokemon_1_Form, + CB_Pokemon_2_Form, + CB_Pokemon_3_Form, + CB_Pokemon_4_Form, + CB_Pokemon_5_Form, + CB_Pokemon_6_Form, + }; + trpk_gender = new ComboBox[] + { + CB_Pokemon_1_Gender, + CB_Pokemon_2_Gender, + CB_Pokemon_3_Gender, + CB_Pokemon_4_Gender, + CB_Pokemon_5_Gender, + CB_Pokemon_6_Gender, + }; + #endregion + Setup(); + } + internal static Random rand = new Random(); + internal static uint rnd32() + { + return (uint)(rand.Next(1 << 30)) << 2 | (uint)(rand.Next(1 << 2)); + } + bool oras = false; + bool start = true; + bool loading = true; + byte[][] personal; + int index = -1; + #region Global Variables + private ComboBox[] trpk_pkm; + private ComboBox[] trpk_lvl; + private ComboBox[] trpk_item; + private ComboBox[] trpk_abil; + private ComboBox[] trpk_m1; + private ComboBox[] trpk_m2; + private ComboBox[] trpk_m3; + private ComboBox[] trpk_m4; + private ComboBox[] trpk_IV; + private ComboBox[] trpk_form; + private ComboBox[] trpk_gender; + private string[] abilitylist, movelist, itemlist, specieslist, types, forms; + private string[] trName, trClass; + #endregion + + // Form Loading + public void setForms(int species, ComboBox cb) + { + // Form Tables + // + var form_unown = new[] { + new { Text = "A", Value = 0 }, + new { Text = "B", Value = 1 }, + new { Text = "C", Value = 2 }, + new { Text = "D", Value = 3 }, + new { Text = "E", Value = 4 }, + new { Text = "F", Value = 5 }, + new { Text = "G", Value = 6 }, + new { Text = "H", Value = 7 }, + new { Text = "I", Value = 8 }, + new { Text = "J", Value = 9 }, + new { Text = "K", Value = 10 }, + new { Text = "L", Value = 11 }, + new { Text = "M", Value = 12 }, + new { Text = "N", Value = 13 }, + new { Text = "O", Value = 14 }, + new { Text = "P", Value = 15 }, + new { Text = "Q", Value = 16 }, + new { Text = "R", Value = 17 }, + new { Text = "S", Value = 18 }, + new { Text = "T", Value = 19 }, + new { Text = "U", Value = 20 }, + new { Text = "V", Value = 21 }, + new { Text = "W", Value = 22 }, + new { Text = "X", Value = 23 }, + new { Text = "Y", Value = 24 }, + new { Text = "Z", Value = 25 }, + new { Text = "!", Value = 26 }, + new { Text = "?", Value = 27 }, + }; + var form_castform = new[] { + new { Text = types[0], Value = 0 }, // Normal + new { Text = forms[789], Value = 1 }, // Sunny + new { Text = forms[790], Value = 2 }, // Rainy + new { Text = forms[791], Value = 3 }, // Snowy + }; + var form_shellos = new[] { + new { Text = forms[422], Value = 0 }, // West + new { Text = forms[811], Value = 1 }, // East + }; + var form_deoxys = new[] { + new { Text = types[0], Value = 0 }, // Normal + new { Text = forms[802], Value = 1 }, // Attack + new { Text = forms[803], Value = 2 }, // Defense + new { Text = forms[804], Value = 3 }, // Speed + }; + var form_burmy = new[] { + new { Text = forms[412], Value = 0 }, // Plant + new { Text = forms[805], Value = 1 }, // Sandy + new { Text = forms[806], Value = 2 }, // Trash + }; + var form_cherrim = new[] { + new { Text = forms[421], Value = 0 }, // Overcast + new { Text = forms[809], Value = 1 }, // Sunshine + }; + var form_rotom = new[] { + new { Text = types[0], Value = 0 }, // Normal + new { Text = forms[817], Value = 1 }, // Heat + new { Text = forms[818], Value = 2 }, // Wash + new { Text = forms[819], Value = 3 }, // Frost + new { Text = forms[820], Value = 4 }, // Fan + new { Text = forms[821], Value = 5 }, // Mow + }; + var form_giratina = new[] { + new { Text = forms[487], Value = 0 }, // Altered + new { Text = forms[822], Value = 1 }, // Origin + }; + var form_shaymin = new[] { + new { Text = forms[492], Value = 0 }, // Land + new { Text = forms[823], Value = 1 }, // Sky + }; + var form_arceus = new[] { + new { Text = types[0], Value = 0 }, // Normal + new { Text = types[1], Value = 1 }, // Fighting + new { Text = types[2], Value = 2 }, // Flying + new { Text = types[3], Value = 3 }, // Poison + new { Text = types[4], Value = 4 }, // etc + new { Text = types[5], Value = 5 }, + new { Text = types[6], Value = 6 }, + new { Text = types[7], Value = 7 }, + new { Text = types[8], Value = 8 }, + new { Text = types[9], Value = 9 }, + new { Text = types[10], Value = 10 }, + new { Text = types[11], Value = 11 }, + new { Text = types[12], Value = 12 }, + new { Text = types[13], Value = 13 }, + new { Text = types[14], Value = 14 }, + new { Text = types[15], Value = 15 }, + new { Text = types[16], Value = 16 }, + new { Text = types[17], Value = 17 }, + }; + var form_basculin = new[] { + new { Text = forms[550], Value = 0 }, // Red + new { Text = forms[842], Value = 1 }, // Blue + }; + var form_darmanitan = new[] { + new { Text = forms[555], Value = 0 }, // Standard + new { Text = forms[843], Value = 1 }, // Zen + }; + var form_deerling = new[] { + new { Text = forms[585], Value = 0 }, // Spring + new { Text = forms[844], Value = 1 }, // Summer + new { Text = forms[845], Value = 2 }, // Autumn + new { Text = forms[846], Value = 3 }, // Winter + }; + var form_gender = new[] { + new { Text = "♂", Value = 0 }, // Male + new { Text = "♀", Value = 1 }, // Female + }; + var form_therian = new[] { + new { Text = forms[641], Value = 0 }, // Incarnate + new { Text = forms[852], Value = 1 }, // Therian + }; + var form_kyurem = new[] { + new { Text = types[0], Value = 0 }, // Normal + new { Text = forms[853], Value = 1 }, // White + new { Text = forms[854], Value = 2 }, // Black + }; + var form_keldeo = new[] { + new { Text = forms[647], Value = 0 }, // Ordinary + new { Text = forms[855], Value = 1 }, // Resolute + }; + var form_meloetta = new[] { + new { Text = forms[648], Value = 0 }, // Aria + new { Text = forms[856], Value = 1 }, // Pirouette + }; + var form_genesect = new[] { + new { Text = types[0], Value = 0 }, // Normal + new { Text = types[10], Value = 1 }, // Douse + new { Text = types[12], Value = 2 }, // Shock + new { Text = types[9], Value = 3 }, // Burn + new { Text = types[14], Value = 4 }, // Chill + }; + var form_flabebe = new[] { + new { Text = forms[669], Value = 0 }, // Red + new { Text = forms[884], Value = 1 }, // Yellow + new { Text = forms[885], Value = 2 }, // Orange + new { Text = forms[886], Value = 3 }, // Blue + new { Text = forms[887], Value = 4 }, // White + }; + var form_floette = new[] { + new { Text = forms[669], Value = 0 }, // Red + new { Text = forms[884], Value = 1 }, // Yellow + new { Text = forms[885], Value = 2 }, // Orange + new { Text = forms[886], Value = 3 }, // Blue + new { Text = forms[887], Value = 4 }, // White + new { Text = forms[888], Value = 5 }, // Eternal + }; + var form_furfrou = new[] { + new { Text = forms[676], Value = 0 }, // Natural + new { Text = forms[893], Value = 1 }, // Heart + new { Text = forms[894], Value = 2 }, // Star + new { Text = forms[895], Value = 3 }, // Diamond + new { Text = forms[896], Value = 4 }, // Deputante + new { Text = forms[897], Value = 5 }, // Matron + new { Text = forms[898], Value = 6 }, // Dandy + new { Text = forms[899], Value = 7 }, // La Reine + new { Text = forms[900], Value = 8 }, // Kabuki + new { Text = forms[901], Value = 9 }, // Pharaoh + }; + var form_aegislash = new[] { + new { Text = forms[681], Value = 0 }, // Shield + new { Text = forms[903], Value = 1 }, // Blade + }; + var form_butterfly = new[] { + new { Text = forms[666], Value = 0 }, // Icy Snow + new { Text = forms[861], Value = 1 }, // Polar + new { Text = forms[862], Value = 2 }, // Tundra + new { Text = forms[863], Value = 3 }, // Continental + new { Text = forms[864], Value = 4 }, // Garden + new { Text = forms[865], Value = 5 }, // Elegant + new { Text = forms[866], Value = 6 }, // Meadow + new { Text = forms[867], Value = 7 }, // Modern + new { Text = forms[868], Value = 8 }, // Marine + new { Text = forms[869], Value = 9 }, // Archipelago + new { Text = forms[870], Value = 10 }, // High-Plains + new { Text = forms[871], Value = 11 }, // Sandstorm + new { Text = forms[872], Value = 12 }, // River + new { Text = forms[873], Value = 13 }, // Monsoon + new { Text = forms[874], Value = 14 }, // Savannah + new { Text = forms[875], Value = 15 }, // Sun + new { Text = forms[876], Value = 16 }, // Ocean + new { Text = forms[877], Value = 17 }, // Jungle + new { Text = forms[878], Value = 18 }, // Fancy + new { Text = forms[879], Value = 19 }, // Poké Ball + }; + var form_list = new[] { + new { Text = "", Value = 0}, // None + }; + var form_pump = new[] { + new { Text = forms[904], Value = 0 }, // Small + new { Text = forms[710], Value = 1 }, // Average + new { Text = forms[905], Value = 2 }, // Large + new { Text = forms[907], Value = 3 }, // Super + }; + var form_mega = new[] { + new { Text = types[0], Value = 0}, // Normal + new { Text = forms[723], Value = 1}, // Mega + }; + var form_megaxy = new[] { + new { Text = types[0], Value = 0}, // Normal + new { Text = forms[724], Value = 1}, // Mega X + new { Text = forms[725], Value = 2}, // Mega Y + }; + + var form_primal = new[] { + new { Text = types[0], Value = 0}, + new { Text = forms[800], Value = 1}, + }; + var form_hoopa = new[] { + new { Text = types[0], Value = 0}, + new { Text = forms[912], Value = 1}, + }; + var form_pikachu = new[] { + new { Text = types[0], Value = 0}, // Normal + new { Text = forms[729], Value = 1}, // Rockstar + new { Text = forms[730], Value = 2}, // Belle + new { Text = forms[731], Value = 3}, // Pop + new { Text = forms[732], Value = 4}, // PhD + new { Text = forms[733], Value = 5}, // Libre + new { Text = forms[734], Value = 6}, // Cosplay + }; + + cb.DataSource = form_list; + cb.DisplayMember = "Text"; + cb.ValueMember = "Value"; + + // Mega List + int[] mspec = { // XY + 003, 009, 065, 094, 115, 127, 130, 142, 181, 212, 214, 229, 248, 257, 282, 303, 306, 308, 310, 354, 359, 380, 381, 445, 448, 460, + // ORAS + 015, 018, 080, 208, 254, 260, 302, 319, 323, 334, 362, 373, 376, 384, 428, 475, 531, 719, + }; + for (int i = 0; i < mspec.Length; i++) + { + if (mspec[i] == species) + { + cb.DataSource = form_mega; + cb.Enabled = true; // Mega Form Selection + return; + } + } + + // MegaXY List + if ((species == 6) || (species == 150)) + { + cb.DataSource = form_megaxy; + cb.Enabled = true; // Mega Form Selection + return; + } + + // Regular Form List + if (species == 025) { form_list = form_pikachu; } + else if (species == 201) { form_list = form_unown; } + else if (species == 351) { form_list = form_castform; } + else if (species == 386) { form_list = form_deoxys; } + else if (species == 421) { form_list = form_cherrim; } + else if (species == 479) { form_list = form_rotom; } + else if (species == 487) { form_list = form_giratina; } + else if (species == 492) { form_list = form_shaymin; } + else if (species == 493) { form_list = form_arceus; } + else if (species == 550) { form_list = form_basculin; } + else if (species == 555) { form_list = form_darmanitan; } + else if (species == 646) { form_list = form_kyurem; } + else if (species == 647) { form_list = form_keldeo; } + else if (species == 648) { form_list = form_meloetta; } + else if (species == 649) { form_list = form_genesect; } + else if (species == 676) { form_list = form_furfrou; } + else if (species == 681) { form_list = form_aegislash; } + else if (species == 670) { form_list = form_floette; } + + else if ((species == 669) || (species == 671)) { form_list = form_flabebe; } + else if ((species == 412) || (species == 413)) { form_list = form_burmy; } + else if ((species == 422) || (species == 423)) { form_list = form_shellos; } + else if ((species == 585) || (species == 586)) { form_list = form_deerling; } + else if ((species == 710) || (species == 711)) { form_list = form_pump; } + + else if ((species == 666) || (species == 665) || (species == 664)) { form_list = form_butterfly; } + else if ((species == 592) || (species == 593) || (species == 678)) { form_list = form_gender; } + else if ((species == 641) || (species == 642) || (species == 645)) { form_list = form_therian; } + + // ORAS + else if (species == 382 || species == 383) { form_list = form_primal; } + else if (species == 720) { form_list = form_hoopa; } + + else + { + cb.Enabled = false; + return; + }; + + cb.DataSource = form_list; + cb.Enabled = true; + } + // Ability Loading + private void refreshFormAbility(object sender, EventArgs e) + { + int i = Array.IndexOf(trpk_form, sender as ComboBox); + refreshPKMSlotAbility(i); + } + private void refreshSpeciesAbility(object sender, EventArgs e) + { + int i = Array.IndexOf(trpk_pkm, sender as ComboBox); + setForms(trpk_pkm[i].SelectedIndex, trpk_form[i]); + refreshPKMSlotAbility(i); + } + private void refreshPKMSlotAbility(int slot) + { + int species = trpk_pkm[slot].SelectedIndex; + uint[] abils = { 0, 0, 0 }; + int formnum = trpk_form[slot].SelectedIndex; + + if (formnum == 0) { } + // Previous Games + else if (species == 492 && formnum == 1) { species = 727; } // Shaymin Sky + else if (species == 487 && formnum == 1) { species = 728; } // Giratina-O + else if (species == 550 && formnum == 1) { species = 738; } // Basculin Blue + else if (species == 646 && formnum == 1) { species = 741; } // Kyurem White + else if (species == 646 && formnum == 2) { species = 742; } // Kyurem Black + else if (species == 641 && formnum == 1) { species = 744; } // Tornadus-T + else if (species == 642 && formnum == 1) { species = 745; } // Thundurus-T + else if (species == 645 && formnum == 1) { species = 746; } // Landorus-T + + // XY + else if (species == 678 && formnum == 1) { species = 748; } // Meowstic Female + else if (species == 094 && formnum == 1) { species = 747; } // Mega Gengar + else if (species == 282 && formnum == 1) { species = 758; } // Mega Gardevoir + else if (species == 181 && formnum == 1) { species = 759; } // Mega Ampharos + else if (species == 003 && formnum == 1) { species = 760; } // Mega Venusaur + else if (species == 006 && formnum == 1) { species = 761; } // Mega Charizard X + else if (species == 006 && formnum == 2) { species = 762; } // Mega Charizard Y + else if (species == 150 && formnum == 1) { species = 763; } // Mega MewtwoX + else if (species == 150 && formnum == 2) { species = 764; } // Mega MewtwoY + else if (species == 257 && formnum == 1) { species = 765; } // Mega Blaziken + else if (species == 308 && formnum == 1) { species = 766; } // Mega Medicham + else if (species == 229 && formnum == 1) { species = 767; } // Mega Houndoom + else if (species == 306 && formnum == 1) { species = 768; } // Mega Aggron + else if (species == 354 && formnum == 1) { species = 769; } // Mega Banette + else if (species == 248 && formnum == 1) { species = 770; } // Mega Tyranitar + else if (species == 212 && formnum == 1) { species = 771; } // Mega Scizor + else if (species == 127 && formnum == 1) { species = 772; } // Mega Pinsir + else if (species == 142 && formnum == 1) { species = 773; } // Mega Aerodactyl + else if (species == 448 && formnum == 1) { species = 774; } // Mega Lucario + else if (species == 460 && formnum == 1) { species = 775; } // Mega Abomasnow + else if (species == 009 && formnum == 1) { species = 777; } // Mega Blastoise + else if (species == 115 && formnum == 1) { species = 778; } // Mega Kangaskhan + else if (species == 130 && formnum == 1) { species = 779; } // Mega Gyarados + else if (species == 359 && formnum == 1) { species = 780; } // Mega Absol + else if (species == 065 && formnum == 1) { species = 781; } // Mega Alakazam + else if (species == 214 && formnum == 1) { species = 782; } // Mega Heracross + else if (species == 303 && formnum == 1) { species = 783; } // Mega Mawile + else if (species == 310 && formnum == 1) { species = 784; } // Mega Manectric + else if (species == 445 && formnum == 1) { species = 785; } // Mega Garchomp + else if (species == 381 && formnum == 1) { species = 786; } // Mega Latios + else if (species == 380 && formnum == 1) { species = 787; } // Mega Latias + + // ORAS + else if (species == 382 && formnum == 1) { species = 812; } // Primal Kyogre + else if (species == 383 && formnum == 1) { species = 813; } // Primal Groudon + else if (species == 720 && formnum == 1) { species = 821; } // Hoopa Unbound + else if (species == 015 && formnum == 1) { species = 825; } // Mega Beedrill + else if (species == 018 && formnum == 1) { species = 808; } // Mega Pidgeot + else if (species == 080 && formnum == 1) { species = 806; } // Mega Slowbro + else if (species == 208 && formnum == 1) { species = 807; } // Mega Steelix + else if (species == 254 && formnum == 1) { species = 800; } // Mega Sceptile + else if (species == 260 && formnum == 1) { species = 799; } // Mega Swampert + else if (species == 302 && formnum == 1) { species = 801; } // Mega Sableye + else if (species == 319 && formnum == 1) { species = 805; } // Mega Sharpedo + else if (species == 323 && formnum == 1) { species = 822; } // Mega Camerupt + else if (species == 334 && formnum == 1) { species = 802; } // Mega Altaria + else if (species == 362 && formnum == 1) { species = 809; } // Mega Glalie + else if (species == 373 && formnum == 1) { species = 824; } // Mega Salamence + else if (species == 376 && formnum == 1) { species = 811; } // Mega Metagross + else if (species == 384 && formnum == 1) { species = 814; } // Mega Rayquaza + else if (species == 428 && formnum == 1) { species = 823; } // Mega Lopunny + else if (species == 475 && formnum == 1) { species = 803; } // Mega Gallade + else if (species == 531 && formnum == 1) { species = 804; } // Mega Audino + else if (species == 719 && formnum == 1) { species = 810; } // Mega Diancie + + byte[] persdata = File.ReadAllBytes("personal" + Path.DirectorySeparatorChar + species.ToString("000") + ".bin"); + Array.Copy(persdata, 0x18, abils, 0, 3); + trpk_abil[slot].Items.Clear(); + trpk_abil[slot].Items.Add("Any (1 or 2)"); + trpk_abil[slot].Items.Add(abilitylist[abils[0]] + " (1)"); + trpk_abil[slot].Items.Add(abilitylist[abils[1]] + " (2)"); + trpk_abil[slot].Items.Add(abilitylist[abils[2]] + " (H)"); + trpk_abil[slot].SelectedIndex = 0; + } + // Set Loading + private void changeTrainerType(object sender, EventArgs e) + { + if (start || loading) return; + int pkm = CB_numPokemon.SelectedIndex; + { + for (int i = 0; i < 6; i++) // enable all if the pkm exists + { + trpk_pkm[i].Enabled = + trpk_gender[i].Enabled = + trpk_abil[i].Enabled = + trpk_IV[i].Enabled = + trpk_lvl[i].Enabled = (i < pkm); + + trpk_item[i].Enabled = (i < pkm) && (checkBox_Item.Checked); + + trpk_m1[i].Enabled = + trpk_m2[i].Enabled = + trpk_m3[i].Enabled = + trpk_m4[i].Enabled = (i < pkm) && (checkBox_Moves.Checked); + + if (!trpk_pkm[i].Enabled) + { + trpk_pkm[i].SelectedIndex = + trpk_gender[i].SelectedIndex = + trpk_form[i].SelectedIndex = + trpk_abil[i].SelectedIndex = + trpk_IV[i].SelectedIndex = + trpk_lvl[i].SelectedIndex = 0; + } + if (!trpk_item[i].Enabled) + { + trpk_item[i].SelectedIndex = 0; + } + if (!trpk_m1[i].Enabled) + { + trpk_m1[i].SelectedIndex = + trpk_m2[i].SelectedIndex = + trpk_m3[i].SelectedIndex = + trpk_m4[i].SelectedIndex = 0; + } + } + for (int i = pkm; i < 6; i++) + trpk_form[i].Enabled = false; + } + } + + // Dumping + private string getTRSummary() + { + string toret = "======\n"; + + toret += CB_TrainerID.SelectedIndex + " - " + CB_Trainer_Class.Text.Substring(6, CB_Trainer_Class.Text.Length - 6) + " " + CB_TrainerID.Text.Substring(6, CB_TrainerID.Text.Length - 6) + "\n"; + toret += "======\n"; + int pkm = CB_numPokemon.SelectedIndex; + toret += "Pokemon: " + pkm + "\n"; + for (int i = 0; i < pkm; i++) + { + toret += trpk_pkm[i].Text + " (Lv. " + trpk_lvl[i].SelectedIndex + ") "; + if (trpk_item[i].SelectedIndex > 0) + toret += "@" + trpk_item[i].Text; + if (trpk_abil[i].SelectedIndex != 0) + { + string abil = trpk_abil[i].Text; + abil = abil.Substring(0, abil.Length - 4); + toret += " (Ability: " + abil + ")"; + } + if (checkBox_Moves.Checked) + { + toret += " (Moves: "; + if (trpk_m1[i].SelectedIndex > 0) toret += trpk_m1[i].Text; + if (trpk_m2[i].SelectedIndex > 0) toret += " / " + trpk_m2[i].Text; + if (trpk_m3[i].SelectedIndex > 0) toret += " / " + trpk_m3[i].Text; + if (trpk_m4[i].SelectedIndex > 0) toret += " / " + trpk_m4[i].Text; + toret += ")"; + } + toret += " IVs: All " + (Convert.ToInt32(trpk_IV[i].SelectedIndex) / 8); + toret += "\n"; + } + toret += "\n"; + return toret; + } + private void B_Dump_Click(object sender, EventArgs e) + { + string toret = ""; + for (int i = 1; i < 950; i++) + { + CB_TrainerID.SelectedIndex = i; + string tdata = getTRSummary(); + toret += tdata; + } + SaveFileDialog sfd = new SaveFileDialog(); + sfd.FileName = "Battles.txt"; + sfd.Filter = "Text File|*.txt"; + + System.Media.SystemSounds.Asterisk.Play(); + if (sfd.ShowDialog() == DialogResult.OK) + { + string path = sfd.FileName; + File.WriteAllText(path, toret, System.Text.Encoding.Unicode); + } + } + + // Top Level Functions + private string[] trdatapaths; + private string[] trpokepaths; + // Change Read + private void changeTrainerIndex(object sender, EventArgs e) + { + if (index > -1) writeFile(); + readFile(); // Load the new file. + } + private void readFile() + { + if (start) return; + index = CB_TrainerID.SelectedIndex; + loading = true; + int format; + + if (index == 0) return; + + // Load Trainer Data + using (BinaryReader br = new BinaryReader((Stream) File.OpenRead(trdatapaths[index]))) + { + if (br.BaseStream.Length != 24) // required length + throw new Exception("Invalid file attempted to load.\n\n" + trdatapaths[index]); + + // load trainer data + tabControl1.Enabled = true; + { + br.BaseStream.Position = 0; + + format = br.ReadUInt16(); + checkBox_Item.Checked = ((format >> 1) & 1) == 1; + checkBox_Moves.Checked = ((format) & 1) == 1; + + CB_Trainer_Class.SelectedIndex = br.ReadUInt16(); + br.ReadByte(); + br.ReadByte(); + + CB_Battle_Type.SelectedIndex = br.ReadByte(); + CB_numPokemon.SelectedIndex = br.ReadByte(); + + CB_Item_1.SelectedIndex = br.ReadUInt16(); + CB_Item_2.SelectedIndex = br.ReadUInt16(); + CB_Item_3.SelectedIndex = br.ReadUInt16(); + CB_Item_4.SelectedIndex = br.ReadUInt16(); + CB_AI.SelectedIndex = br.ReadByte(); + br.ReadByte(); + br.ReadByte(); + br.ReadByte(); + + checkBox_Healer.Checked = Convert.ToBoolean(br.ReadByte()); + CB_Money.SelectedIndex = br.ReadByte(); + + CB_Prize.SelectedIndex = br.ReadUInt16(); + } + } + // Load Pokemon Data + using (BinaryReader br = new BinaryReader((Stream)File.OpenRead(trpokepaths[index]))) + { + br.BaseStream.Position = 0; + for (int i = 0; i < CB_numPokemon.SelectedIndex; i++) + { + trpk_IV[i].SelectedIndex = br.ReadByte(); + byte PID = br.ReadByte(); + trpk_lvl[i].SelectedIndex = br.ReadUInt16(); + trpk_pkm[i].SelectedIndex = br.ReadUInt16(); + setForms(trpk_pkm[i].SelectedIndex, trpk_form[i]); + trpk_form[i].SelectedIndex = br.ReadUInt16(); + refreshPKMSlotAbility(i); // Repopulate Abilities + + trpk_abil[i].SelectedIndex = PID >> 4; + trpk_gender[i].SelectedIndex = PID & 3; + + if (((format >> 1) & 1) == 1) // Items Exist in Data + trpk_item[i].SelectedIndex = br.ReadUInt16(); + if (((format) & 1) == 1) // Moves Exist in Data + { + trpk_m1[i].SelectedIndex = br.ReadUInt16(); + trpk_m2[i].SelectedIndex = br.ReadUInt16(); + trpk_m3[i].SelectedIndex = br.ReadUInt16(); + trpk_m4[i].SelectedIndex = br.ReadUInt16(); + } + } + } + loading = false; + changeTrainerType(null, null); // Prompt cleaning update of PKM fields + } + // Change Write + private void writeFile() + { + // fetch trainer format we're saving as + // index = index; + ushort format = (ushort)(Convert.ToByte(checkBox_Moves.Checked) + (Convert.ToByte(checkBox_Item.Checked) << 1)); + + // Write Trainer Data + using (MemoryStream ms = new MemoryStream()) + using (BinaryWriter bw = new BinaryWriter(ms)) + { + bw.BaseStream.Position = 0; + bw.Write((ushort)format); + bw.Write((ushort)CB_Trainer_Class.SelectedIndex); + bw.Write((byte)0); + bw.Write((byte)0); + bw.Write((byte)CB_Battle_Type.SelectedIndex); + bw.Write((byte)CB_numPokemon.SelectedIndex); + bw.Write((ushort)CB_Item_1.SelectedIndex); + bw.Write((ushort)CB_Item_2.SelectedIndex); + bw.Write((ushort)CB_Item_3.SelectedIndex); + bw.Write((ushort)CB_Item_4.SelectedIndex); + bw.Write((byte)CB_AI.SelectedIndex); + bw.Write((byte)0); + bw.Write((byte)0); + bw.Write((byte)0); + bw.Write((byte)Convert.ToByte(checkBox_Healer.Checked)); + bw.Write((byte)CB_Money.SelectedIndex); + bw.Write((ushort)CB_Prize.SelectedIndex); + + File.WriteAllBytes(trdatapaths[index], ms.ToArray()); + } + // Load Pokemon Data + using (MemoryStream ms = new MemoryStream()) + using (BinaryWriter bw = new BinaryWriter(ms)) + { + bw.BaseStream.Position = 0; + for (int i = 0; i < CB_numPokemon.SelectedIndex; i++) + { + bw.Write((byte)trpk_IV[i].SelectedIndex); + byte PID = (byte)((trpk_abil[i].SelectedIndex << 4) + trpk_gender[i].SelectedIndex); + bw.Write((byte)PID); + bw.Write((ushort)trpk_lvl[i].SelectedIndex); + + bw.Write((ushort)trpk_pkm[i].SelectedIndex); + bw.Write((ushort)trpk_form[i].SelectedIndex); + + if (((format >> 1) & 1) == 1) // Items Exist in Data + bw.Write((ushort)trpk_item[i].SelectedIndex); + if (((format) & 1) == 1) // Moves Exist in Data + { + bw.Write((ushort)trpk_m1[i].SelectedIndex); + bw.Write((ushort)trpk_m2[i].SelectedIndex); + bw.Write((ushort)trpk_m3[i].SelectedIndex); + bw.Write((ushort)trpk_m4[i].SelectedIndex); + } + } + File.WriteAllBytes(trpokepaths[index],ms.ToArray()); + } + } + + private void Setup() + { + start = true; + string[] personalList = Directory.GetFiles("personal"); + personal = new byte[personalList.Length][]; + for (int i = 0; i < personalList.Length; i++) + personal[i] = File.ReadAllBytes("personal" + Path.DirectorySeparatorChar + i.ToString("000") + ".bin"); + + CB_TrainerID.Items.Clear(); + for (int i = 0; i < trdatapaths.Length; i++) + CB_TrainerID.Items.Add(String.Format("{1} - {0}", i.ToString("000"), trName[i])); + + CB_Trainer_Class.Items.Clear(); + for (int i = 0; i < trClass.Length; i++) + CB_Trainer_Class.Items.Add(String.Format("{1} - {0}", i.ToString("000"), trClass[i])); + + specieslist[0] = "---"; + abilitylist[0] = itemlist[0] = movelist[0] = ""; + + for (int i = 0; i < 6; i++) + { + trpk_pkm[i].Items.Clear(); + foreach (string s in specieslist) + trpk_pkm[i].Items.Add(s); + + trpk_m1[i].Items.Clear(); + trpk_m2[i].Items.Clear(); + trpk_m3[i].Items.Clear(); + trpk_m4[i].Items.Clear(); + foreach (string s in movelist) + { + trpk_m1[i].Items.Add(s); + trpk_m2[i].Items.Add(s); + trpk_m3[i].Items.Add(s); + trpk_m4[i].Items.Add(s); + } + + trpk_item[i].Items.Clear(); + foreach (string s in itemlist) + trpk_item[i].Items.Add(s); + + trpk_lvl[i].Items.Clear(); + for (int z = 0; z <= 100; z++) + trpk_lvl[i].Items.Add((z).ToString()); + + trpk_IV[i].Items.Clear(); + for (int z = 0; z < 256; z++) + trpk_IV[i].Items.Add(z.ToString()); + + trpk_gender[i].Items.Clear(); + trpk_gender[i].Items.Add("♂ / M"); + trpk_gender[i].Items.Add("♀ / F"); + trpk_gender[i].Items.Add("- / G"); + + trpk_form[i].Items.Add(""); + + trpk_pkm[i].SelectedIndex = 0; + } + CB_Item_1.Items.Clear(); + CB_Item_2.Items.Clear(); + CB_Item_3.Items.Clear(); + CB_Item_4.Items.Clear(); + CB_Prize.Items.Clear(); + foreach (string s in itemlist) + { + CB_Item_1.Items.Add(s); + CB_Item_2.Items.Add(s); + CB_Item_3.Items.Add(s); + CB_Item_4.Items.Add(s); + CB_Prize.Items.Add(s); + } + + CB_AI.Items.Clear(); CB_Money.Items.Clear(); + for (int i = 0; i < 256; i++) + { CB_AI.Items.Add(i.ToString()); CB_Money.Items.Add(i.ToString()); } + + CB_Battle_Type.Items.Clear(); + CB_Battle_Type.Items.Add("Single"); + CB_Battle_Type.Items.Add("Double"); + CB_Battle_Type.Items.Add("Triple"); + CB_Battle_Type.Items.Add("Rotation"); + CB_Battle_Type.Items.Add("Horde"); + + CB_TrainerID.SelectedIndex = 1; + start = false; + readFile(); + System.Media.SystemSounds.Asterisk.Play(); + } + + public static bool rPKM, rMove, rAbility, rDiffAI, rDiffIV, rClass, rGift, rItem, rDoRand; + public static decimal rGiftPercent; + private void B_Randomize_Click(object sender, EventArgs e) + { + rPKM = rMove = rAbility = rDiffAI = rDiffIV = rClass = rGift = rItem = rDoRand = false; // init to false + rGiftPercent = 0; // 0 + (new TrainerRand()).ShowDialog(); // Open Randomizer Config to get config vals + if (rDoRand) + Randomize(); + } + private void Randomize() + { + for (int i = 1; i < CB_TrainerID.Items.Count; i++) + { + CB_TrainerID.SelectedIndex = i; // data is loaded + + // Setup + checkBox_Moves.Checked = rMove; + checkBox_Item.Checked = rItem; + + // Randomize Trainer Stats + if (rDiffAI) + CB_AI.SelectedIndex = CB_AI.Items.Count - 1; // max + if (rClass) + CB_Trainer_Class.SelectedIndex = (int)(rnd32() % (CB_Trainer_Class.Items.Count)); + + if (rGift && rnd32() % 100 < rGiftPercent) + #region Random Prize Logic + { + ushort[] items; + uint rand = rnd32() % 10; + if (rand < 2) // held item + items = (oras) ? Legal.Pouch_Items_ORAS : Legal.Pouch_Items_XY; + else if (rand < 5) // medicine + items = (oras) ? Legal.Pouch_Medicine_ORAS : Legal.Pouch_Medicine_XY; + else // berry + items = Legal.Pouch_Berry_XY; + CB_Prize.SelectedIndex = items[(rnd32() % items.Length)]; + } + #endregion + else if (rGift) + CB_Prize.SelectedIndex = 0; + + ushort[] itemlist = (oras) ? Legal.Pouch_Items_ORAS : Legal.Pouch_Items_XY; + itemlist = itemlist.Concat(Legal.Pouch_Berry_XY).ToArray(); + int moves = trpk_m1[0].Items.Count; + int itemC = itemlist.Length; + // Randomize Pokemon + for (int p = 0; p < CB_numPokemon.SelectedIndex; p++) + { + if (rPKM) + { + // randomize pokemon + int species = (int)(rnd32() % 722); + trpk_pkm[p].SelectedIndex = species; + // Set Gender + { + int gv = personal[species][0x12]; + int g = (int)(rnd32() % 0x100); + if (gv == 0xFF) // genderless + g = 2; + else if (gv == 0xFE) // female only + g = 1; + else if (gv == 0) // male only + g = 0; + else + g = Convert.ToInt16(g < gv); // if greater than, is female + + trpk_gender[p].SelectedIndex = g; + } + + // randomize form + int forms = (trpk_form[p].Items.Count - 1); + if (forms > 0) + trpk_form[p].SelectedIndex = (int)(rnd32() % (forms + 1)); + } + if (rAbility) + trpk_abil[p].SelectedIndex = (int)(1 + rnd32() % 3); + if (rDiffIV) + trpk_IV[p].SelectedIndex = 255; + if (rItem) + #region RandomItem + trpk_item[p].SelectedIndex = itemlist[(rnd32() % itemC)]; + #endregion + if (rMove) + { + trpk_m1[p].SelectedIndex = (int)(rnd32() % (moves)); + trpk_m2[p].SelectedIndex = (int)(rnd32() % (moves)); + trpk_m3[p].SelectedIndex = (int)(rnd32() % (moves)); + trpk_m4[p].SelectedIndex = (int)(rnd32() % (moves)); + } + } + } + CB_TrainerID.SelectedIndex = 1; + Util.Alert("Randomized all trainers according to specification!", "Press the Dump to TXT to view the new trainer information!"); + } + } +} \ No newline at end of file diff --git a/pk3DS/RSTE.resx b/pk3DS/RSTE.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/pk3DS/RSTE.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/pk3DS/TrainerRand.Designer.cs b/pk3DS/TrainerRand.Designer.cs new file mode 100644 index 0000000..6080e1e --- /dev/null +++ b/pk3DS/TrainerRand.Designer.cs @@ -0,0 +1,215 @@ +namespace pk3DS +{ + partial class TrainerRand + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.CHK_RandomPKM = new System.Windows.Forms.CheckBox(); + this.CHK_RandomItems = new System.Windows.Forms.CheckBox(); + this.CHK_RandomMoves = new System.Windows.Forms.CheckBox(); + this.CHK_RandomAbilities = new System.Windows.Forms.CheckBox(); + this.CHK_RandomGift = new System.Windows.Forms.CheckBox(); + this.CHK_RandomClass = new System.Windows.Forms.CheckBox(); + this.CHK_MaxDiffAI = new System.Windows.Forms.CheckBox(); + this.CHK_MaxDiffPKM = new System.Windows.Forms.CheckBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.NUD_GiftPercent = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_GiftPercent)).BeginInit(); + this.SuspendLayout(); + // + // CHK_RandomPKM + // + this.CHK_RandomPKM.AutoSize = true; + this.CHK_RandomPKM.Checked = true; + this.CHK_RandomPKM.CheckState = System.Windows.Forms.CheckState.Checked; + this.CHK_RandomPKM.Location = new System.Drawing.Point(12, 12); + this.CHK_RandomPKM.Name = "CHK_RandomPKM"; + this.CHK_RandomPKM.Size = new System.Drawing.Size(114, 17); + this.CHK_RandomPKM.TabIndex = 0; + this.CHK_RandomPKM.Text = "Random Pokemon"; + this.CHK_RandomPKM.UseVisualStyleBackColor = true; + // + // CHK_RandomItems + // + this.CHK_RandomItems.AutoSize = true; + this.CHK_RandomItems.Location = new System.Drawing.Point(12, 193); + this.CHK_RandomItems.Name = "CHK_RandomItems"; + this.CHK_RandomItems.Size = new System.Drawing.Size(119, 17); + this.CHK_RandomItems.TabIndex = 1; + this.CHK_RandomItems.Text = "Random Held Items"; + this.CHK_RandomItems.UseVisualStyleBackColor = true; + // + // CHK_RandomMoves + // + this.CHK_RandomMoves.AutoSize = true; + this.CHK_RandomMoves.Checked = true; + this.CHK_RandomMoves.CheckState = System.Windows.Forms.CheckState.Checked; + this.CHK_RandomMoves.Location = new System.Drawing.Point(12, 35); + this.CHK_RandomMoves.Name = "CHK_RandomMoves"; + this.CHK_RandomMoves.Size = new System.Drawing.Size(101, 17); + this.CHK_RandomMoves.TabIndex = 2; + this.CHK_RandomMoves.Text = "Random Moves"; + this.CHK_RandomMoves.UseVisualStyleBackColor = true; + // + // CHK_RandomAbilities + // + this.CHK_RandomAbilities.AutoSize = true; + this.CHK_RandomAbilities.Checked = true; + this.CHK_RandomAbilities.CheckState = System.Windows.Forms.CheckState.Checked; + this.CHK_RandomAbilities.Location = new System.Drawing.Point(12, 58); + this.CHK_RandomAbilities.Name = "CHK_RandomAbilities"; + this.CHK_RandomAbilities.Size = new System.Drawing.Size(193, 17); + this.CHK_RandomAbilities.TabIndex = 3; + this.CHK_RandomAbilities.Text = "Random Abilities (Including Hidden)"; + this.CHK_RandomAbilities.UseVisualStyleBackColor = true; + // + // CHK_RandomGift + // + this.CHK_RandomGift.AutoSize = true; + this.CHK_RandomGift.Location = new System.Drawing.Point(12, 170); + this.CHK_RandomGift.Name = "CHK_RandomGift"; + this.CHK_RandomGift.Size = new System.Drawing.Size(145, 17); + this.CHK_RandomGift.TabIndex = 4; + this.CHK_RandomGift.Text = "Random After-Battle Gifts"; + this.CHK_RandomGift.UseVisualStyleBackColor = true; + this.CHK_RandomGift.CheckedChanged += new System.EventHandler(this.CHK_RandomGift_CheckedChanged); + // + // CHK_RandomClass + // + this.CHK_RandomClass.AutoSize = true; + this.CHK_RandomClass.Location = new System.Drawing.Point(12, 147); + this.CHK_RandomClass.Name = "CHK_RandomClass"; + this.CHK_RandomClass.Size = new System.Drawing.Size(141, 17); + this.CHK_RandomClass.TabIndex = 5; + this.CHK_RandomClass.Text = "Random Trainer Classes"; + this.CHK_RandomClass.UseVisualStyleBackColor = true; + // + // CHK_MaxDiffAI + // + this.CHK_MaxDiffAI.AutoSize = true; + this.CHK_MaxDiffAI.Location = new System.Drawing.Point(12, 104); + this.CHK_MaxDiffAI.Name = "CHK_MaxDiffAI"; + this.CHK_MaxDiffAI.Size = new System.Drawing.Size(219, 17); + this.CHK_MaxDiffAI.TabIndex = 6; + this.CHK_MaxDiffAI.Text = "[NOT VISIBLE] Max Difficulty (Trainer AI)"; + this.CHK_MaxDiffAI.UseVisualStyleBackColor = true; + this.CHK_MaxDiffAI.Visible = false; + // + // CHK_MaxDiffPKM + // + this.CHK_MaxDiffPKM.AutoSize = true; + this.CHK_MaxDiffPKM.Checked = true; + this.CHK_MaxDiffPKM.CheckState = System.Windows.Forms.CheckState.Checked; + this.CHK_MaxDiffPKM.Location = new System.Drawing.Point(12, 81); + this.CHK_MaxDiffPKM.Name = "CHK_MaxDiffPKM"; + this.CHK_MaxDiffPKM.Size = new System.Drawing.Size(161, 17); + this.CHK_MaxDiffPKM.TabIndex = 7; + this.CHK_MaxDiffPKM.Text = "Max Difficulty (Pokemon IVs)"; + this.CHK_MaxDiffPKM.UseVisualStyleBackColor = true; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(212, 189); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(60, 23); + this.button1.TabIndex = 8; + this.button1.Text = "OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.B_Save_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(146, 189); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(60, 23); + this.button2.TabIndex = 9; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.B_Close_Click); + // + // NUD_GiftPercent + // + this.NUD_GiftPercent.Enabled = false; + this.NUD_GiftPercent.Location = new System.Drawing.Point(163, 167); + this.NUD_GiftPercent.Name = "NUD_GiftPercent"; + this.NUD_GiftPercent.Size = new System.Drawing.Size(43, 20); + this.NUD_GiftPercent.TabIndex = 10; + this.NUD_GiftPercent.ValueChanged += new System.EventHandler(this.changePercent); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(212, 171); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(15, 13); + this.label1.TabIndex = 11; + this.label1.Text = "%"; + // + // Randomizer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 222); + this.Controls.Add(this.label1); + this.Controls.Add(this.NUD_GiftPercent); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.CHK_MaxDiffPKM); + this.Controls.Add(this.CHK_MaxDiffAI); + this.Controls.Add(this.CHK_RandomClass); + this.Controls.Add(this.CHK_RandomGift); + this.Controls.Add(this.CHK_RandomAbilities); + this.Controls.Add(this.CHK_RandomMoves); + this.Controls.Add(this.CHK_RandomItems); + this.Controls.Add(this.CHK_RandomPKM); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "Randomizer"; + this.Text = "Randomizer"; + ((System.ComponentModel.ISupportInitialize)(this.NUD_GiftPercent)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox CHK_RandomPKM; + private System.Windows.Forms.CheckBox CHK_RandomItems; + private System.Windows.Forms.CheckBox CHK_RandomMoves; + private System.Windows.Forms.CheckBox CHK_RandomAbilities; + private System.Windows.Forms.CheckBox CHK_RandomGift; + private System.Windows.Forms.CheckBox CHK_RandomClass; + private System.Windows.Forms.CheckBox CHK_MaxDiffAI; + private System.Windows.Forms.CheckBox CHK_MaxDiffPKM; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.NumericUpDown NUD_GiftPercent; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/pk3DS/TrainerRand.cs b/pk3DS/TrainerRand.cs new file mode 100644 index 0000000..f63db62 --- /dev/null +++ b/pk3DS/TrainerRand.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace pk3DS +{ + public partial class TrainerRand : Form + { + public TrainerRand() + { + InitializeComponent(); + } + + private void B_Close_Click(object sender, EventArgs e) + { + this.Close(); + } + private void B_Save_Click(object sender, EventArgs e) + { + RSTE.rPKM = CHK_RandomPKM.Checked; + RSTE.rMove = CHK_RandomMoves.Checked; + RSTE.rAbility = CHK_RandomAbilities.Checked; + + RSTE.rDiffAI = CHK_MaxDiffAI.Checked; + RSTE.rDiffIV = CHK_MaxDiffPKM.Checked; + + RSTE.rClass = CHK_RandomClass.Checked; + RSTE.rGift = CHK_RandomGift.Checked; + RSTE.rGiftPercent = NUD_GiftPercent.Value; + RSTE.rItem = CHK_RandomItems.Checked; + + RSTE.rDoRand = true; + this.Close(); + } + + private void CHK_RandomGift_CheckedChanged(object sender, EventArgs e) + { + NUD_GiftPercent.Enabled = CHK_RandomGift.Checked; + NUD_GiftPercent.Value = Convert.ToDecimal(CHK_RandomGift.Checked); + } + + private void changePercent(object sender, EventArgs e) + { + CHK_RandomGift.Checked = (NUD_GiftPercent.Value != 0); + } + } +} \ No newline at end of file diff --git a/pk3DS/Util.cs b/pk3DS/Util.cs new file mode 100644 index 0000000..e18153e --- /dev/null +++ b/pk3DS/Util.cs @@ -0,0 +1,595 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Globalization; +using System.Drawing; +using System.IO; +using System.Windows.Forms; +using System.Drawing.Imaging; +using System.Text.RegularExpressions; + +namespace pk3DS +{ + class Util + { // Image Layering/Blending Utility + internal static Bitmap LayerImage(Image baseLayer, Image overLayer, int x, int y, double trans) + { + Bitmap overlayImage = (Bitmap)overLayer; + Bitmap newImage = (Bitmap)baseLayer; + if (baseLayer == null) return overlayImage; + for (int i = 0; i < (overlayImage.Width * overlayImage.Height); i++) + { + Color newColor = overlayImage.GetPixel(i % (overlayImage.Width), i / (overlayImage.Width)); + Color oldColor = newImage.GetPixel(i % (overlayImage.Width) + x, i / (overlayImage.Width) + y); + newColor = Color.FromArgb((int)((double)(newColor.A) * trans), newColor.R, newColor.G, newColor.B); // Apply transparency change + // if (newColor.A != 0) // If Pixel isn't transparent, we'll overwrite the color. + { + // if (newColor.A < 100) + newColor = AlphaBlend(newColor, oldColor); + newImage.SetPixel( + i % (overlayImage.Width) + x, + i / (overlayImage.Width) + y, + newColor); + } + } + return newImage; + } + internal static Bitmap ChangeOpacity(Image img, double trans) + { + if (img == null) return null; + Bitmap bmp = new Bitmap(img.Width, img.Height); // Determining Width and Height of Source Image + Graphics graphics = Graphics.FromImage(bmp); + ColorMatrix colormatrix = new ColorMatrix(); + colormatrix.Matrix33 = (float)trans; + ImageAttributes imgAttribute = new ImageAttributes(); + imgAttribute.SetColorMatrix(colormatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); + graphics.DrawImage(img, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, imgAttribute); + graphics.Dispose(); // Releasing all resource used by graphics + return bmp; + } + internal static Color AlphaBlend(Color ForeGround, Color BackGround) + { + if (ForeGround.A == 0) + return BackGround; + if (BackGround.A == 0) + return ForeGround; + if (ForeGround.A == 255) + return ForeGround; + int Alpha = Convert.ToInt32(ForeGround.A); + int B = Alpha * ForeGround.B + (255 - Alpha) * BackGround.B >> 8; + int G = Alpha * ForeGround.G + (255 - Alpha) * BackGround.G >> 8; + int R = Alpha * ForeGround.R + (255 - Alpha) * BackGround.R >> 8; + int A = ForeGround.A; + if (BackGround.A == 255) + A = 255; + if (A > 255) + A = 255; + if (R > 255) + R = 255; + if (G > 255) + G = 255; + if (B > 255) + B = 255; + return Color.FromArgb(Math.Abs(A), Math.Abs(R), Math.Abs(G), Math.Abs(B)); + } + + // Strings and Paths + internal static FileInfo GetNewestFile(DirectoryInfo directory) + { + return directory.GetFiles() + .Union(directory.GetDirectories().Select(d => GetNewestFile(d))) + .OrderByDescending(f => (f == null ? DateTime.MinValue : f.LastWriteTime)) + .FirstOrDefault(); + } + internal static string NormalizePath(string path) + { + return Path.GetFullPath(new Uri(path).LocalPath) + .TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + } + internal static string CleanFileName(string fileName) + { + return Path.GetInvalidFileNameChars().Aggregate(fileName, (current, c) => current.Replace(c.ToString(), string.Empty)); + } + internal static string TrimFromZero(string input) + { + int index = input.IndexOf('\0'); + if (index < 0) + return input; + + return input.Substring(0, index); + } + internal static string[] getStringList(string f, string l) + { + object txt = Properties.Resources.ResourceManager.GetObject("text_" + f + "_" + l); // Fetch File, \n to list. + List rawlist = ((string)txt).Split(new char[] { '\n' }).ToList(); + + string[] stringdata = new string[rawlist.Count]; + for (int i = 0; i < rawlist.Count; i++) + stringdata[i] = rawlist[i].Trim(); + + return stringdata; + } + internal static string[] getSimpleStringList(string f) + { + object txt = Properties.Resources.ResourceManager.GetObject(f); // Fetch File, \n to list. + List rawlist = ((string)txt).Split(new char[] { '\n' }).ToList(); + + string[] stringdata = new string[rawlist.Count]; + for (int i = 0; i < rawlist.Count; i++) + stringdata[i] = rawlist[i].Trim(); + + return stringdata; + } + // Randomization + internal static Random rand = new Random(); + internal static uint rnd32() + { + return (uint)(rand.Next(1 << 30)) << 2 | (uint)(rand.Next(1 << 2)); + } + + // Data Retrieval + internal static int ToInt32(TextBox tb) + { + string value = tb.Text; + return ToInt32(value); + } + internal static uint ToUInt32(TextBox tb) + { + string value = tb.Text; + return ToUInt32(value); + } + internal static int ToInt32(MaskedTextBox tb) + { + string value = tb.Text; + return ToInt32(value); + } + internal static uint ToUInt32(MaskedTextBox tb) + { + string value = tb.Text; + return ToUInt32(value); + } + internal static int ToInt32(String value) + { + value = value.Replace(" ", ""); + if (String.IsNullOrEmpty(value)) + return 0; + try + { + value = value.TrimEnd(new char[] { '_' }); + return Int32.Parse(value); + } + catch { return 0; } + } + internal static uint ToUInt32(String value) + { + value = value.Replace(" ", ""); + if (String.IsNullOrEmpty(value)) + return 0; + try + { + value = value.TrimEnd(new char[] { '_' }); + return UInt32.Parse(value); + } + catch { return 0; } + } + internal static uint getHEXval(TextBox tb) + { + if (tb.Text == null) + return 0; + string str = getOnlyHex(tb.Text); + return UInt32.Parse(str, NumberStyles.HexNumber); + } + internal static int getIndex(ComboBox cb) + { + int val = 0; + if (cb.SelectedValue == null) + return 0; + + try + { val = (int)cb.SelectedValue; } + catch + { val = cb.SelectedIndex; if (val < 0) val = 0; } + return val; + } + internal static string getOnlyHex(string str) + { + if (str == null) return "0"; + + char c; + string s = ""; + + for (int i = 0; i < str.Length; i++) + { + c = str[i]; + // filter for hex + if ((c < 0x0047 && c > 0x002F) || (c < 0x0067 && c > 0x0060)) + s += c; + else + System.Media.SystemSounds.Beep.Play(); + } + if (s.Length == 0) + s = "0"; + return s; + } + + // Data Manipulation + internal static void Shuffle(T[] array) + { + int n = array.Length; + for (int i = 0; i < n; i++) + { + int r = i + (int)(rand.NextDouble() * (n - i)); + T t = array[r]; + array[r] = array[i]; + array[i] = t; + } + } + + // Form Translation + internal static void TranslateInterface(Control form, string lang, MenuStrip menu = null) + { + string FORM_NAME = form.Name; + Control.ControlCollection Controls = form.Controls; + // debug(Controls); + // Fetch a File + // Check to see if a the translation file exists in the same folder as the executable + string externalLangPath = System.Windows.Forms.Application.StartupPath + Path.DirectorySeparatorChar + "lang_" + lang + ".txt"; + string[] rawlist; + if (File.Exists(externalLangPath)) + rawlist = File.ReadAllLines(externalLangPath); + else + { + object txt; + txt = Properties.Resources.ResourceManager.GetObject("lang_" + lang); // Fetch File, \n to list. + if (txt == null) return; // Translation file does not exist as a resource; abort this function and don't translate UI. + string[] stringSeparators = new string[] { "\r\n" }; // Resource files are notepad compatible + rawlist = ((string)txt).Split(stringSeparators, StringSplitOptions.None); + rawlist = rawlist.Select(i => i.Trim()).ToArray(); // Remove trailing spaces + } + + string[] stringdata = new string[rawlist.Length]; + int itemsToRename = 0; + for (int i = 0; i < rawlist.Length; i++) + { + // Find our starting point + if (rawlist[i].Contains("! " + FORM_NAME)) // Start our data + { + // Allow renaming of the Window Title + string[] WindowName = Regex.Split(rawlist[i], " = "); + if (WindowName.Length > 1) form.Text = WindowName[1]; + // Copy our Control Names and Text to a new array for later processing. + for (int j = i + 1; j < rawlist.Length; j++) + { + if (rawlist[j].Length == 0) + continue; // Skip Over Empty Lines, errhandled + if (rawlist[j][0].ToString() != "-") // If line is not a comment line... + { + if (rawlist[j][0].ToString() == "!") // Stop if we have reached the end of translation + goto rename; + stringdata[itemsToRename] = rawlist[j]; // Add the entry to process later. + itemsToRename++; + } + } + } + } + return; // Not Found + + // Now that we have our items to rename in: Control = Text format, let's execute the changes! + rename: + for (int i = 0; i < itemsToRename; i++) + { + string[] SplitString = Regex.Split(stringdata[i], " = "); + if (SplitString.Length < 2) + continue; // Error in Input, errhandled + string ctrl = SplitString[0]; // Control to change the text of... + string text = SplitString[1]; // Text to set Control.Text to... + Control[] controllist = Controls.Find(ctrl, true); + if (controllist.Length == 0) // If Control isn't found... + try + { + // Menu Items can't be found with Controls.Find as they aren't Controls + ToolStripDropDownItem TSI = (ToolStripDropDownItem)menu.Items[ctrl]; + if (TSI != null) + { + // We'll rename the main and child in a row. + string[] ToolItems = Regex.Split(SplitString[1], " ; "); + TSI.Text = ToolItems[0]; // Set parent's text first + if (TSI.DropDownItems.Count != ToolItems.Length - 1) + continue; // Error in Input, errhandled + for (int ti = 1; ti <= TSI.DropDownItems.Count; ti++) + TSI.DropDownItems[ti - 1].Text = ToolItems[ti]; // Set child text + } + // If not found, it is not something to rename and is thus skipped. + } + catch { } + else // Set the input control's text. + controllist[0].Text = text; + } + } + + // Message Displays + internal static DialogResult Error(params string[] lines) + { + System.Media.SystemSounds.Exclamation.Play(); + string msg = String.Join(Environment.NewLine + Environment.NewLine, lines); + return (DialogResult)MessageBox.Show(msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + internal static DialogResult Alert(params string[] lines) + { + System.Media.SystemSounds.Asterisk.Play(); + string msg = String.Join(Environment.NewLine + Environment.NewLine, lines); + return (DialogResult)MessageBox.Show(msg, "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + internal static DialogResult Prompt(MessageBoxButtons btn, params string[] lines) + { + System.Media.SystemSounds.Question.Play(); + string msg = String.Join(Environment.NewLine + Environment.NewLine, lines); + return (DialogResult)MessageBox.Show(msg, "Prompt", btn, MessageBoxIcon.Asterisk); + } + + // DataSource Providing + public class cbItem + { + public string Text { get; set; } + public object Value { get; set; } + } + internal static List getCBList(string textfile, string lang) + { + // Set up + List cbList = new List(); + string[] inputCSV = Util.getSimpleStringList(textfile); + + // Get Language we're fetching for + int index = Array.IndexOf(new string[] { "ja", "en", "fr", "de", "it", "es", "ko", "zh", }, lang); + + // Set up our Temporary Storage + string[] unsortedList = new string[inputCSV.Length - 1]; + int[] indexes = new int[inputCSV.Length - 1]; + + // Gather our data from the input file + for (int i = 1; i < inputCSV.Length; i++) + { + string[] countryData = inputCSV[i].Split(','); + indexes[i - 1] = Convert.ToInt32(countryData[0]); + unsortedList[i - 1] = countryData[index + 1]; + } + + // Sort our input data + string[] sortedList = new string[inputCSV.Length - 1]; + Array.Copy(unsortedList, sortedList, unsortedList.Length); + Array.Sort(sortedList); + + // Arrange the input data based on original number + for (int i = 0; i < sortedList.Length; i++) + { + cbItem ncbi = new cbItem(); + ncbi.Text = sortedList[i]; + ncbi.Value = indexes[Array.IndexOf(unsortedList, sortedList[i])]; + cbList.Add(ncbi); + } + return cbList; + } + internal static List getCBList(string[] inStrings, params int[][] allowed) + { + List cbList = new List(); + if (allowed == null) + allowed = new int[][] { Enumerable.Range(0, inStrings.Length).ToArray() }; + + foreach (int[] list in allowed) + { + // Sort the Rest based on String Name + string[] unsortedChoices = new string[list.Length]; + for (int i = 0; i < list.Length; i++) + unsortedChoices[i] = inStrings[list[i]]; + + string[] sortedChoices = new string[unsortedChoices.Length]; + Array.Copy(unsortedChoices, sortedChoices, unsortedChoices.Length); + Array.Sort(sortedChoices); + + // Add the rest of the items + for (int i = 0; i < sortedChoices.Length; i++) + { + cbItem ncbi = new cbItem(); + ncbi.Text = sortedChoices[i]; + ncbi.Value = list[Array.IndexOf(unsortedChoices, sortedChoices[i])]; + cbList.Add(ncbi); + } + } + return cbList; + } + internal static List getOffsetCBList(List cbList, string[] inStrings, int offset, int[] allowed) + { + if (allowed == null) + allowed = Enumerable.Range(0, inStrings.Length).ToArray(); + + int[] list = (int[])allowed.Clone(); + for (int i = 0; i < list.Length; i++) + list[i] -= offset; + + { + // Sort the Rest based on String Name + string[] unsortedChoices = new string[allowed.Length]; + for (int i = 0; i < allowed.Length; i++) + unsortedChoices[i] = inStrings[list[i]]; + + string[] sortedChoices = new string[unsortedChoices.Length]; + Array.Copy(unsortedChoices, sortedChoices, unsortedChoices.Length); + Array.Sort(sortedChoices); + + // Add the rest of the items + for (int i = 0; i < sortedChoices.Length; i++) + { + cbItem ncbi = new cbItem(); + ncbi.Text = sortedChoices[i]; + ncbi.Value = allowed[Array.IndexOf(unsortedChoices, sortedChoices[i])]; + cbList.Add(ncbi); + } + } + return cbList; + } + internal static List getVariedCBList(List cbList, string[] inStrings, int[] stringNum, int[] stringVal) + { + // Set up + List newlist = new List(); + + for (int i = 4; i > 1; i--) // add 4,3,2 + { + // First 3 Balls are always first + cbItem ncbi = new cbItem(); + ncbi.Text = inStrings[i]; + ncbi.Value = i; + newlist.Add(ncbi); + } + + // Sort the Rest based on String Name + string[] ballnames = new string[stringNum.Length]; + for (int i = 0; i < stringNum.Length; i++) + ballnames[i] = inStrings[stringNum[i]]; + + string[] sortedballs = new string[stringNum.Length]; + Array.Copy(ballnames, sortedballs, ballnames.Length); + Array.Sort(sortedballs); + + // Add the rest of the balls + for (int i = 0; i < sortedballs.Length; i++) + { + cbItem ncbi = new cbItem(); + ncbi.Text = sortedballs[i]; + ncbi.Value = stringVal[Array.IndexOf(ballnames, sortedballs[i])]; + newlist.Add(ncbi); + } + return newlist; + } + internal static List getUnsortedCBList(string textfile) + { + // Set up + List cbList = new List(); + string[] inputCSV = Util.getSimpleStringList(textfile); + + // Gather our data from the input file + for (int i = 1; i < inputCSV.Length; i++) + { + string[] inputData = inputCSV[i].Split(','); + cbItem ncbi = new cbItem(); + ncbi.Value = Convert.ToInt32(inputData[0]); + ncbi.Text = inputData[1]; + cbList.Add(ncbi); + } + return cbList; + } + + // GARCTool Utility + internal static string GuessExtension(BinaryReader br, string defaultExt, bool bypass) + { + try + { + string ext = ""; + long position = br.BaseStream.Position; + byte[] magic = System.Text.Encoding.ASCII.GetBytes(br.ReadChars(4)); + + // check for extensions + { + ushort count = BitConverter.ToUInt16(magic, 2); + + // check for 2char container extensions + try + { + br.BaseStream.Position = position + 4 + 4 * count; + if (br.ReadUInt32() == br.BaseStream.Length) + { + ext += (char)magic[0] + (char)magic[1]; + goto end; + } + } + catch { } + if (bypass) return defaultExt; + + // check for darc + try + { + count = BitConverter.ToUInt16(magic, 0); + br.BaseStream.Position = position + 4 + 0x40 * count; + uint tableval = br.ReadUInt32(); + br.BaseStream.Position += 0x20 * tableval; + while (br.PeekChar() == 0) // seek forward + br.ReadByte(); + if (br.ReadUInt32() == 0x63726164) + return "darc"; + } + catch { }; + + // check for bclim + try + { + br.BaseStream.Position = br.BaseStream.Length - 0x28; + if (br.ReadUInt32() == 0x4D494C43) + { + br.BaseStream.Position = br.BaseStream.Length - 0x4; + if (br.ReadUInt32() == br.BaseStream.Length - 0x28) + return "bclim"; + } + } + catch { } + + // generic check + { + if (magic[0] < 0x41) + return defaultExt; + for (int i = 0; i < magic.Length && i < 4; i++) + { + if ((magic[i] >= 'a' && magic[i] <= 'z') || (magic[i] >= 'A' && magic[i] <= 'Z') + || char.IsDigit((char)magic[i])) + { + ext += (char)magic[i]; + } + else + break; + } + } + } + end: + { + // Return BaseStream position to the start. + br.BaseStream.Position = position; + if (ext.Length <= 1) + return defaultExt; + return ext; + } + } + catch { return defaultExt; } + } + internal static string GuessExtension(string path, bool bypass) + { + using (BinaryReader br = new BinaryReader(System.IO.File.OpenRead(path))) + return Util.GuessExtension(br, "bin", bypass); + } + internal static uint Reverse(uint x) + { + uint y = 0; + for (int i = 0; i < 32; ++i) + { + y <<= 1; + y |= (x & 1); + x >>= 1; + } + return y; + } + internal static char[] Reverse(char[] charArray) + { + Array.Reverse(charArray); + return charArray; + } + + // Text File Utility + internal static string getRandomFileName() + { + Random random = new Random((int)DateTime.Now.Ticks);//thanks to McAden + int size = 8; + string s = ""; + for (int i = 0; i < size; i++) + s += Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))); + + return s; + } + } +} diff --git a/pk3DS/pk3DS.csproj b/pk3DS/pk3DS.csproj new file mode 100644 index 0000000..b3ba800 --- /dev/null +++ b/pk3DS/pk3DS.csproj @@ -0,0 +1,117 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {C4CB2488-2DB9-489F-8B02-A8E872C6C6AB} + WinExe + Properties + pk3DS + pk3DS + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + + + + + + + + Form + + + Main.cs + + + + + Form + + + TrainerRand.cs + + + Form + + + RSTE.cs + + + + Form + + + xytext.cs + + + Main.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + RSTE.cs + + + xytext.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + \ No newline at end of file diff --git a/pk3DS/xytext.Designer.cs b/pk3DS/xytext.Designer.cs new file mode 100644 index 0000000..3fe8d0d --- /dev/null +++ b/pk3DS/xytext.Designer.cs @@ -0,0 +1,141 @@ +namespace pk3DS +{ + partial class xytext + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.CB_Entry = new System.Windows.Forms.ComboBox(); + this.dgv = new System.Windows.Forms.DataGridView(); + this.B_AddLine = new System.Windows.Forms.Button(); + this.B_RemoveLine = new System.Windows.Forms.Button(); + this.B_Dump = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit(); + this.SuspendLayout(); + // + // CB_Entry + // + this.CB_Entry.FormattingEnabled = true; + this.CB_Entry.Location = new System.Drawing.Point(68, 7); + this.CB_Entry.Name = "CB_Entry"; + this.CB_Entry.Size = new System.Drawing.Size(79, 21); + this.CB_Entry.TabIndex = 5; + this.CB_Entry.SelectedIndexChanged += new System.EventHandler(this.changeEntry); + // + // dgv + // + this.dgv.AllowUserToAddRows = false; + this.dgv.AllowUserToDeleteRows = false; + this.dgv.AllowUserToResizeRows = false; + this.dgv.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.dgv.BackgroundColor = System.Drawing.SystemColors.Control; + this.dgv.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgv.Location = new System.Drawing.Point(12, 33); + this.dgv.Name = "dgv"; + this.dgv.RowHeadersVisible = false; + this.dgv.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; + this.dgv.ShowEditingIcon = false; + this.dgv.Size = new System.Drawing.Size(610, 317); + this.dgv.TabIndex = 0; + // + // B_AddLine + // + this.B_AddLine.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.B_AddLine.Location = new System.Drawing.Point(356, 5); + this.B_AddLine.Name = "B_AddLine"; + this.B_AddLine.Size = new System.Drawing.Size(130, 23); + this.B_AddLine.TabIndex = 6; + this.B_AddLine.Text = "Add Line After Line"; + this.B_AddLine.UseVisualStyleBackColor = true; + this.B_AddLine.Click += new System.EventHandler(this.B_AddLine_Click); + // + // B_RemoveLine + // + this.B_RemoveLine.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.B_RemoveLine.Location = new System.Drawing.Point(493, 5); + this.B_RemoveLine.Name = "B_RemoveLine"; + this.B_RemoveLine.Size = new System.Drawing.Size(130, 23); + this.B_RemoveLine.TabIndex = 7; + this.B_RemoveLine.Text = "Remove Selected Line"; + this.B_RemoveLine.UseVisualStyleBackColor = true; + this.B_RemoveLine.Click += new System.EventHandler(this.B_RemoveLine_Click); + // + // B_Dump + // + this.B_Dump.Location = new System.Drawing.Point(153, 6); + this.B_Dump.Name = "B_Dump"; + this.B_Dump.Size = new System.Drawing.Size(88, 23); + this.B_Dump.TabIndex = 8; + this.B_Dump.Text = "Dump to .txt"; + this.B_Dump.UseVisualStyleBackColor = true; + this.B_Dump.Click += new System.EventHandler(this.dumpTXT_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 10); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(50, 13); + this.label1.TabIndex = 9; + this.label1.Text = "Text File:"; + // + // xytext + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(634, 362); + this.Controls.Add(this.label1); + this.Controls.Add(this.B_Dump); + this.Controls.Add(this.B_RemoveLine); + this.Controls.Add(this.B_AddLine); + this.Controls.Add(this.dgv); + this.Controls.Add(this.CB_Entry); + this.MinimumSize = new System.Drawing.Size(400, 300); + this.Name = "xytext"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Text Editor"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.xytext_FormClosing); + ((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ComboBox CB_Entry; + private System.Windows.Forms.DataGridView dgv; + private System.Windows.Forms.Button B_AddLine; + private System.Windows.Forms.Button B_RemoveLine; + private System.Windows.Forms.Button B_Dump; + private System.Windows.Forms.Label label1; + + } +} diff --git a/pk3DS/xytext.cs b/pk3DS/xytext.cs new file mode 100644 index 0000000..4f1bd49 --- /dev/null +++ b/pk3DS/xytext.cs @@ -0,0 +1,563 @@ +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.Windows.Forms; +using System.IO; + +namespace pk3DS +{ + public partial class xytext : Form + { + public xytext(string[] infiles) + { + InitializeComponent(); + files = infiles; + for (int i = 0; i < files.Length; i++) + CB_Entry.Items.Add(i.ToString()); + CB_Entry.SelectedIndex = 0; + } + private string[] files; + private int entry = -1; + // IO + private void dumpTXT_Click(object sender, EventArgs e) + { + if (files.Length > 0) + { + SaveFileDialog saveDump = new SaveFileDialog(); + saveDump.Filter = "Text File|*.txt"; + DialogResult sdr = saveDump.ShowDialog(); + if (sdr == DialogResult.OK) + { + bool newline = false; + if (Util.Prompt(MessageBoxButtons.YesNo, "Remove newline formatting?") == DialogResult.Yes) + newline = true; + string path = saveDump.FileName; + using (MemoryStream ms = new MemoryStream()) + { + using (TextWriter tw = new StreamWriter(ms)) + for (int i = 0; i < files.Length; i++) + { + string[] data = getStringsFromFile(files[i]); + tw.WriteLine("~~~~~~~~~~~~~~~"); + tw.WriteLine("Text File : " + i.ToString()); + tw.WriteLine("~~~~~~~~~~~~~~~"); + if (data != null) + foreach (string line in data) + { + if (newline) + tw.WriteLine(line.Replace("\\n\\n"," ").Replace("\\n", " ").Replace("\\c", "").Replace("\\r", "")); // Strip out formatting + else + tw.WriteLine(line); + } + } + File.WriteAllBytes(path, ms.ToArray()); + } + } + } + } + private void changeEntry(object sender, EventArgs e) + { + // Save All the old text + if (entry > -1) File.WriteAllBytes(files[entry], getBytesForFile(getCurrentDGLines())); + + // Reset + entry = CB_Entry.SelectedIndex; + string file = files[entry]; + string[] data = getStringsFromFile(file); + setStringsDataGridView(data); + } + private void B_SaveText_Click(object sender, EventArgs e) + { + File.WriteAllBytes(files[CB_Entry.SelectedIndex], getBytesForFile(getCurrentDGLines())); + } + // Main Handling + private void setStringsDataGridView(string[] textArray) + { + // Clear the datagrid row content to remove all text lines. + dgv.Rows.Clear(); + + if (textArray == null) // Error handling for bad inputs. + return; + + // Clear the header columns, these are repopulated every time. + dgv.Columns.Clear(); + + // Reset settings and columns. + dgv.AllowUserToResizeColumns = false; + DataGridViewColumn dgvLine = new DataGridViewTextBoxColumn(); + { + dgvLine.HeaderText = "Line"; + dgvLine.DisplayIndex = 0; + dgvLine.Width = 32; + dgvLine.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; + dgvLine.ReadOnly = true; + dgvLine.SortMode = DataGridViewColumnSortMode.NotSortable; + } + DataGridViewTextBoxColumn dgvText = new DataGridViewTextBoxColumn(); + { + dgvText.HeaderText = "Text"; + dgvText.DisplayIndex = 1; + dgvText.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + dgvText.SortMode = DataGridViewColumnSortMode.NotSortable; + } + + // Re-add the columns. + dgv.Columns.Add(dgvLine); + dgv.Columns.Add(dgvText); + + // Add empty rows equal to how many entries. + dgv.Rows.Add(textArray.Length); + + // Add the text lines into their cells. + for (int i = 0; i < textArray.Length; i++) + { + dgv.Rows[i].Cells[0].Value = i; + dgv.Rows[i].Cells[1].Value = textArray[i]; + } + } + private string[] getCurrentDGLines() + { + // Get Line Count + string[] lines = new string[dgv.RowCount]; + for (int i = 0; i < dgv.RowCount; i++) + lines[i] = (string)dgv.Rows[i].Cells[1].Value ?? String.Format("[~ {0}]", i.ToString()); + return lines; + } + // Meta Usage + private void B_AddLine_Click(object sender, EventArgs e) + { + int currentRow = 0; + try + { + currentRow = dgv.CurrentRow.Index; + } + catch + { + dgv.Rows.Add(); + } + if (dgv.Rows.Count == 1) { } + else if (currentRow < dgv.Rows.Count - 1 || currentRow == 0) + { + if (ModifierKeys != Keys.Control && currentRow != 0) + { + if (Util.Prompt(MessageBoxButtons.YesNo, "Inserting in between rows will shift all subsequent lines.", "Continue?") != DialogResult.Yes) return; + } + dgv.Rows.Insert(currentRow + 1); + } + + for (int i = 0; i < dgv.Rows.Count; i++) + dgv.Rows[i].Cells[0].Value = i.ToString(); + } + private void B_RemoveLine_Click(object sender, EventArgs e) + { + int currentRow = dgv.CurrentRow.Index; + if (currentRow < dgv.Rows.Count - 1) + { + if ((ModifierKeys != Keys.Control) && DialogResult.Yes != Util.Prompt(MessageBoxButtons.YesNo, "Deleting a row above other lines will shift all subsequent lines.", "Continue?")) + return; + } + + dgv.Rows.RemoveAt(currentRow); + + for (int i = 0; i < dgv.Rows.Count; i++) + dgv.Rows[i].Cells[0].Value = i.ToString(); + } + + // Top Level Functions + internal static string[] getStringsFromFile(string path) + { + byte[] data = File.ReadAllBytes(path); + ushort textSections = BitConverter.ToUInt16(data, 0); + ushort lineCount = BitConverter.ToUInt16(data, 2); + if (lineCount == 0) return null; + uint totalLength = BitConverter.ToUInt32(data, 4); + uint initialKey = BitConverter.ToUInt32(data, 8); + int sectionData = BitConverter.ToInt32(data, 12); + + try // Some sanity checking to prevent errors. + { + if (initialKey != 0) throw new Exception("Invalid initial key! Not 0?"); + if (sectionData + totalLength != data.Length || textSections != 1) throw new Exception("Invalid Text File"); + + uint sectionLength = BitConverter.ToUInt32(data, sectionData); + if (sectionLength != totalLength) throw new Exception("Section size and overall size do not match."); + } + catch { return null; }; + + // Prep result storage. + ushort key = 0x7C89; + string[] result = new string[lineCount]; + + for (int i = 0; i < lineCount; i++) + { + // Init + ushort k = key; + string s = ""; + int offset = BitConverter.ToInt32(data, i * 8 + sectionData + 4) + sectionData; + int length = BitConverter.ToInt16(data, i * 8 + sectionData + 8); + int start = offset; + ushort c = 0; // u16 char + + while (offset < start + length * 2) // loop through the entire text line + { + decryptU16(data, ref offset, ref c, ref k); + if (c == 0) // Terminated Line + break; + else if (c == '\n') s += "\\n"; + else if (c == 0x10) // Variable + decryptVar(data, ref offset, ref s, ref c, ref k); + else // Regular Character + { + // Check special characters... + if (c == 0xE07F) + s += (char)0x202F; // nbsp + else if (c == 0xE08D) + s += (char)0x2026; // … + else if (c == 0xE08E) + s += (char)0x2642; // ♂ + else if (c == 0xE08F) + s += (char)0x2640; // ♀ + // Else append character without modification. + else s += (char)c; + } + } + // store string and set key for next line (if needed) + result[i] = s; + key += 0x2983; + } + return result; + } + internal static byte[] getBytesForFile(string[] lines) + { + + using (MemoryStream textFile = new MemoryStream()) + using (BinaryWriter bw = new BinaryWriter(textFile)) + using (MemoryStream data = new MemoryStream()) + using (BinaryWriter bz = new BinaryWriter(data)) + { + ushort baseKey = 0x7C89; + + // Write up header template + bw.Write((ushort)1); // Always 1 ? + bw.Write((ushort)lines.Length); // Line Count + bw.Write((uint)0); // (Temporary) Data Length - fixed at the end. + bw.Write((uint)0); // Key, constant 0. + bw.Write((uint)0x10); // Pointer to line data. + + // Begin data + bw.Write((uint)0); // (Temporary) Data Length - fixed at the end. + + for (int i = 0; i < lines.Length; i++) + { + ushort key = baseKey; + uint pos = (uint)data.Position; + // Get crypted line data. + { + { + // Write each character to the data stream, with handling for special characters. + for (int j = 0; j < lines[i].Length; j++) + { + ushort val = lines[i][j]; + + // Handle special text characters + // Private Use Area characters + if (val == 0x202F) val = 0xE07F; // nbsp + else if (val == 0x2026) val = 0xE08D; // … + else if (val == 0x2642) val = 0xE08E; // ♂ + else if (val == 0x2640) val = 0xE08F; // ♀ + + // Variables + else if (val == '[' || val == '\\') // Variable + encryptVar(bz, lines[i], ref j, ref key); + + // Text + else bz.Write(encryptU16(val, ref key)); + } + bz.Write(encryptU16(0, ref key)); // Add the null terminator, after encrypting it. + } + + // Write the lineOffset and charCount to the header. + bw.Write((uint)(pos + 0x4 + lines.Length * 8)); + bw.Write((uint)(data.Position - pos) / 2); + if (data.Position % 4 > 0) bz.Write((ushort)0); + + // Increment the line initial key for the next line. + baseKey += 0x2983; + } + } + + // Copy the data stream to the textFile stream. + data.Position = 0; data.CopyTo(textFile); + + // Fix the temp values + textFile.Position = 0x4; bw.Write((uint)textFile.Length - 0x10); + textFile.Position = 0x10; bw.Write((uint)textFile.Length - 0x10); + + return textFile.ToArray(); + } + } + // Text Encrypting + internal static ushort encryptU16(ushort val, ref ushort key) + { + val = (ushort)(key ^ val); + key = (ushort)(((key << 3) | (key >> 13)) & 0xffff); + return val; + } + internal static ushort decryptU16(byte[] data, ref int offset, ref ushort val, ref ushort key) + { + val = (ushort)(BitConverter.ToUInt16(data, offset) ^ key); + offset += 2; + key = (ushort)(((key << 3) | (key >> 13)) & 0xffff); + return val; + } + // Variable Handling + internal static ushort getVariableBytes(string varType, ref List args) + { + // Fetch the variable name... + int bracket = varType.IndexOf('('); + string variable = varType.Substring(0, bracket); + string[] arguments = varType.Substring(bracket + 1, varType.Length - bracket - 2).Split(','); + + ushort varVal = 0; + + switch (variable) + { + case "COLOR": varVal = 0xFF00; break; + case "TRNAME": varVal = 0x0100; break; + case "PKNAME": varVal = 0x0101; break; + case "PKNICK": varVal = 0x0102; break; + case "TYPE": varVal = 0x0103; break; + case "LOCATION": varVal = 0x0105; break; + case "ABILITY": varVal = 0x0106; break; + case "MOVE": varVal = 0x0107; break; + case "ITEM1": varVal = 0x0108; break; + case "ITEM2": varVal = 0x0109; break; + case "sTRBAG": varVal = 0x010A; break; + case "BOX": varVal = 0x010B; break; + case "EVSTAT": varVal = 0x010D; break; + case "OPOWER": varVal = 0x0110; break; + case "RIBBON": varVal = 0x0127; break; + case "MIINAME": varVal = 0x0134; break; + case "WEATHER": varVal = 0x013E; break; + case "TRNICK": varVal = 0x0189; break; + case "1stchrTR": varVal = 0x018A; break; + case "SHOUTOUT": varVal = 0x018B; break; + case "BERRY": varVal = 0x018E; break; + case "REMFEEL": varVal = 0x018F; break; + case "REMQUAL": varVal = 0x0190; break; + case "WEBSITE": varVal = 0x0191; break; + case "CHOICECOS": varVal = 0x019C; break; + case "GSYNCID": varVal = 0x01A1; break; + case "PRVIDSAY": varVal = 0x0192; break; + case "BTLTEST": varVal = 0x0193; break; + case "GENLOC": varVal = 0x0195; break; + case "CHOICEFOOD": varVal = 0x0199; break; + case "HOTELITEM": varVal = 0x019A; break; + case "TAXISTOP": varVal = 0x019B; break; + case "MAISTITLE": varVal = 0x019F; break; + case "ITEMPLUR0": varVal = 0x1000; break; + case "ITEMPLUR1": varVal = 0x1001; break; + case "GENDBR": varVal = 0x1100; break; + case "NUMBRNCH": varVal = 0x1101; break; + case "iCOLOR2": varVal = 0x1302; break; + case "iCOLOR3": varVal = 0x1303; break; + case "NUM1": varVal = 0x0200; break; + case "NUM2": varVal = 0x0201; break; + case "NUM3": varVal = 0x0202; break; + case "NUM4": varVal = 0x0203; break; + case "NUM5": varVal = 0x0204; break; + case "NUM6": varVal = 0x0205; break; + case "NUM7": varVal = 0x0206; break; + case "NUM8": varVal = 0x0207; break; + case "NUM9": varVal = 0x0208; break; + default: varVal = Convert.ToUInt16(variable, 16); break; + } + // Set arguments in. + for (int i = 0; i < arguments.Length; i++) + args.Add(Convert.ToUInt16(arguments[i], 16)); + + // All done. + return varVal; + } + internal static void encryptVar(BinaryWriter bw, string line, ref int i, ref ushort key) + { + ushort val = line[i]; + if (val == '\\') // Line Break + if (line[i + 1] == 'n') + { + i++; + bw.Write(encryptU16('\n', ref key)); + } + else if (line[i + 1] == 'r') + { + bw.Write(encryptU16(0x10, ref key)); i++; + bw.Write(encryptU16(1, ref key)); + bw.Write(encryptU16(0xBE00, ref key)); + } + else if (line[i + 1] == 'c') + { + bw.Write(encryptU16(0x10, ref key)); i++; + bw.Write(encryptU16(1, ref key)); + bw.Write(encryptU16(0xBE01, ref key)); + } + else { throw new Exception("Invalid terminated line"); } + else if (val == '[') // Special Variable + { + int bracket = line.Substring(i + 1).IndexOf(']'); + if (bracket < 3) throw new Exception("Variable encoding error!"); + + // [VAR X(a, b)] + // Remove the [ ] -> VAR X(a, b) + string varCMD = line.Substring(i + 1, bracket); + i += bracket + 1; // Advance the index to the end of the bracket. + + string varMethod = varCMD.Split(' ')[0]; // Returns VAR or WAIT or ~ + string varType = varCMD.Substring(varMethod.Length + 1); // Returns the remainder of the var command data. + ushort varValue = 0; + + // Set up argument storage (even if it not used) + List args = new List(); + + try + { + switch (varMethod) + { + case "~": // Blank Text Line Variable (No text set - debug/quality testing variable?) + { + varValue = 0xBDFF; + args.Add(Convert.ToUInt16(varType)); + break; + } + case "WAIT": // Event pause Variable. + { + varValue = 0xBE02; + args.Add(Convert.ToUInt16(varType)); + break; + } + case "VAR": // Text Variable + { + varValue = getVariableBytes(varType, ref args); + break; + } + default: throw new Exception("Unknown variable method type!"); + } + } + catch (Exception e) + { + Util.Alert("Variable error. Current line text is:", line, e.ToString()); + } + + // Write the Variable prefix. + bw.Write(encryptU16(0x0010, ref key)); + // Write Length of the following Variable Data + bw.Write(encryptU16((ushort)(1 + args.Count), ref key)); + // Write the Variable type. + bw.Write(encryptU16(varValue, ref key)); + + for (int j = 0; j < args.Count; j++) + bw.Write(encryptU16((ushort)args[j], ref key)); + + // Done. + } + } + internal static void decryptVar(byte[] d, ref int o, ref string s, ref ushort v, ref ushort k) + { + ushort length = decryptU16(d, ref o, ref v, ref k); + ushort varType = decryptU16(d, ref o, ref v, ref k); + switch (varType) + { + // Check the nonvariable types... + case 0xBE00: // "Waitbutton then scroll text;; \r" + { s += "\\r"; return; } + case 0xBE01: // "Waitbutton then clear text;; \c" + { s += "\\c"; return; } + case 0xBE02: // Dramatic pause for a text line. New! + { s += "[WAIT " + decryptU16(d, ref o, ref v, ref k).ToString() + "]"; return; } + case 0xBDFF: // Empty Text line? Includes linenum so maybe for betatest finding used-unused lines? + { s += "[~ " + decryptU16(d, ref o, ref v, ref k).ToString() + "]"; return; } + + // Else a text variable, so let's loop through all the variable types. If we cannot find it, we just write the u16 val. + default: + { + ushort varCode = varType; // decryptU16(d, ref o, ref v, ref k); + string tvname = ""; + switch (varCode) // get variable's info name + { + case 0xFF00: tvname = "COLOR"; break; // Change text line color (0 = white, 1 = red, 2 = blue...) + case 0x0100: tvname = "TRNAME"; break; // + case 0x0101: tvname = "PKNAME"; break; + case 0x0102: tvname = "PKNICK"; break; + case 0x0103: tvname = "TYPE"; break; + case 0x0105: tvname = "LOCATION"; break; + case 0x0106: tvname = "ABILITY"; break; + case 0x0107: tvname = "MOVE"; break; + case 0x0108: tvname = "ITEM1"; break; + case 0x0109: tvname = "ITEM2"; break; + case 0x010A: tvname = "sTRBAG"; break; + case 0x010B: tvname = "BOX"; break; + case 0x010D: tvname = "EVSTAT"; break; + case 0x0110: tvname = "OPOWER"; break; + case 0x0127: tvname = "RIBBON"; break; + case 0x0134: tvname = "MIINAME"; break; + case 0x013E: tvname = "WEATHER"; break; + case 0x0189: tvname = "TRNICK"; break; + case 0x018A: tvname = "1stchrTR"; break; + case 0x018B: tvname = "SHOUTOUT"; break; + case 0x018E: tvname = "BERRY"; break; + case 0x018F: tvname = "REMFEEL"; break; + case 0x0190: tvname = "REMQUAL"; break; + case 0x0191: tvname = "WEBSITE"; break; + case 0x019C: tvname = "CHOICECOS"; break; + case 0x01A1: tvname = "GSYNCID"; break; + case 0x0192: tvname = "PRVIDSAY"; break; + case 0x0193: tvname = "BTLTEST"; break; + case 0x0195: tvname = "GENLOC"; break; + case 0x0199: tvname = "CHOICEFOOD"; break; + case 0x019A: tvname = "HOTELITEM"; break; + case 0x019B: tvname = "TAXISTOP"; break; + case 0x019F: tvname = "MAISTITLE"; break; + case 0x1000: tvname = "ITEMPLUR0"; break; + case 0x1001: tvname = "ITEMPLUR1"; break; + case 0x1100: tvname = "GENDBR"; break; + case 0x1101: tvname = "NUMBRNCH"; break; + case 0x1302: tvname = "iCOLOR2"; break; + case 0x1303: tvname = "iCOLOR3"; break; + case 0x0200: tvname = "NUM1"; break; + case 0x0201: tvname = "NUM2"; break; + case 0x0202: tvname = "NUM3"; break; + case 0x0203: tvname = "NUM4"; break; + case 0x0204: tvname = "NUM5"; break; + case 0x0205: tvname = "NUM6"; break; + case 0x0206: tvname = "NUM7"; break; + case 0x0207: tvname = "NUM8"; break; + case 0x0208: tvname = "NUM9"; break; + default: tvname = varCode.ToString("X4"); break; + } + s += "[VAR" + " " + tvname; + if (length > 1) + { + s += '('; + while (length > 1) + { + // Write arguments + ushort arg = decryptU16(d, ref o, ref v, ref k); + length--; + s += arg.ToString("X4"); + if (length == 1) break; + s += ","; + } + s += ')'; + } + s += "]"; + break; + } + } + } + + private void xytext_FormClosing(object sender, FormClosingEventArgs e) + { + // Save All the old text + if (entry > -1) File.WriteAllBytes(files[entry], getBytesForFile(getCurrentDGLines())); + } + } +} \ No newline at end of file diff --git a/pk3DS/xytext.resx b/pk3DS/xytext.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/pk3DS/xytext.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file