From dbd40bff29d5c2e76b90b61b2ce1d4c08edde71c Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 10 Jan 2015 19:31:39 -0800 Subject: [PATCH] Add Evolution Editor --- pk3DS/Main.cs | 17 +- pk3DS/Subforms/Evolution.Designer.cs | 594 +++++++++++++++++++++++++++ pk3DS/Subforms/Evolution.cs | 245 +++++++++++ pk3DS/Subforms/Evolution.resx | 120 ++++++ pk3DS/pk3DS.csproj | 9 + 5 files changed, 984 insertions(+), 1 deletion(-) create mode 100644 pk3DS/Subforms/Evolution.Designer.cs create mode 100644 pk3DS/Subforms/Evolution.cs create mode 100644 pk3DS/Subforms/Evolution.resx diff --git a/pk3DS/Main.cs b/pk3DS/Main.cs index f35c476..630c303 100644 --- a/pk3DS/Main.cs +++ b/pk3DS/Main.cs @@ -194,7 +194,22 @@ private void B_Wild_Click(object sender, EventArgs e) } private void B_Evolution_Click(object sender, EventArgs e) { - Util.Alert("Not implemented yet."); + if (threads > 0) { Util.Alert("Please wait for all operations to finish first."); return; } + new Thread(() => + { + string toEdit = "evolution"; + string GARC = getGARCFileName(toEdit); + threadGet(TB_Path.Text + GARC, toEdit, true, true); + while (threads > 0) // Let threads complete + Thread.Sleep(100); + + Invoke((Action)(() => { new Evolution(oras).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(); } private void B_MegaEvo_Click(object sender, EventArgs e) { diff --git a/pk3DS/Subforms/Evolution.Designer.cs b/pk3DS/Subforms/Evolution.Designer.cs new file mode 100644 index 0000000..5a6732f --- /dev/null +++ b/pk3DS/Subforms/Evolution.Designer.cs @@ -0,0 +1,594 @@ +namespace pk3DS +{ + partial class Evolution + { + /// + /// 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_Species = new System.Windows.Forms.ComboBox(); + this.L_Species = new System.Windows.Forms.Label(); + this.B_Dump = new System.Windows.Forms.Button(); + this.CB_M1 = new System.Windows.Forms.ComboBox(); + this.L_M1 = new System.Windows.Forms.Label(); + this.CB_I1 = new System.Windows.Forms.ComboBox(); + this.CB_P1 = new System.Windows.Forms.ComboBox(); + this.CB_P2 = new System.Windows.Forms.ComboBox(); + this.CB_I2 = new System.Windows.Forms.ComboBox(); + this.L_M2 = new System.Windows.Forms.Label(); + this.CB_M2 = new System.Windows.Forms.ComboBox(); + this.CB_P3 = new System.Windows.Forms.ComboBox(); + this.CB_I3 = new System.Windows.Forms.ComboBox(); + this.L_M3 = new System.Windows.Forms.Label(); + this.CB_M3 = new System.Windows.Forms.ComboBox(); + this.CB_P4 = new System.Windows.Forms.ComboBox(); + this.CB_I4 = new System.Windows.Forms.ComboBox(); + this.L_M4 = new System.Windows.Forms.Label(); + this.CB_M4 = new System.Windows.Forms.ComboBox(); + this.CB_P5 = new System.Windows.Forms.ComboBox(); + this.CB_I5 = new System.Windows.Forms.ComboBox(); + this.L_M5 = new System.Windows.Forms.Label(); + this.CB_M5 = new System.Windows.Forms.ComboBox(); + this.CB_P8 = new System.Windows.Forms.ComboBox(); + this.CB_I8 = new System.Windows.Forms.ComboBox(); + this.L_M8 = new System.Windows.Forms.Label(); + this.CB_M8 = new System.Windows.Forms.ComboBox(); + this.CB_P7 = new System.Windows.Forms.ComboBox(); + this.CB_I7 = new System.Windows.Forms.ComboBox(); + this.L_M7 = new System.Windows.Forms.Label(); + this.CB_M7 = new System.Windows.Forms.ComboBox(); + this.CB_P6 = new System.Windows.Forms.ComboBox(); + this.CB_I6 = new System.Windows.Forms.ComboBox(); + this.L_M6 = new System.Windows.Forms.Label(); + this.CB_M6 = new System.Windows.Forms.ComboBox(); + this.PB_1 = new System.Windows.Forms.PictureBox(); + this.PB_2 = new System.Windows.Forms.PictureBox(); + this.PB_4 = new System.Windows.Forms.PictureBox(); + this.PB_3 = new System.Windows.Forms.PictureBox(); + this.PB_6 = new System.Windows.Forms.PictureBox(); + this.PB_5 = new System.Windows.Forms.PictureBox(); + this.PB_8 = new System.Windows.Forms.PictureBox(); + this.PB_7 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.PB_1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_6)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_8)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_7)).BeginInit(); + this.SuspendLayout(); + // + // CB_Species + // + this.CB_Species.FormattingEnabled = true; + this.CB_Species.Location = new System.Drawing.Point(66, 12); + this.CB_Species.Name = "CB_Species"; + this.CB_Species.Size = new System.Drawing.Size(121, 21); + this.CB_Species.TabIndex = 1; + this.CB_Species.SelectedIndexChanged += new System.EventHandler(this.changeEntry); + // + // L_Species + // + this.L_Species.AutoSize = true; + this.L_Species.Location = new System.Drawing.Point(12, 15); + this.L_Species.Name = "L_Species"; + this.L_Species.Size = new System.Drawing.Size(48, 13); + this.L_Species.TabIndex = 2; + this.L_Species.Text = "Species:"; + // + // B_Dump + // + this.B_Dump.Location = new System.Drawing.Point(193, 11); + this.B_Dump.Name = "B_Dump"; + this.B_Dump.Size = new System.Drawing.Size(59, 23); + this.B_Dump.TabIndex = 5; + this.B_Dump.Text = "Dump"; + this.B_Dump.UseVisualStyleBackColor = true; + this.B_Dump.Click += new System.EventHandler(this.B_Dump_Click); + // + // CB_M1 + // + this.CB_M1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_M1.DropDownWidth = 200; + this.CB_M1.FormattingEnabled = true; + this.CB_M1.Location = new System.Drawing.Point(79, 46); + this.CB_M1.MaxDropDownItems = 10; + this.CB_M1.Name = "CB_M1"; + this.CB_M1.Size = new System.Drawing.Size(150, 21); + this.CB_M1.TabIndex = 6; + this.CB_M1.SelectedIndexChanged += new System.EventHandler(this.changeMethod); + // + // L_M1 + // + this.L_M1.AutoSize = true; + this.L_M1.Location = new System.Drawing.Point(18, 49); + this.L_M1.Name = "L_M1"; + this.L_M1.Size = new System.Drawing.Size(55, 13); + this.L_M1.TabIndex = 7; + this.L_M1.Text = "Method 1:"; + // + // CB_I1 + // + this.CB_I1.FormattingEnabled = true; + this.CB_I1.Location = new System.Drawing.Point(277, 46); + this.CB_I1.Name = "CB_I1"; + this.CB_I1.Size = new System.Drawing.Size(101, 21); + this.CB_I1.TabIndex = 9; + this.CB_I1.SelectedIndexChanged += new System.EventHandler(this.changeInto); + // + // CB_P1 + // + this.CB_P1.FormattingEnabled = true; + this.CB_P1.Location = new System.Drawing.Point(79, 69); + this.CB_P1.Name = "CB_P1"; + this.CB_P1.Size = new System.Drawing.Size(121, 21); + this.CB_P1.TabIndex = 10; + // + // CB_P2 + // + this.CB_P2.FormattingEnabled = true; + this.CB_P2.Location = new System.Drawing.Point(79, 123); + this.CB_P2.Name = "CB_P2"; + this.CB_P2.Size = new System.Drawing.Size(121, 21); + this.CB_P2.TabIndex = 16; + // + // CB_I2 + // + this.CB_I2.FormattingEnabled = true; + this.CB_I2.Location = new System.Drawing.Point(277, 100); + this.CB_I2.Name = "CB_I2"; + this.CB_I2.Size = new System.Drawing.Size(101, 21); + this.CB_I2.TabIndex = 15; + this.CB_I2.SelectedIndexChanged += new System.EventHandler(this.changeInto); + // + // L_M2 + // + this.L_M2.AutoSize = true; + this.L_M2.Location = new System.Drawing.Point(18, 103); + this.L_M2.Name = "L_M2"; + this.L_M2.Size = new System.Drawing.Size(55, 13); + this.L_M2.TabIndex = 13; + this.L_M2.Text = "Method 2:"; + // + // CB_M2 + // + this.CB_M2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_M2.DropDownWidth = 200; + this.CB_M2.FormattingEnabled = true; + this.CB_M2.Location = new System.Drawing.Point(79, 100); + this.CB_M2.MaxDropDownItems = 10; + this.CB_M2.Name = "CB_M2"; + this.CB_M2.Size = new System.Drawing.Size(150, 21); + this.CB_M2.TabIndex = 12; + this.CB_M2.SelectedIndexChanged += new System.EventHandler(this.changeMethod); + // + // CB_P3 + // + this.CB_P3.FormattingEnabled = true; + this.CB_P3.Location = new System.Drawing.Point(79, 177); + this.CB_P3.Name = "CB_P3"; + this.CB_P3.Size = new System.Drawing.Size(121, 21); + this.CB_P3.TabIndex = 22; + // + // CB_I3 + // + this.CB_I3.FormattingEnabled = true; + this.CB_I3.Location = new System.Drawing.Point(277, 154); + this.CB_I3.Name = "CB_I3"; + this.CB_I3.Size = new System.Drawing.Size(101, 21); + this.CB_I3.TabIndex = 21; + this.CB_I3.SelectedIndexChanged += new System.EventHandler(this.changeInto); + // + // L_M3 + // + this.L_M3.AutoSize = true; + this.L_M3.Location = new System.Drawing.Point(18, 157); + this.L_M3.Name = "L_M3"; + this.L_M3.Size = new System.Drawing.Size(55, 13); + this.L_M3.TabIndex = 19; + this.L_M3.Text = "Method 3:"; + // + // CB_M3 + // + this.CB_M3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_M3.DropDownWidth = 200; + this.CB_M3.FormattingEnabled = true; + this.CB_M3.Location = new System.Drawing.Point(79, 154); + this.CB_M3.MaxDropDownItems = 10; + this.CB_M3.Name = "CB_M3"; + this.CB_M3.Size = new System.Drawing.Size(150, 21); + this.CB_M3.TabIndex = 18; + this.CB_M3.SelectedIndexChanged += new System.EventHandler(this.changeMethod); + // + // CB_P4 + // + this.CB_P4.FormattingEnabled = true; + this.CB_P4.Location = new System.Drawing.Point(79, 231); + this.CB_P4.Name = "CB_P4"; + this.CB_P4.Size = new System.Drawing.Size(121, 21); + this.CB_P4.TabIndex = 28; + // + // CB_I4 + // + this.CB_I4.FormattingEnabled = true; + this.CB_I4.Location = new System.Drawing.Point(277, 208); + this.CB_I4.Name = "CB_I4"; + this.CB_I4.Size = new System.Drawing.Size(101, 21); + this.CB_I4.TabIndex = 27; + this.CB_I4.SelectedIndexChanged += new System.EventHandler(this.changeInto); + // + // L_M4 + // + this.L_M4.AutoSize = true; + this.L_M4.Location = new System.Drawing.Point(18, 211); + this.L_M4.Name = "L_M4"; + this.L_M4.Size = new System.Drawing.Size(55, 13); + this.L_M4.TabIndex = 25; + this.L_M4.Text = "Method 4:"; + // + // CB_M4 + // + this.CB_M4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_M4.DropDownWidth = 200; + this.CB_M4.FormattingEnabled = true; + this.CB_M4.Location = new System.Drawing.Point(79, 208); + this.CB_M4.MaxDropDownItems = 10; + this.CB_M4.Name = "CB_M4"; + this.CB_M4.Size = new System.Drawing.Size(150, 21); + this.CB_M4.TabIndex = 24; + this.CB_M4.SelectedIndexChanged += new System.EventHandler(this.changeMethod); + // + // CB_P5 + // + this.CB_P5.FormattingEnabled = true; + this.CB_P5.Location = new System.Drawing.Point(79, 285); + this.CB_P5.Name = "CB_P5"; + this.CB_P5.Size = new System.Drawing.Size(121, 21); + this.CB_P5.TabIndex = 34; + // + // CB_I5 + // + this.CB_I5.FormattingEnabled = true; + this.CB_I5.Location = new System.Drawing.Point(277, 262); + this.CB_I5.Name = "CB_I5"; + this.CB_I5.Size = new System.Drawing.Size(101, 21); + this.CB_I5.TabIndex = 33; + this.CB_I5.SelectedIndexChanged += new System.EventHandler(this.changeInto); + // + // L_M5 + // + this.L_M5.AutoSize = true; + this.L_M5.Location = new System.Drawing.Point(18, 265); + this.L_M5.Name = "L_M5"; + this.L_M5.Size = new System.Drawing.Size(55, 13); + this.L_M5.TabIndex = 31; + this.L_M5.Text = "Method 5:"; + // + // CB_M5 + // + this.CB_M5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_M5.DropDownWidth = 200; + this.CB_M5.FormattingEnabled = true; + this.CB_M5.Location = new System.Drawing.Point(79, 262); + this.CB_M5.MaxDropDownItems = 10; + this.CB_M5.Name = "CB_M5"; + this.CB_M5.Size = new System.Drawing.Size(150, 21); + this.CB_M5.TabIndex = 30; + this.CB_M5.SelectedIndexChanged += new System.EventHandler(this.changeMethod); + // + // CB_P8 + // + this.CB_P8.FormattingEnabled = true; + this.CB_P8.Location = new System.Drawing.Point(79, 447); + this.CB_P8.Name = "CB_P8"; + this.CB_P8.Size = new System.Drawing.Size(121, 21); + this.CB_P8.TabIndex = 52; + // + // CB_I8 + // + this.CB_I8.FormattingEnabled = true; + this.CB_I8.Location = new System.Drawing.Point(277, 424); + this.CB_I8.Name = "CB_I8"; + this.CB_I8.Size = new System.Drawing.Size(101, 21); + this.CB_I8.TabIndex = 51; + this.CB_I8.SelectedIndexChanged += new System.EventHandler(this.changeInto); + // + // L_M8 + // + this.L_M8.AutoSize = true; + this.L_M8.Location = new System.Drawing.Point(18, 427); + this.L_M8.Name = "L_M8"; + this.L_M8.Size = new System.Drawing.Size(55, 13); + this.L_M8.TabIndex = 49; + this.L_M8.Text = "Method 8:"; + // + // CB_M8 + // + this.CB_M8.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_M8.DropDownWidth = 200; + this.CB_M8.FormattingEnabled = true; + this.CB_M8.Location = new System.Drawing.Point(79, 424); + this.CB_M8.MaxDropDownItems = 10; + this.CB_M8.Name = "CB_M8"; + this.CB_M8.Size = new System.Drawing.Size(150, 21); + this.CB_M8.TabIndex = 48; + this.CB_M8.SelectedIndexChanged += new System.EventHandler(this.changeMethod); + // + // CB_P7 + // + this.CB_P7.FormattingEnabled = true; + this.CB_P7.Location = new System.Drawing.Point(79, 393); + this.CB_P7.Name = "CB_P7"; + this.CB_P7.Size = new System.Drawing.Size(121, 21); + this.CB_P7.TabIndex = 46; + // + // CB_I7 + // + this.CB_I7.FormattingEnabled = true; + this.CB_I7.Location = new System.Drawing.Point(277, 370); + this.CB_I7.Name = "CB_I7"; + this.CB_I7.Size = new System.Drawing.Size(101, 21); + this.CB_I7.TabIndex = 45; + this.CB_I7.SelectedIndexChanged += new System.EventHandler(this.changeInto); + // + // L_M7 + // + this.L_M7.AutoSize = true; + this.L_M7.Location = new System.Drawing.Point(18, 373); + this.L_M7.Name = "L_M7"; + this.L_M7.Size = new System.Drawing.Size(55, 13); + this.L_M7.TabIndex = 43; + this.L_M7.Text = "Method 7:"; + // + // CB_M7 + // + this.CB_M7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_M7.DropDownWidth = 200; + this.CB_M7.FormattingEnabled = true; + this.CB_M7.Location = new System.Drawing.Point(79, 370); + this.CB_M7.MaxDropDownItems = 10; + this.CB_M7.Name = "CB_M7"; + this.CB_M7.Size = new System.Drawing.Size(150, 21); + this.CB_M7.TabIndex = 42; + this.CB_M7.SelectedIndexChanged += new System.EventHandler(this.changeMethod); + // + // CB_P6 + // + this.CB_P6.FormattingEnabled = true; + this.CB_P6.Location = new System.Drawing.Point(79, 339); + this.CB_P6.Name = "CB_P6"; + this.CB_P6.Size = new System.Drawing.Size(121, 21); + this.CB_P6.TabIndex = 40; + // + // CB_I6 + // + this.CB_I6.FormattingEnabled = true; + this.CB_I6.Location = new System.Drawing.Point(277, 316); + this.CB_I6.Name = "CB_I6"; + this.CB_I6.Size = new System.Drawing.Size(101, 21); + this.CB_I6.TabIndex = 39; + this.CB_I6.SelectedIndexChanged += new System.EventHandler(this.changeInto); + // + // L_M6 + // + this.L_M6.AutoSize = true; + this.L_M6.Location = new System.Drawing.Point(18, 319); + this.L_M6.Name = "L_M6"; + this.L_M6.Size = new System.Drawing.Size(55, 13); + this.L_M6.TabIndex = 37; + this.L_M6.Text = "Method 6:"; + // + // CB_M6 + // + this.CB_M6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_M6.DropDownWidth = 200; + this.CB_M6.FormattingEnabled = true; + this.CB_M6.Location = new System.Drawing.Point(79, 316); + this.CB_M6.MaxDropDownItems = 10; + this.CB_M6.Name = "CB_M6"; + this.CB_M6.Size = new System.Drawing.Size(150, 21); + this.CB_M6.TabIndex = 36; + this.CB_M6.SelectedIndexChanged += new System.EventHandler(this.changeMethod); + // + // PB_1 + // + this.PB_1.Location = new System.Drawing.Point(235, 46); + this.PB_1.Name = "PB_1"; + this.PB_1.Size = new System.Drawing.Size(40, 30); + this.PB_1.TabIndex = 54; + this.PB_1.TabStop = false; + // + // PB_2 + // + this.PB_2.Location = new System.Drawing.Point(235, 100); + this.PB_2.Name = "PB_2"; + this.PB_2.Size = new System.Drawing.Size(40, 30); + this.PB_2.TabIndex = 55; + this.PB_2.TabStop = false; + // + // PB_4 + // + this.PB_4.Location = new System.Drawing.Point(235, 208); + this.PB_4.Name = "PB_4"; + this.PB_4.Size = new System.Drawing.Size(40, 30); + this.PB_4.TabIndex = 57; + this.PB_4.TabStop = false; + // + // PB_3 + // + this.PB_3.Location = new System.Drawing.Point(235, 154); + this.PB_3.Name = "PB_3"; + this.PB_3.Size = new System.Drawing.Size(40, 30); + this.PB_3.TabIndex = 56; + this.PB_3.TabStop = false; + // + // PB_6 + // + this.PB_6.Location = new System.Drawing.Point(235, 316); + this.PB_6.Name = "PB_6"; + this.PB_6.Size = new System.Drawing.Size(40, 30); + this.PB_6.TabIndex = 59; + this.PB_6.TabStop = false; + // + // PB_5 + // + this.PB_5.Location = new System.Drawing.Point(235, 262); + this.PB_5.Name = "PB_5"; + this.PB_5.Size = new System.Drawing.Size(40, 30); + this.PB_5.TabIndex = 58; + this.PB_5.TabStop = false; + // + // PB_8 + // + this.PB_8.Location = new System.Drawing.Point(235, 424); + this.PB_8.Name = "PB_8"; + this.PB_8.Size = new System.Drawing.Size(40, 30); + this.PB_8.TabIndex = 61; + this.PB_8.TabStop = false; + // + // PB_7 + // + this.PB_7.Location = new System.Drawing.Point(235, 370); + this.PB_7.Name = "PB_7"; + this.PB_7.Size = new System.Drawing.Size(40, 30); + this.PB_7.TabIndex = 60; + this.PB_7.TabStop = false; + // + // Evolution + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(394, 477); + this.Controls.Add(this.PB_8); + this.Controls.Add(this.PB_7); + this.Controls.Add(this.PB_6); + this.Controls.Add(this.PB_5); + this.Controls.Add(this.PB_4); + this.Controls.Add(this.PB_3); + this.Controls.Add(this.PB_2); + this.Controls.Add(this.PB_1); + this.Controls.Add(this.CB_P8); + this.Controls.Add(this.CB_I8); + this.Controls.Add(this.L_M8); + this.Controls.Add(this.CB_M8); + this.Controls.Add(this.CB_P7); + this.Controls.Add(this.CB_I7); + this.Controls.Add(this.L_M7); + this.Controls.Add(this.CB_M7); + this.Controls.Add(this.CB_P6); + this.Controls.Add(this.CB_I6); + this.Controls.Add(this.L_M6); + this.Controls.Add(this.CB_M6); + this.Controls.Add(this.CB_P5); + this.Controls.Add(this.CB_I5); + this.Controls.Add(this.L_M5); + this.Controls.Add(this.CB_M5); + this.Controls.Add(this.CB_P4); + this.Controls.Add(this.CB_I4); + this.Controls.Add(this.L_M4); + this.Controls.Add(this.CB_M4); + this.Controls.Add(this.CB_P3); + this.Controls.Add(this.CB_I3); + this.Controls.Add(this.L_M3); + this.Controls.Add(this.CB_M3); + this.Controls.Add(this.CB_P2); + this.Controls.Add(this.CB_I2); + this.Controls.Add(this.L_M2); + this.Controls.Add(this.CB_M2); + this.Controls.Add(this.CB_P1); + this.Controls.Add(this.CB_I1); + this.Controls.Add(this.L_M1); + this.Controls.Add(this.CB_M1); + this.Controls.Add(this.B_Dump); + this.Controls.Add(this.L_Species); + this.Controls.Add(this.CB_Species); + this.MaximizeBox = false; + this.MaximumSize = new System.Drawing.Size(410, 515); + this.MinimumSize = new System.Drawing.Size(410, 515); + this.Name = "Evolution"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Evolution Editor"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.formClosing); + ((System.ComponentModel.ISupportInitialize)(this.PB_1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_6)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_8)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PB_7)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ComboBox CB_Species; + private System.Windows.Forms.Label L_Species; + private System.Windows.Forms.Button B_Dump; + private System.Windows.Forms.ComboBox CB_M1; + private System.Windows.Forms.Label L_M1; + private System.Windows.Forms.ComboBox CB_I1; + private System.Windows.Forms.ComboBox CB_P1; + private System.Windows.Forms.ComboBox CB_P2; + private System.Windows.Forms.ComboBox CB_I2; + private System.Windows.Forms.Label L_M2; + private System.Windows.Forms.ComboBox CB_M2; + private System.Windows.Forms.ComboBox CB_P3; + private System.Windows.Forms.ComboBox CB_I3; + private System.Windows.Forms.Label L_M3; + private System.Windows.Forms.ComboBox CB_M3; + private System.Windows.Forms.ComboBox CB_P4; + private System.Windows.Forms.ComboBox CB_I4; + private System.Windows.Forms.Label L_M4; + private System.Windows.Forms.ComboBox CB_M4; + private System.Windows.Forms.ComboBox CB_P5; + private System.Windows.Forms.ComboBox CB_I5; + private System.Windows.Forms.Label L_M5; + private System.Windows.Forms.ComboBox CB_M5; + private System.Windows.Forms.ComboBox CB_P8; + private System.Windows.Forms.ComboBox CB_I8; + private System.Windows.Forms.Label L_M8; + private System.Windows.Forms.ComboBox CB_M8; + private System.Windows.Forms.ComboBox CB_P7; + private System.Windows.Forms.ComboBox CB_I7; + private System.Windows.Forms.Label L_M7; + private System.Windows.Forms.ComboBox CB_M7; + private System.Windows.Forms.ComboBox CB_P6; + private System.Windows.Forms.ComboBox CB_I6; + private System.Windows.Forms.Label L_M6; + private System.Windows.Forms.ComboBox CB_M6; + private System.Windows.Forms.PictureBox PB_1; + private System.Windows.Forms.PictureBox PB_2; + private System.Windows.Forms.PictureBox PB_4; + private System.Windows.Forms.PictureBox PB_3; + private System.Windows.Forms.PictureBox PB_6; + private System.Windows.Forms.PictureBox PB_5; + private System.Windows.Forms.PictureBox PB_8; + private System.Windows.Forms.PictureBox PB_7; + } +} \ No newline at end of file diff --git a/pk3DS/Subforms/Evolution.cs b/pk3DS/Subforms/Evolution.cs new file mode 100644 index 0000000..e29dd7d --- /dev/null +++ b/pk3DS/Subforms/Evolution.cs @@ -0,0 +1,245 @@ +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 Evolution : Form + { + public Evolution(bool oras) + { + InitializeComponent(); + files = Directory.GetFiles("evolution"); + + specieslist = Main.getText((oras) ? 98 : 80); + movelist = Main.getText((oras) ? 14 : 13); + itemlist = Main.getText((oras) ? 114 : 96); + typelist = Main.getText((oras) ? 18 : 17); + specieslist[0] = movelist[0] = itemlist[0] = ""; + Array.Resize(ref specieslist, 722); + + EvolutionMethods = new string[] { + "", + "Level Up with Friendship", + "Level Up at Morning", + "Level Up at Night", + "Level Up", + "Trade", + "Trade with Held Item", + String.Format("Trade for opposite {0}/{1}", specieslist[588], specieslist[612]), // Shelmet&Karrablast + "Used Item", + "Level Up (Attack > Defense)", + "Level Up (Attack = Defense)", + "Level Up (Attack < Defense)", + "Level Up (Random < 5)", + "Level Up (Random > 5)", + String.Format("Level Up ({0})", specieslist[291]), // Ninjask + String.Format("Level Up ({0})", specieslist[292]), // Shedinja + "Level Up (Beauty)", + "Level Up with Held Item (Male)", + "Level Up with Held Item (Female)", + "Level Up with Held Item (Day)", + "Level Up with Held Item (Night)", + "Level Up with Move", + "Level up with Party", + "Level Up Male", + "Level Up Female", + "Level Up at Electric", + "Level Up at Forest", + "Level Up at Cold", + "Level Up with 3DS Upside Down", + "Level Up with 50 Affection + MoveType", + String.Format("{0} Type in Party", typelist[16]), + "Overworld Rain", + "Level Up (@) at Night", + "Level Up (@) at Night", + "Level Up Female (SetForm 1)", + }; + + mb = new ComboBox[] { CB_M1, CB_M2, CB_M3, CB_M4, CB_M5, CB_M6, CB_M7, CB_M8 }; + pb = new ComboBox[] { CB_P1, CB_P2, CB_P3, CB_P4, CB_P5, CB_P6, CB_P7, CB_P8 }; + rb = new ComboBox[] { CB_I1, CB_I2, CB_I3, CB_I4, CB_I5, CB_I6, CB_I7, CB_I8 }; + pic = new PictureBox[] { PB_1, PB_2, PB_3, PB_4, PB_5, PB_6, PB_7, PB_8 }; + + foreach (ComboBox cb in mb) { foreach (string s in EvolutionMethods) cb.Items.Add(s); } + foreach (ComboBox cb in rb) { foreach (string s in specieslist) cb.Items.Add(s); } + + sortedspecies = (string[])specieslist.Clone(); + Array.Sort(sortedspecies); + + CB_Species.Items.Clear(); + foreach (string s in sortedspecies) CB_Species.Items.Add(s); + CB_Species.Items.RemoveAt(0); + + CB_Species.SelectedIndex = 0; + } + private string[] files; + private ComboBox[] pb; + private ComboBox[] rb; + private ComboBox[] mb; + private PictureBox[] pic; + private int entry = -1; + private string[] specieslist; + private string[] sortedspecies; + private string[] movelist; + private string[] itemlist; + private string[] typelist; + private string[] EvolutionMethods; + bool dumping = false; + private void getList() + { + entry = Array.IndexOf(specieslist, CB_Species.Text); + byte[] input = File.ReadAllBytes(files[entry]); + if (input.Length != 0x30) return; // error + + for (int i = 0; i < 8; i++) + { + int method = BitConverter.ToUInt16(input, 0 + 6 * i); + int param = BitConverter.ToUInt16(input, 2 + 6 * i); + int poke = BitConverter.ToUInt16(input, 4 + 6 * i); + if (method > 34) return; // Invalid! + + mb[i].SelectedIndex = method; // Which will trigger the params cb to reload the valid params list + pb[i].SelectedIndex = param; + rb[i].SelectedIndex = poke; + } + } + private void setList() + { + if (entry < 1 || dumping) return; + + List methods = new List(); + for (int i = 0; i < 8; i++) + { + // Each Evolution Method is comprised of 6 bytes. + byte[] method = new byte[6]; + int methodval = mb[i].SelectedIndex; + int param = pb[i].SelectedIndex; + int poke = rb[i].SelectedIndex; + + if (poke > 0 && methodval > 0) + { + Array.Copy(BitConverter.GetBytes((ushort)methodval), method, 2); + Array.Copy(BitConverter.GetBytes((ushort)param), 0, method, 2, 2); + Array.Copy(BitConverter.GetBytes((ushort)poke), 0, method, 4, 2); + methods.Add(method); + } + } + + byte[] data = new byte[0x30]; + byte[][] methodList = methods.ToArray(); + for (int i = 0; i < methodList.Length; i++) + Array.Copy(methodList[i], 0, data, i * 6, 6); + + File.WriteAllBytes(files[entry], data); + } + + private void changeEntry(object sender, EventArgs e) + { + setList(); + getList(); + } + + private void B_RandAll_Click(object sender, EventArgs e) + { + Random rnd = new Random(); + for (int i = 0; i < CB_Species.Items.Count; i++) + { + CB_Species.SelectedIndex = i; // Get new Species + getList(); + // Set Data + } + setList(); + Util.Alert("All Pokemon's Evolutions have been randomized!"); + } + private void B_Dump_Click(object sender, EventArgs e) + { + if (DialogResult.Yes != Util.Prompt(MessageBoxButtons.YesNo, "Dump all Evolutions to Text File?")) + return; + + dumping = true; + string result = ""; + for (int i = 0; i < CB_Species.Items.Count; i++) + { + CB_Species.SelectedIndex = i; // Get new Species + result += "======" + Environment.NewLine + entry + " " + CB_Species.Text + Environment.NewLine + "======" + Environment.NewLine; + for (int j = 0; j < 8; j++) + { + int methodval = mb[j].SelectedIndex; + int param = pb[j].SelectedIndex; + int poke = rb[j].SelectedIndex; + if (poke > 0 && methodval > 0) + result += mb[j].Text + ((pb[j].Visible) ? " [" + pb[j].Text + "]" : "") + " into " + rb[j].Text + Environment.NewLine; + } + + result += Environment.NewLine; + } + SaveFileDialog sfd = new SaveFileDialog(); + sfd.FileName = "Evolutions.txt"; + sfd.Filter = "Text File|*.txt"; + + System.Media.SystemSounds.Asterisk.Play(); + if (sfd.ShowDialog() == DialogResult.OK) + { + string path = sfd.FileName; + File.WriteAllText(path, result, System.Text.Encoding.Unicode); + } + dumping = false; + } + + private void formClosing(object sender, FormClosingEventArgs e) + { + setList(); + } + + private void changeMethod(object sender, EventArgs e) + { + int op = Array.IndexOf(mb, sender as ComboBox); + ushort[] methodCase = new ushort[] { + 0,0,0,0,1,0,2,0,2,1,1,1,1,1,1,1,5,2,2,2,2,3,4,1,1,0,0,0, // 27, Past Methods + // New Methods + 1, // 28 - Dark Type Party + 6, // 29 - Affection + MoveType + 1, // 30 - Dark Type + 1, // 31 - Overworld Rain + 1, // 32 - Level @ Day + 1, // 33 - Level @ Night + 1, // 34 - Gender Branch + }; + + pb[op].Visible = pic[op].Visible = rb[op].Visible = (mb[op].SelectedIndex > 0); + + pb[op].Items.Clear(); + int cv = methodCase[mb[op].SelectedIndex]; + switch (cv) + { + case 0: // No Parameter Required + { pb[op].Visible = false; pb[op].Items.Add(""); break; } + case 1: // Level + { for (int i = 0; i <= 100; i++) pb[op].Items.Add(i.ToString()); break; } + case 2: // Items + { for (int i = 0; i < itemlist.Length; i++) pb[op].Items.Add(itemlist[i]); break; } + case 3: // Moves + { for (int i = 0; i < movelist.Length; i++) pb[op].Items.Add(movelist[i]); break; } + case 4: // Species + { for (int i = 0; i < sortedspecies.Length; i++) pb[op].Items.Add(specieslist[i]); break; } + case 5: // 0-255 (Beauty) + { for (int i = 0; i <= 255; i++) pb[op].Items.Add(i.ToString()); break; } + case 6: + { for (int i = 0; i < typelist.Length; i++) pb[op].Items.Add(typelist[i]); break; } + } + pb[op].SelectedIndex = 0; + } + private void changeInto(object sender, EventArgs e) + { + pic[Array.IndexOf(rb, sender as ComboBox)].Image = (Bitmap)Properties.Resources.ResourceManager.GetObject("_" + Array.IndexOf(specieslist, (sender as ComboBox).Text)); + } + } +} + \ No newline at end of file diff --git a/pk3DS/Subforms/Evolution.resx b/pk3DS/Subforms/Evolution.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/pk3DS/Subforms/Evolution.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/pk3DS.csproj b/pk3DS/pk3DS.csproj index 471186a..a394781 100644 --- a/pk3DS/pk3DS.csproj +++ b/pk3DS/pk3DS.csproj @@ -50,6 +50,12 @@ + + Form + + + Evolution.cs + Form @@ -106,6 +112,9 @@ Main.cs + + Evolution.cs + LevelUp.cs