mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-09-07 17:45:32 -05:00
Restructuring and Additions
This commit is contained in:
66
pk3DS/Main.Designer.cs
generated
66
pk3DS/Main.Designer.cs
generated
@@ -45,6 +45,9 @@ private void InitializeComponent()
|
||||
this.L_Game = new System.Windows.Forms.Label();
|
||||
this.pBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.L_About = new System.Windows.Forms.Label();
|
||||
this.B_LevelUp = new System.Windows.Forms.Button();
|
||||
this.B_EggMove = new System.Windows.Forms.Button();
|
||||
this.B_ExeFS = new System.Windows.Forms.Button();
|
||||
this.GB_Tools.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -65,13 +68,16 @@ private void InitializeComponent()
|
||||
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.Size = new System.Drawing.Size(349, 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_ExeFS);
|
||||
this.GB_Tools.Controls.Add(this.B_EggMove);
|
||||
this.GB_Tools.Controls.Add(this.B_LevelUp);
|
||||
this.GB_Tools.Controls.Add(this.B_StoryText);
|
||||
this.GB_Tools.Controls.Add(this.B_Item);
|
||||
this.GB_Tools.Controls.Add(this.B_Move);
|
||||
@@ -84,7 +90,7 @@ private void InitializeComponent()
|
||||
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.Size = new System.Drawing.Size(430, 110);
|
||||
this.GB_Tools.TabIndex = 2;
|
||||
this.GB_Tools.TabStop = false;
|
||||
this.GB_Tools.Text = "ROM Editing Tools";
|
||||
@@ -101,7 +107,7 @@ private void InitializeComponent()
|
||||
//
|
||||
// B_Item
|
||||
//
|
||||
this.B_Item.Location = new System.Drawing.Point(218, 48);
|
||||
this.B_Item.Location = new System.Drawing.Point(218, 77);
|
||||
this.B_Item.Name = "B_Item";
|
||||
this.B_Item.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_Item.TabIndex = 7;
|
||||
@@ -111,7 +117,7 @@ private void InitializeComponent()
|
||||
//
|
||||
// B_Move
|
||||
//
|
||||
this.B_Move.Location = new System.Drawing.Point(218, 19);
|
||||
this.B_Move.Location = new System.Drawing.Point(324, 19);
|
||||
this.B_Move.Name = "B_Move";
|
||||
this.B_Move.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_Move.TabIndex = 6;
|
||||
@@ -121,7 +127,7 @@ private void InitializeComponent()
|
||||
//
|
||||
// B_Evolution
|
||||
//
|
||||
this.B_Evolution.Location = new System.Drawing.Point(112, 48);
|
||||
this.B_Evolution.Location = new System.Drawing.Point(218, 19);
|
||||
this.B_Evolution.Name = "B_Evolution";
|
||||
this.B_Evolution.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_Evolution.TabIndex = 5;
|
||||
@@ -141,7 +147,7 @@ private void InitializeComponent()
|
||||
//
|
||||
// B_MegaEvo
|
||||
//
|
||||
this.B_MegaEvo.Location = new System.Drawing.Point(112, 77);
|
||||
this.B_MegaEvo.Location = new System.Drawing.Point(218, 48);
|
||||
this.B_MegaEvo.Name = "B_MegaEvo";
|
||||
this.B_MegaEvo.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_MegaEvo.TabIndex = 3;
|
||||
@@ -151,7 +157,7 @@ private void InitializeComponent()
|
||||
//
|
||||
// B_Wild
|
||||
//
|
||||
this.B_Wild.Location = new System.Drawing.Point(6, 77);
|
||||
this.B_Wild.Location = new System.Drawing.Point(112, 77);
|
||||
this.B_Wild.Name = "B_Wild";
|
||||
this.B_Wild.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_Wild.TabIndex = 2;
|
||||
@@ -161,7 +167,7 @@ private void InitializeComponent()
|
||||
//
|
||||
// B_Trainer
|
||||
//
|
||||
this.B_Trainer.Location = new System.Drawing.Point(218, 77);
|
||||
this.B_Trainer.Location = new System.Drawing.Point(112, 48);
|
||||
this.B_Trainer.Name = "B_Trainer";
|
||||
this.B_Trainer.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_Trainer.TabIndex = 1;
|
||||
@@ -193,7 +199,7 @@ private void InitializeComponent()
|
||||
"Deutsch",
|
||||
"Español",
|
||||
"한국"});
|
||||
this.CB_Lang.Location = new System.Drawing.Point(216, 40);
|
||||
this.CB_Lang.Location = new System.Drawing.Point(321, 40);
|
||||
this.CB_Lang.Name = "CB_Lang";
|
||||
this.CB_Lang.Size = new System.Drawing.Size(121, 21);
|
||||
this.CB_Lang.TabIndex = 3;
|
||||
@@ -203,7 +209,7 @@ private void InitializeComponent()
|
||||
//
|
||||
this.L_Lang.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.L_Lang.AutoSize = true;
|
||||
this.L_Lang.Location = new System.Drawing.Point(152, 43);
|
||||
this.L_Lang.Location = new System.Drawing.Point(257, 43);
|
||||
this.L_Lang.Name = "L_Lang";
|
||||
this.L_Lang.Size = new System.Drawing.Size(58, 13);
|
||||
this.L_Lang.TabIndex = 4;
|
||||
@@ -225,7 +231,7 @@ private void InitializeComponent()
|
||||
| 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.Size = new System.Drawing.Size(430, 14);
|
||||
this.pBar1.TabIndex = 6;
|
||||
//
|
||||
// L_About
|
||||
@@ -238,11 +244,42 @@ private void InitializeComponent()
|
||||
this.L_About.Text = "[A]";
|
||||
this.L_About.Click += new System.EventHandler(this.L_About_Click);
|
||||
//
|
||||
// B_LevelUp
|
||||
//
|
||||
this.B_LevelUp.Location = new System.Drawing.Point(324, 77);
|
||||
this.B_LevelUp.Name = "B_LevelUp";
|
||||
this.B_LevelUp.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_LevelUp.TabIndex = 9;
|
||||
this.B_LevelUp.Text = "Level Up Editor";
|
||||
this.B_LevelUp.UseVisualStyleBackColor = true;
|
||||
this.B_LevelUp.Click += new System.EventHandler(this.B_LevelUp_Click);
|
||||
//
|
||||
// B_EggMove
|
||||
//
|
||||
this.B_EggMove.Location = new System.Drawing.Point(324, 48);
|
||||
this.B_EggMove.Name = "B_EggMove";
|
||||
this.B_EggMove.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_EggMove.TabIndex = 10;
|
||||
this.B_EggMove.Text = "EggMove Editor";
|
||||
this.B_EggMove.UseVisualStyleBackColor = true;
|
||||
this.B_EggMove.Click += new System.EventHandler(this.B_EggMove_Click);
|
||||
//
|
||||
// B_ExeFS
|
||||
//
|
||||
this.B_ExeFS.Enabled = false;
|
||||
this.B_ExeFS.Location = new System.Drawing.Point(6, 77);
|
||||
this.B_ExeFS.Name = "B_ExeFS";
|
||||
this.B_ExeFS.Size = new System.Drawing.Size(100, 23);
|
||||
this.B_ExeFS.TabIndex = 11;
|
||||
this.B_ExeFS.Text = "ExeFS Code.bin";
|
||||
this.B_ExeFS.UseVisualStyleBackColor = true;
|
||||
this.B_ExeFS.Click += new System.EventHandler(this.B_ExeFS_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.ClientSize = new System.Drawing.Size(454, 202);
|
||||
this.Controls.Add(this.L_About);
|
||||
this.Controls.Add(this.pBar1);
|
||||
this.Controls.Add(this.L_Game);
|
||||
@@ -252,7 +289,7 @@ private void InitializeComponent()
|
||||
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.MinimumSize = new System.Drawing.Size(470, 240);
|
||||
this.Name = "Main";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "pk3DS";
|
||||
@@ -282,6 +319,9 @@ private void InitializeComponent()
|
||||
private System.Windows.Forms.Label L_Game;
|
||||
private System.Windows.Forms.ProgressBar pBar1;
|
||||
private System.Windows.Forms.Label L_About;
|
||||
private System.Windows.Forms.Button B_ExeFS;
|
||||
private System.Windows.Forms.Button B_EggMove;
|
||||
private System.Windows.Forms.Button B_LevelUp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
117
pk3DS/Main.cs
117
pk3DS/Main.cs
@@ -111,26 +111,9 @@ private void B_StoryText_Click(object sender, EventArgs e)
|
||||
if (Directory.Exists(toEdit)) Directory.Delete(toEdit, true);
|
||||
}).Start();
|
||||
}
|
||||
private void B_Wild_Click(object sender, EventArgs e)
|
||||
private void B_ExeFS_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 encdata = "encdata";
|
||||
string encdataGARC = getGARCFileName(encdata);
|
||||
threadGet(TB_Path.Text + encdataGARC, encdata, true, false);
|
||||
while (threads > 0) // Let threads complete
|
||||
Thread.Sleep(50);
|
||||
|
||||
Invoke((Action)(() => { new RSWE(oras, Directory.GetFiles(encdata)).ShowDialog(); }));
|
||||
// When closed, create a new thread to set the GARC back.
|
||||
|
||||
threadSet(TB_Path.Text + encdataGARC, encdata);
|
||||
while (threads > 0) // Let threads complete
|
||||
Thread.Sleep(100);
|
||||
if (Directory.Exists(encdata)) Directory.Delete(encdata, true);
|
||||
}).Start();
|
||||
Util.Alert("Not implemented yet.");
|
||||
}
|
||||
private void B_Personal_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -151,22 +134,6 @@ private void B_Personal_Click(object sender, EventArgs e)
|
||||
if (Directory.Exists(toEdit)) Directory.Delete(toEdit, true);
|
||||
}).Start();
|
||||
}
|
||||
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; }
|
||||
@@ -204,6 +171,66 @@ private void B_Trainer_Click(object sender, EventArgs e)
|
||||
if (Directory.Exists(trpoke)) Directory.Delete(trpoke, true);
|
||||
}).Start();
|
||||
}
|
||||
private void B_Wild_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 encdata = "encdata";
|
||||
string encdataGARC = getGARCFileName(encdata);
|
||||
threadGet(TB_Path.Text + encdataGARC, encdata, true, false);
|
||||
while (threads > 0) // Let threads complete
|
||||
Thread.Sleep(50);
|
||||
|
||||
Invoke((Action)(() => { new RSWE(oras, Directory.GetFiles(encdata)).ShowDialog(); }));
|
||||
// When closed, create a new thread to set the GARC back.
|
||||
|
||||
threadSet(TB_Path.Text + encdataGARC, encdata);
|
||||
while (threads > 0) // Let threads complete
|
||||
Thread.Sleep(100);
|
||||
if (Directory.Exists(encdata)) Directory.Delete(encdata, true);
|
||||
}).Start();
|
||||
}
|
||||
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_Item_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_LevelUp_Click(object sender, EventArgs e)
|
||||
{
|
||||
Util.Alert("Not implemented yet.");
|
||||
}
|
||||
private void B_EggMove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (threads > 0) { Util.Alert("Please wait for all operations to finish first."); return; }
|
||||
new Thread(() =>
|
||||
{
|
||||
string toEdit = "eggmove";
|
||||
string GARC = getGARCFileName(toEdit);
|
||||
threadGet(TB_Path.Text + GARC, toEdit, true, true);
|
||||
while (threads > 0) // Let threads complete
|
||||
Thread.Sleep(100);
|
||||
|
||||
Invoke((Action)(() => { new EggMove(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();
|
||||
}
|
||||
|
||||
// GARC Requests
|
||||
public bool getGARC(string infile, string outfolder, bool PB, bool bypassExt = false)
|
||||
@@ -245,17 +272,29 @@ public string getGARCFileName(string request)
|
||||
string ans = "";
|
||||
switch (request)
|
||||
{
|
||||
case "encdata": ans = (oras) ? getFileName(0, 1, 3) : getFileName(0, 1, 2);
|
||||
break;
|
||||
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;
|
||||
case "encdata": ans = (oras) ? getFileName(0, 1, 3) : getFileName(0, 1, 2);
|
||||
case "move": ans = (oras) ? getFileName(1, 8, 9) : getFileName(2, 1, 2);
|
||||
break;
|
||||
case "eggmove": ans = (oras) ? getFileName(1, 9, 0) : getFileName(2, 1, 3);
|
||||
break;
|
||||
case "levelup": ans = (oras) ? getFileName(1, 9, 1) : getFileName(2, 1, 4);
|
||||
break;
|
||||
case "evolution": ans = (oras) ? getFileName(1, 9, 2) : getFileName(2, 1, 5);
|
||||
break;
|
||||
case "megaevo": ans = (oras) ? getFileName(1, 9, 3) : getFileName(2, 1, 6);
|
||||
break;
|
||||
case "personal": ans = (oras) ? getFileName(1, 9, 5) : getFileName(2, 1, 8);
|
||||
break;
|
||||
case "item": ans = (oras) ? getFileName(1, 9, 7) : getFileName(2, 2, 0);
|
||||
break;
|
||||
}
|
||||
return ans;
|
||||
@@ -328,5 +367,7 @@ private void L_About_Click(object sender, EventArgs e)
|
||||
"Evolutions, Moves, and Items and more have yet to be implemented.",
|
||||
"Big thanks to the ProjectPokemon community!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
115
pk3DS/Subforms/EggMove.Designer.cs
generated
Normal file
115
pk3DS/Subforms/EggMove.Designer.cs
generated
Normal file
@@ -0,0 +1,115 @@
|
||||
namespace pk3DS
|
||||
{
|
||||
partial class EggMove
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.dgv = new System.Windows.Forms.DataGridView();
|
||||
this.CB_Species = new System.Windows.Forms.ComboBox();
|
||||
this.L_Species = new System.Windows.Forms.Label();
|
||||
this.B_RandAll = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dgv
|
||||
//
|
||||
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.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgv.Location = new System.Drawing.Point(12, 41);
|
||||
this.dgv.Name = "dgv";
|
||||
this.dgv.Size = new System.Drawing.Size(282, 359);
|
||||
this.dgv.TabIndex = 0;
|
||||
//
|
||||
// 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_RandAll
|
||||
//
|
||||
this.B_RandAll.Location = new System.Drawing.Point(197, 10);
|
||||
this.B_RandAll.Name = "B_RandAll";
|
||||
this.B_RandAll.Size = new System.Drawing.Size(46, 23);
|
||||
this.B_RandAll.TabIndex = 4;
|
||||
this.B_RandAll.Text = "Rand";
|
||||
this.B_RandAll.UseVisualStyleBackColor = true;
|
||||
this.B_RandAll.Click += new System.EventHandler(this.B_RandAll_Click);
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(249, 10);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(46, 23);
|
||||
this.button1.TabIndex = 5;
|
||||
this.button1.Text = "Dump";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// EggMove
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(306, 412);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.B_RandAll);
|
||||
this.Controls.Add(this.L_Species);
|
||||
this.Controls.Add(this.CB_Species);
|
||||
this.Controls.Add(this.dgv);
|
||||
this.MinimumSize = new System.Drawing.Size(322, 450);
|
||||
this.Name = "EggMove";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Egg Move Editor";
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dgv;
|
||||
private System.Windows.Forms.ComboBox CB_Species;
|
||||
private System.Windows.Forms.Label L_Species;
|
||||
private System.Windows.Forms.Button B_RandAll;
|
||||
private System.Windows.Forms.Button button1;
|
||||
}
|
||||
}
|
||||
140
pk3DS/Subforms/EggMove.cs
Normal file
140
pk3DS/Subforms/EggMove.cs
Normal file
@@ -0,0 +1,140 @@
|
||||
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 EggMove : Form
|
||||
{
|
||||
public EggMove(bool oras)
|
||||
{
|
||||
InitializeComponent();
|
||||
files = Directory.GetFiles("eggmove");
|
||||
|
||||
movelist = Main.getText((oras) ? 14 : 13);
|
||||
specieslist = Main.getText((oras) ? 98 : 80);
|
||||
specieslist[0] = movelist[0] = "";
|
||||
Array.Resize(ref specieslist, 722);
|
||||
|
||||
sortedmoves = (string[])movelist.Clone();
|
||||
Array.Sort(sortedmoves);
|
||||
sortedspecies = (string[])specieslist.Clone();
|
||||
Array.Sort(sortedspecies);
|
||||
|
||||
foreach (string s in sortedspecies) CB_Species.Items.Add(s);
|
||||
CB_Species.Items.RemoveAt(0);
|
||||
|
||||
setupDGV();
|
||||
CB_Species.SelectedIndex = 0;
|
||||
}
|
||||
private string[] files;
|
||||
private int entry = -1;
|
||||
private string[] movelist;
|
||||
private string[] sortedmoves;
|
||||
private string[] sortedspecies;
|
||||
private string[] specieslist;
|
||||
bool dumping = false;
|
||||
private void setupDGV()
|
||||
{
|
||||
DataGridViewComboBoxColumn dgvMove = new DataGridViewComboBoxColumn();
|
||||
{
|
||||
dgvMove.HeaderText = "Move";
|
||||
dgvMove.DisplayIndex = 0;
|
||||
for (int i = 0; i < movelist.Length; i++)
|
||||
dgvMove.Items.Add(sortedmoves[i]); // add only the Names
|
||||
|
||||
dgvMove.Width = 135;
|
||||
dgvMove.FlatStyle = FlatStyle.Flat;
|
||||
}
|
||||
dgv.Columns.Add(dgvMove);
|
||||
}
|
||||
private void getList()
|
||||
{
|
||||
entry = Array.IndexOf(specieslist, CB_Species.Text);
|
||||
dgv.Rows.Clear();
|
||||
byte[] input = File.ReadAllBytes(files[entry]);
|
||||
if (input.Length == 0) return;
|
||||
int count = BitConverter.ToUInt16(input, 0);
|
||||
if (count < 1) { File.WriteAllBytes(files[entry], new byte[0]); return; }
|
||||
dgv.Rows.Add(count);
|
||||
|
||||
// Fill Entries
|
||||
for (int i = 0; i < count; i++)
|
||||
dgv.Rows[i].Cells[0].Value = movelist[BitConverter.ToUInt16(input, 2 + i * 2)];
|
||||
|
||||
dgv.CancelEdit();
|
||||
}
|
||||
private void setList()
|
||||
{
|
||||
if (entry < 1 || dumping) return;
|
||||
List<ushort> moves = new List<ushort>();
|
||||
for (int i = 0; i < dgv.Rows.Count - 1; i++)
|
||||
{
|
||||
int move = Array.IndexOf(movelist, dgv.Rows[i].Cells[0].Value);
|
||||
if (move > 0) moves.Add((ushort)move);
|
||||
}
|
||||
ushort[] movevals = moves.ToArray(); if (movevals.Length == 0) { File.WriteAllBytes(files[entry], new byte[0]); return; }
|
||||
byte[] movedata = new byte[2 + movevals.Length * 2];
|
||||
Array.Copy(BitConverter.GetBytes((ushort)movevals.Length), movedata, 2);
|
||||
for (int i = 0; i < movevals.Length; i++)
|
||||
Array.Copy(BitConverter.GetBytes((ushort)movevals[i]), 0, movedata, 2 + 2 * i, 2);
|
||||
|
||||
File.WriteAllBytes(files[entry], movedata);
|
||||
}
|
||||
|
||||
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();
|
||||
int count = dgv.Rows.Count - 1;
|
||||
for (int j = 0; j < count; j++)
|
||||
dgv.Rows[j].Cells[0].Value = movelist[rnd.Next(1, movelist.Length)];
|
||||
}
|
||||
setList();
|
||||
Util.Alert("All Pokemon's Egg Moves have been randomized!");
|
||||
}
|
||||
private void B_Dump_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (DialogResult.Yes != Util.Prompt(MessageBoxButtons.YesNo, "Dump all Egg Moves 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 + CB_Species.Text + Environment.NewLine + "======" + Environment.NewLine;
|
||||
for (int j = 0; j < dgv.Rows.Count - 1; j++)
|
||||
result += dgv.Rows[j].Cells[0].Value + Environment.NewLine;
|
||||
|
||||
result += Environment.NewLine;
|
||||
}
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.FileName = "Egg Moves.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
pk3DS/Subforms/xytext.resx
Normal file
120
pk3DS/Subforms/xytext.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -48,6 +48,12 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Subforms\EggMove.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Subforms\EggMove.Designer.cs">
|
||||
<DependentUpon>EggMove.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GARCTool.cs" />
|
||||
<Compile Include="Legal.cs" />
|
||||
<Compile Include="Main.cs">
|
||||
@@ -56,43 +62,46 @@
|
||||
<Compile Include="Main.Designer.cs">
|
||||
<DependentUpon>Main.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Personal.cs">
|
||||
<Compile Include="Subforms\Personal.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Personal.Designer.cs">
|
||||
<Compile Include="Subforms\Personal.Designer.cs">
|
||||
<DependentUpon>Personal.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RSWE.cs">
|
||||
<Compile Include="Subforms\RSWE.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RSWE.designer.cs">
|
||||
<Compile Include="Subforms\RSWE.designer.cs">
|
||||
<DependentUpon>RSWE.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TrainerRand.cs">
|
||||
<Compile Include="Subforms\TrainerRand.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TrainerRand.Designer.cs">
|
||||
<Compile Include="Subforms\TrainerRand.Designer.cs">
|
||||
<DependentUpon>TrainerRand.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RSTE.cs">
|
||||
<Compile Include="Subforms\RSTE.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RSTE.Designer.cs">
|
||||
<Compile Include="Subforms\RSTE.Designer.cs">
|
||||
<DependentUpon>RSTE.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Util.cs" />
|
||||
<Compile Include="xytext.cs">
|
||||
<Compile Include="Subforms\xytext.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="xytext.Designer.cs">
|
||||
<Compile Include="Subforms\xytext.Designer.cs">
|
||||
<DependentUpon>xytext.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Main.resx">
|
||||
<DependentUpon>Main.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Personal.resx">
|
||||
<EmbeddedResource Include="Subforms\EggMove.resx">
|
||||
<DependentUpon>EggMove.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Subforms\Personal.resx">
|
||||
<DependentUpon>Personal.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
@@ -105,13 +114,13 @@
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="RSTE.resx">
|
||||
<EmbeddedResource Include="Subforms\RSTE.resx">
|
||||
<DependentUpon>RSTE.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="RSWE.resx">
|
||||
<EmbeddedResource Include="Subforms\RSWE.resx">
|
||||
<DependentUpon>RSWE.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="xytext.resx">
|
||||
<EmbeddedResource Include="Subforms\xytext.resx">
|
||||
<DependentUpon>xytext.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
|
||||
Reference in New Issue
Block a user