Merge pull request #43 from Mixone-FinallyHere/trade-editor

Add Trade Editor
This commit is contained in:
Miguel
2025-07-28 14:40:51 +02:00
committed by GitHub
8 changed files with 1720 additions and 5 deletions

View File

@@ -230,6 +230,12 @@
<Compile Include="Editors\TextEditor.Designer.cs">
<DependentUpon>TextEditor.cs</DependentUpon>
</Compile>
<Compile Include="Editors\TradeEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Editors\TradeEditor.Designer.cs">
<DependentUpon>TradeEditor.cs</DependentUpon>
</Compile>
<Compile Include="Editors\TrainerEditor.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -346,6 +352,7 @@
<Compile Include="ROMFiles\LevelScriptTrigger.cs" />
<Compile Include="ROMFiles\MapScreenLoadTrigger.cs" />
<Compile Include="ROMFiles\ScriptAction.cs" />
<Compile Include="ROMFiles\TradeData.cs" />
<Compile Include="Script\ScriptCommandPosition.cs" />
<Compile Include="Script\ScriptLabeledSection.cs" />
<Compile Include="Script\ScriptParameter.cs" />
@@ -524,6 +531,9 @@
<EmbeddedResource Include="Editors\TextEditor.resx">
<DependentUpon>TextEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Editors\TradeEditor.resx">
<DependentUpon>TradeEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Editors\TrainerEditor.resx">
<DependentUpon>TrainerEditor.cs</DependentUpon>
</EmbeddedResource>

836
DS_Map/Editors/TradeEditor.Designer.cs generated Normal file
View File

@@ -0,0 +1,836 @@
namespace DSPRE.Editors
{
partial class TradeEditor
{
/// <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.components = new System.ComponentModel.Container();
this.mainPanel = new System.Windows.Forms.Panel();
this.saveAllButton = new System.Windows.Forms.Button();
this.saveTextDataButton = new System.Windows.Forms.Button();
this.saveTradeButton = new System.Windows.Forms.Button();
this.textDataGroupBox = new System.Windows.Forms.GroupBox();
this.nicknameTextBox = new System.Windows.Forms.TextBox();
this.otNameTextBox = new System.Windows.Forms.TextBox();
this.nicknameLabel = new System.Windows.Forms.Label();
this.otNameLabel = new System.Windows.Forms.Label();
this.tradeDataGroupBox = new System.Windows.Forms.GroupBox();
this.requestedComboBox = new System.Windows.Forms.ComboBox();
this.requestedLabel = new System.Windows.Forms.Label();
this.otGenderComboBox = new System.Windows.Forms.ComboBox();
this.otGenderLabel = new System.Windows.Forms.Label();
this.otIDNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.otIDLabel = new System.Windows.Forms.Label();
this.monDataGroupBox = new System.Windows.Forms.GroupBox();
this.monDataPanel = new System.Windows.Forms.Panel();
this.abilityComboBox = new System.Windows.Forms.ComboBox();
this.abilityLabel = new System.Windows.Forms.Label();
this.unknownNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.unknownLabel = new System.Windows.Forms.Label();
this.pidNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.pidLabel = new System.Windows.Forms.Label();
this.langComboBox = new System.Windows.Forms.ComboBox();
this.langLabel = new System.Windows.Forms.Label();
this.heldItemComboBox = new System.Windows.Forms.ComboBox();
this.heldItemLabel = new System.Windows.Forms.Label();
this.contestGroupBox = new System.Windows.Forms.GroupBox();
this.toughNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.smartNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.cuteNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.beautyNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.coolNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.sheenNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.toughLabel = new System.Windows.Forms.Label();
this.smartLabel = new System.Windows.Forms.Label();
this.cuteLabel = new System.Windows.Forms.Label();
this.beautyLabel = new System.Windows.Forms.Label();
this.coolLabel = new System.Windows.Forms.Label();
this.sheenLabel = new System.Windows.Forms.Label();
this.IVGroupBox = new System.Windows.Forms.GroupBox();
this.speIVNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.spdIVNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.spaIVNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.defIVNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.atkIVNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.hpIVNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.speIVLabel = new System.Windows.Forms.Label();
this.spdIVLabel = new System.Windows.Forms.Label();
this.spaIVLabel = new System.Windows.Forms.Label();
this.defIVLabel = new System.Windows.Forms.Label();
this.atkIVLabel = new System.Windows.Forms.Label();
this.hpIVLabel = new System.Windows.Forms.Label();
this.speciesComboBox = new System.Windows.Forms.ComboBox();
this.speciesLabel = new System.Windows.Forms.Label();
this.tradeIDNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.tradeIDLabel = new System.Windows.Forms.Label();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.addFileButton = new System.Windows.Forms.Button();
this.removeLastButton = new System.Windows.Forms.Button();
this.mainPanel.SuspendLayout();
this.textDataGroupBox.SuspendLayout();
this.tradeDataGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.otIDNumericUpDown)).BeginInit();
this.monDataGroupBox.SuspendLayout();
this.monDataPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.unknownNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pidNumericUpDown)).BeginInit();
this.contestGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.toughNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.smartNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.cuteNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.beautyNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.coolNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.sheenNumericUpDown)).BeginInit();
this.IVGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.speIVNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spdIVNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.spaIVNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.defIVNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.atkIVNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.hpIVNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tradeIDNumericUpDown)).BeginInit();
this.SuspendLayout();
//
// mainPanel
//
this.mainPanel.Controls.Add(this.removeLastButton);
this.mainPanel.Controls.Add(this.saveAllButton);
this.mainPanel.Controls.Add(this.addFileButton);
this.mainPanel.Controls.Add(this.saveTextDataButton);
this.mainPanel.Controls.Add(this.saveTradeButton);
this.mainPanel.Controls.Add(this.textDataGroupBox);
this.mainPanel.Controls.Add(this.tradeDataGroupBox);
this.mainPanel.Location = new System.Drawing.Point(12, 12);
this.mainPanel.Name = "mainPanel";
this.mainPanel.Size = new System.Drawing.Size(624, 444);
this.mainPanel.TabIndex = 0;
//
// saveAllButton
//
this.saveAllButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.saveAllButton.Image = global::DSPRE.Properties.Resources.saveButton;
this.saveAllButton.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.saveAllButton.Location = new System.Drawing.Point(470, 389);
this.saveAllButton.Name = "saveAllButton";
this.saveAllButton.Size = new System.Drawing.Size(147, 47);
this.saveAllButton.TabIndex = 6;
this.saveAllButton.Text = "Save All";
this.saveAllButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.saveAllButton.UseVisualStyleBackColor = true;
this.saveAllButton.Click += new System.EventHandler(this.saveAllButton_Click);
//
// saveTextDataButton
//
this.saveTextDataButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.saveTextDataButton.Image = global::DSPRE.Properties.Resources.saveButton;
this.saveTextDataButton.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.saveTextDataButton.Location = new System.Drawing.Point(479, 142);
this.saveTextDataButton.Name = "saveTextDataButton";
this.saveTextDataButton.Size = new System.Drawing.Size(126, 40);
this.saveTextDataButton.TabIndex = 5;
this.saveTextDataButton.Text = "Save Text Data";
this.saveTextDataButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.saveTextDataButton.UseVisualStyleBackColor = true;
this.saveTextDataButton.Click += new System.EventHandler(this.saveTextDataButton_Click);
//
// saveTradeButton
//
this.saveTradeButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.saveTradeButton.Image = global::DSPRE.Properties.Resources.saveButton;
this.saveTradeButton.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.saveTradeButton.Location = new System.Drawing.Point(480, 342);
this.saveTradeButton.Name = "saveTradeButton";
this.saveTradeButton.Size = new System.Drawing.Size(126, 40);
this.saveTradeButton.TabIndex = 4;
this.saveTradeButton.Text = "Save Trade Data";
this.saveTradeButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.saveTradeButton.UseVisualStyleBackColor = true;
this.saveTradeButton.Click += new System.EventHandler(this.saveTradeButton_Click);
//
// textDataGroupBox
//
this.textDataGroupBox.Controls.Add(this.nicknameTextBox);
this.textDataGroupBox.Controls.Add(this.otNameTextBox);
this.textDataGroupBox.Controls.Add(this.nicknameLabel);
this.textDataGroupBox.Controls.Add(this.otNameLabel);
this.textDataGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textDataGroupBox.Location = new System.Drawing.Point(470, 3);
this.textDataGroupBox.Name = "textDataGroupBox";
this.textDataGroupBox.Size = new System.Drawing.Size(147, 133);
this.textDataGroupBox.TabIndex = 3;
this.textDataGroupBox.TabStop = false;
this.textDataGroupBox.Text = "Text Data";
//
// nicknameTextBox
//
this.nicknameTextBox.Location = new System.Drawing.Point(9, 100);
this.nicknameTextBox.Name = "nicknameTextBox";
this.nicknameTextBox.Size = new System.Drawing.Size(126, 22);
this.nicknameTextBox.TabIndex = 17;
//
// otNameTextBox
//
this.otNameTextBox.Location = new System.Drawing.Point(9, 46);
this.otNameTextBox.Name = "otNameTextBox";
this.otNameTextBox.Size = new System.Drawing.Size(126, 22);
this.otNameTextBox.TabIndex = 16;
//
// nicknameLabel
//
this.nicknameLabel.AutoSize = true;
this.nicknameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nicknameLabel.Location = new System.Drawing.Point(6, 79);
this.nicknameLabel.Name = "nicknameLabel";
this.nicknameLabel.Size = new System.Drawing.Size(129, 16);
this.nicknameLabel.TabIndex = 15;
this.nicknameLabel.Text = "Pokémon Nickname";
//
// otNameLabel
//
this.otNameLabel.AutoSize = true;
this.otNameLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.otNameLabel.Location = new System.Drawing.Point(6, 25);
this.otNameLabel.Name = "otNameLabel";
this.otNameLabel.Size = new System.Drawing.Size(66, 16);
this.otNameLabel.TabIndex = 13;
this.otNameLabel.Text = "OT Name";
//
// tradeDataGroupBox
//
this.tradeDataGroupBox.Controls.Add(this.requestedComboBox);
this.tradeDataGroupBox.Controls.Add(this.requestedLabel);
this.tradeDataGroupBox.Controls.Add(this.otGenderComboBox);
this.tradeDataGroupBox.Controls.Add(this.otGenderLabel);
this.tradeDataGroupBox.Controls.Add(this.otIDNumericUpDown);
this.tradeDataGroupBox.Controls.Add(this.otIDLabel);
this.tradeDataGroupBox.Controls.Add(this.monDataGroupBox);
this.tradeDataGroupBox.Controls.Add(this.tradeIDNumericUpDown);
this.tradeDataGroupBox.Controls.Add(this.tradeIDLabel);
this.tradeDataGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tradeDataGroupBox.Location = new System.Drawing.Point(3, 3);
this.tradeDataGroupBox.Name = "tradeDataGroupBox";
this.tradeDataGroupBox.Size = new System.Drawing.Size(461, 437);
this.tradeDataGroupBox.TabIndex = 2;
this.tradeDataGroupBox.TabStop = false;
this.tradeDataGroupBox.Text = "Trade Data";
//
// requestedComboBox
//
this.requestedComboBox.FormattingEnabled = true;
this.requestedComboBox.Location = new System.Drawing.Point(165, 44);
this.requestedComboBox.Name = "requestedComboBox";
this.requestedComboBox.Size = new System.Drawing.Size(150, 24);
this.requestedComboBox.TabIndex = 12;
//
// requestedLabel
//
this.requestedLabel.AutoSize = true;
this.requestedLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.requestedLabel.Location = new System.Drawing.Point(162, 25);
this.requestedLabel.Name = "requestedLabel";
this.requestedLabel.Size = new System.Drawing.Size(135, 16);
this.requestedLabel.TabIndex = 11;
this.requestedLabel.Text = "Requested Pokémon";
//
// otGenderComboBox
//
this.otGenderComboBox.FormattingEnabled = true;
this.otGenderComboBox.Location = new System.Drawing.Point(165, 98);
this.otGenderComboBox.Name = "otGenderComboBox";
this.otGenderComboBox.Size = new System.Drawing.Size(150, 24);
this.otGenderComboBox.TabIndex = 10;
//
// otGenderLabel
//
this.otGenderLabel.AutoSize = true;
this.otGenderLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.otGenderLabel.Location = new System.Drawing.Point(162, 79);
this.otGenderLabel.Name = "otGenderLabel";
this.otGenderLabel.Size = new System.Drawing.Size(74, 16);
this.otGenderLabel.TabIndex = 9;
this.otGenderLabel.Text = "OT Gender";
//
// otIDNumericUpDown
//
this.otIDNumericUpDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.otIDNumericUpDown.Location = new System.Drawing.Point(21, 98);
this.otIDNumericUpDown.Name = "otIDNumericUpDown";
this.otIDNumericUpDown.Size = new System.Drawing.Size(120, 22);
this.otIDNumericUpDown.TabIndex = 6;
//
// otIDLabel
//
this.otIDLabel.AutoSize = true;
this.otIDLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.otIDLabel.Location = new System.Drawing.Point(18, 79);
this.otIDLabel.Name = "otIDLabel";
this.otIDLabel.Size = new System.Drawing.Size(42, 16);
this.otIDLabel.TabIndex = 7;
this.otIDLabel.Text = "OT ID";
//
// monDataGroupBox
//
this.monDataGroupBox.Controls.Add(this.monDataPanel);
this.monDataGroupBox.Location = new System.Drawing.Point(9, 139);
this.monDataGroupBox.Name = "monDataGroupBox";
this.monDataGroupBox.Size = new System.Drawing.Size(441, 288);
this.monDataGroupBox.TabIndex = 5;
this.monDataGroupBox.TabStop = false;
this.monDataGroupBox.Text = "Pokémon Data";
//
// monDataPanel
//
this.monDataPanel.Controls.Add(this.abilityComboBox);
this.monDataPanel.Controls.Add(this.abilityLabel);
this.monDataPanel.Controls.Add(this.unknownNumericUpDown);
this.monDataPanel.Controls.Add(this.unknownLabel);
this.monDataPanel.Controls.Add(this.pidNumericUpDown);
this.monDataPanel.Controls.Add(this.pidLabel);
this.monDataPanel.Controls.Add(this.langComboBox);
this.monDataPanel.Controls.Add(this.langLabel);
this.monDataPanel.Controls.Add(this.heldItemComboBox);
this.monDataPanel.Controls.Add(this.heldItemLabel);
this.monDataPanel.Controls.Add(this.contestGroupBox);
this.monDataPanel.Controls.Add(this.IVGroupBox);
this.monDataPanel.Controls.Add(this.speciesComboBox);
this.monDataPanel.Controls.Add(this.speciesLabel);
this.monDataPanel.Location = new System.Drawing.Point(6, 21);
this.monDataPanel.Name = "monDataPanel";
this.monDataPanel.Size = new System.Drawing.Size(418, 257);
this.monDataPanel.TabIndex = 4;
//
// abilityComboBox
//
this.abilityComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.abilityComboBox.FormattingEnabled = true;
this.abilityComboBox.Location = new System.Drawing.Point(6, 218);
this.abilityComboBox.Name = "abilityComboBox";
this.abilityComboBox.Size = new System.Drawing.Size(147, 24);
this.abilityComboBox.TabIndex = 26;
//
// abilityLabel
//
this.abilityLabel.AutoSize = true;
this.abilityLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.abilityLabel.Location = new System.Drawing.Point(3, 198);
this.abilityLabel.Name = "abilityLabel";
this.abilityLabel.Size = new System.Drawing.Size(101, 16);
this.abilityLabel.TabIndex = 27;
this.abilityLabel.Text = "Ability (Unused)";
//
// unknownNumericUpDown
//
this.unknownNumericUpDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.unknownNumericUpDown.Location = new System.Drawing.Point(294, 220);
this.unknownNumericUpDown.Name = "unknownNumericUpDown";
this.unknownNumericUpDown.Size = new System.Drawing.Size(111, 22);
this.unknownNumericUpDown.TabIndex = 24;
//
// unknownLabel
//
this.unknownLabel.AutoSize = true;
this.unknownLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.unknownLabel.Location = new System.Drawing.Point(291, 201);
this.unknownLabel.Name = "unknownLabel";
this.unknownLabel.Size = new System.Drawing.Size(100, 16);
this.unknownLabel.TabIndex = 25;
this.unknownLabel.Text = "Unknown Value";
//
// pidNumericUpDown
//
this.pidNumericUpDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pidNumericUpDown.Location = new System.Drawing.Point(169, 220);
this.pidNumericUpDown.Name = "pidNumericUpDown";
this.pidNumericUpDown.Size = new System.Drawing.Size(111, 22);
this.pidNumericUpDown.TabIndex = 11;
//
// pidLabel
//
this.pidLabel.AutoSize = true;
this.pidLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pidLabel.Location = new System.Drawing.Point(166, 201);
this.pidLabel.Name = "pidLabel";
this.pidLabel.Size = new System.Drawing.Size(29, 16);
this.pidLabel.TabIndex = 23;
this.pidLabel.Text = "PID";
//
// langComboBox
//
this.langComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.langComboBox.FormattingEnabled = true;
this.langComboBox.Location = new System.Drawing.Point(6, 166);
this.langComboBox.Name = "langComboBox";
this.langComboBox.Size = new System.Drawing.Size(147, 24);
this.langComboBox.TabIndex = 20;
//
// langLabel
//
this.langLabel.AutoSize = true;
this.langLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.langLabel.Location = new System.Drawing.Point(3, 146);
this.langLabel.Name = "langLabel";
this.langLabel.Size = new System.Drawing.Size(106, 16);
this.langLabel.TabIndex = 21;
this.langLabel.Text = "Origin Language";
//
// heldItemComboBox
//
this.heldItemComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.heldItemComboBox.FormattingEnabled = true;
this.heldItemComboBox.Location = new System.Drawing.Point(6, 98);
this.heldItemComboBox.Name = "heldItemComboBox";
this.heldItemComboBox.Size = new System.Drawing.Size(147, 24);
this.heldItemComboBox.TabIndex = 18;
//
// heldItemLabel
//
this.heldItemLabel.AutoSize = true;
this.heldItemLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.heldItemLabel.Location = new System.Drawing.Point(3, 78);
this.heldItemLabel.Name = "heldItemLabel";
this.heldItemLabel.Size = new System.Drawing.Size(64, 16);
this.heldItemLabel.TabIndex = 19;
this.heldItemLabel.Text = "Held Item";
//
// contestGroupBox
//
this.contestGroupBox.Controls.Add(this.toughNumericUpDown);
this.contestGroupBox.Controls.Add(this.smartNumericUpDown);
this.contestGroupBox.Controls.Add(this.cuteNumericUpDown);
this.contestGroupBox.Controls.Add(this.beautyNumericUpDown);
this.contestGroupBox.Controls.Add(this.coolNumericUpDown);
this.contestGroupBox.Controls.Add(this.sheenNumericUpDown);
this.contestGroupBox.Controls.Add(this.toughLabel);
this.contestGroupBox.Controls.Add(this.smartLabel);
this.contestGroupBox.Controls.Add(this.cuteLabel);
this.contestGroupBox.Controls.Add(this.beautyLabel);
this.contestGroupBox.Controls.Add(this.coolLabel);
this.contestGroupBox.Controls.Add(this.sheenLabel);
this.contestGroupBox.Location = new System.Drawing.Point(285, 10);
this.contestGroupBox.Name = "contestGroupBox";
this.contestGroupBox.Size = new System.Drawing.Size(120, 180);
this.contestGroupBox.TabIndex = 17;
this.contestGroupBox.TabStop = false;
this.contestGroupBox.Text = "Contest Stats";
//
// toughNumericUpDown
//
this.toughNumericUpDown.Location = new System.Drawing.Point(64, 148);
this.toughNumericUpDown.Name = "toughNumericUpDown";
this.toughNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.toughNumericUpDown.TabIndex = 16;
//
// smartNumericUpDown
//
this.smartNumericUpDown.Location = new System.Drawing.Point(64, 123);
this.smartNumericUpDown.Name = "smartNumericUpDown";
this.smartNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.smartNumericUpDown.TabIndex = 15;
//
// cuteNumericUpDown
//
this.cuteNumericUpDown.Location = new System.Drawing.Point(64, 97);
this.cuteNumericUpDown.Name = "cuteNumericUpDown";
this.cuteNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.cuteNumericUpDown.TabIndex = 14;
//
// beautyNumericUpDown
//
this.beautyNumericUpDown.Location = new System.Drawing.Point(64, 72);
this.beautyNumericUpDown.Name = "beautyNumericUpDown";
this.beautyNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.beautyNumericUpDown.TabIndex = 13;
//
// coolNumericUpDown
//
this.coolNumericUpDown.Location = new System.Drawing.Point(64, 47);
this.coolNumericUpDown.Name = "coolNumericUpDown";
this.coolNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.coolNumericUpDown.TabIndex = 12;
//
// sheenNumericUpDown
//
this.sheenNumericUpDown.Location = new System.Drawing.Point(64, 22);
this.sheenNumericUpDown.Name = "sheenNumericUpDown";
this.sheenNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.sheenNumericUpDown.TabIndex = 11;
//
// toughLabel
//
this.toughLabel.AutoSize = true;
this.toughLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.toughLabel.Location = new System.Drawing.Point(6, 150);
this.toughLabel.Name = "toughLabel";
this.toughLabel.Size = new System.Drawing.Size(46, 16);
this.toughLabel.TabIndex = 10;
this.toughLabel.Text = "Tough";
//
// smartLabel
//
this.smartLabel.AutoSize = true;
this.smartLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.smartLabel.Location = new System.Drawing.Point(6, 125);
this.smartLabel.Name = "smartLabel";
this.smartLabel.Size = new System.Drawing.Size(42, 16);
this.smartLabel.TabIndex = 9;
this.smartLabel.Text = "Smart";
//
// cuteLabel
//
this.cuteLabel.AutoSize = true;
this.cuteLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cuteLabel.Location = new System.Drawing.Point(6, 100);
this.cuteLabel.Name = "cuteLabel";
this.cuteLabel.Size = new System.Drawing.Size(34, 16);
this.cuteLabel.TabIndex = 8;
this.cuteLabel.Text = "Cute";
//
// beautyLabel
//
this.beautyLabel.AutoSize = true;
this.beautyLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.beautyLabel.Location = new System.Drawing.Point(6, 75);
this.beautyLabel.Name = "beautyLabel";
this.beautyLabel.Size = new System.Drawing.Size(49, 16);
this.beautyLabel.TabIndex = 7;
this.beautyLabel.Text = "Beauty";
//
// coolLabel
//
this.coolLabel.AutoSize = true;
this.coolLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coolLabel.Location = new System.Drawing.Point(6, 50);
this.coolLabel.Name = "coolLabel";
this.coolLabel.Size = new System.Drawing.Size(35, 16);
this.coolLabel.TabIndex = 6;
this.coolLabel.Text = "Cool";
//
// sheenLabel
//
this.sheenLabel.AutoSize = true;
this.sheenLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.sheenLabel.Location = new System.Drawing.Point(6, 25);
this.sheenLabel.Name = "sheenLabel";
this.sheenLabel.Size = new System.Drawing.Size(46, 16);
this.sheenLabel.TabIndex = 5;
this.sheenLabel.Text = "Sheen";
//
// IVGroupBox
//
this.IVGroupBox.Controls.Add(this.speIVNumericUpDown);
this.IVGroupBox.Controls.Add(this.spdIVNumericUpDown);
this.IVGroupBox.Controls.Add(this.spaIVNumericUpDown);
this.IVGroupBox.Controls.Add(this.defIVNumericUpDown);
this.IVGroupBox.Controls.Add(this.atkIVNumericUpDown);
this.IVGroupBox.Controls.Add(this.hpIVNumericUpDown);
this.IVGroupBox.Controls.Add(this.speIVLabel);
this.IVGroupBox.Controls.Add(this.spdIVLabel);
this.IVGroupBox.Controls.Add(this.spaIVLabel);
this.IVGroupBox.Controls.Add(this.defIVLabel);
this.IVGroupBox.Controls.Add(this.atkIVLabel);
this.IVGroupBox.Controls.Add(this.hpIVLabel);
this.IVGroupBox.Location = new System.Drawing.Point(160, 10);
this.IVGroupBox.Name = "IVGroupBox";
this.IVGroupBox.Size = new System.Drawing.Size(120, 180);
this.IVGroupBox.TabIndex = 4;
this.IVGroupBox.TabStop = false;
this.IVGroupBox.Text = "IVs";
//
// speIVNumericUpDown
//
this.speIVNumericUpDown.Location = new System.Drawing.Point(50, 148);
this.speIVNumericUpDown.Name = "speIVNumericUpDown";
this.speIVNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.speIVNumericUpDown.TabIndex = 16;
//
// spdIVNumericUpDown
//
this.spdIVNumericUpDown.Location = new System.Drawing.Point(50, 123);
this.spdIVNumericUpDown.Name = "spdIVNumericUpDown";
this.spdIVNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.spdIVNumericUpDown.TabIndex = 15;
//
// spaIVNumericUpDown
//
this.spaIVNumericUpDown.Location = new System.Drawing.Point(50, 97);
this.spaIVNumericUpDown.Name = "spaIVNumericUpDown";
this.spaIVNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.spaIVNumericUpDown.TabIndex = 14;
//
// defIVNumericUpDown
//
this.defIVNumericUpDown.Location = new System.Drawing.Point(50, 72);
this.defIVNumericUpDown.Name = "defIVNumericUpDown";
this.defIVNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.defIVNumericUpDown.TabIndex = 13;
//
// atkIVNumericUpDown
//
this.atkIVNumericUpDown.Location = new System.Drawing.Point(50, 47);
this.atkIVNumericUpDown.Name = "atkIVNumericUpDown";
this.atkIVNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.atkIVNumericUpDown.TabIndex = 12;
//
// hpIVNumericUpDown
//
this.hpIVNumericUpDown.Location = new System.Drawing.Point(50, 22);
this.hpIVNumericUpDown.Name = "hpIVNumericUpDown";
this.hpIVNumericUpDown.Size = new System.Drawing.Size(51, 22);
this.hpIVNumericUpDown.TabIndex = 11;
//
// speIVLabel
//
this.speIVLabel.AutoSize = true;
this.speIVLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.speIVLabel.Location = new System.Drawing.Point(6, 150);
this.speIVLabel.Name = "speIVLabel";
this.speIVLabel.Size = new System.Drawing.Size(32, 16);
this.speIVLabel.TabIndex = 10;
this.speIVLabel.Text = "Spe";
//
// spdIVLabel
//
this.spdIVLabel.AutoSize = true;
this.spdIVLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.spdIVLabel.Location = new System.Drawing.Point(6, 125);
this.spdIVLabel.Name = "spdIVLabel";
this.spdIVLabel.Size = new System.Drawing.Size(34, 16);
this.spdIVLabel.TabIndex = 9;
this.spdIVLabel.Text = "SpD";
//
// spaIVLabel
//
this.spaIVLabel.AutoSize = true;
this.spaIVLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.spaIVLabel.Location = new System.Drawing.Point(6, 100);
this.spaIVLabel.Name = "spaIVLabel";
this.spaIVLabel.Size = new System.Drawing.Size(33, 16);
this.spaIVLabel.TabIndex = 8;
this.spaIVLabel.Text = "SpA";
//
// defIVLabel
//
this.defIVLabel.AutoSize = true;
this.defIVLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.defIVLabel.Location = new System.Drawing.Point(6, 75);
this.defIVLabel.Name = "defIVLabel";
this.defIVLabel.Size = new System.Drawing.Size(28, 16);
this.defIVLabel.TabIndex = 7;
this.defIVLabel.Text = "Def";
//
// atkIVLabel
//
this.atkIVLabel.AutoSize = true;
this.atkIVLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.atkIVLabel.Location = new System.Drawing.Point(6, 50);
this.atkIVLabel.Name = "atkIVLabel";
this.atkIVLabel.Size = new System.Drawing.Size(26, 16);
this.atkIVLabel.TabIndex = 6;
this.atkIVLabel.Text = "Atk";
//
// hpIVLabel
//
this.hpIVLabel.AutoSize = true;
this.hpIVLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.hpIVLabel.Location = new System.Drawing.Point(6, 25);
this.hpIVLabel.Name = "hpIVLabel";
this.hpIVLabel.Size = new System.Drawing.Size(26, 16);
this.hpIVLabel.TabIndex = 5;
this.hpIVLabel.Text = "HP";
//
// speciesComboBox
//
this.speciesComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.speciesComboBox.FormattingEnabled = true;
this.speciesComboBox.Location = new System.Drawing.Point(6, 30);
this.speciesComboBox.Name = "speciesComboBox";
this.speciesComboBox.Size = new System.Drawing.Size(147, 24);
this.speciesComboBox.TabIndex = 2;
//
// speciesLabel
//
this.speciesLabel.AutoSize = true;
this.speciesLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.speciesLabel.Location = new System.Drawing.Point(3, 10);
this.speciesLabel.Name = "speciesLabel";
this.speciesLabel.Size = new System.Drawing.Size(57, 16);
this.speciesLabel.TabIndex = 3;
this.speciesLabel.Text = "Species";
//
// tradeIDNumericUpDown
//
this.tradeIDNumericUpDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tradeIDNumericUpDown.Location = new System.Drawing.Point(21, 46);
this.tradeIDNumericUpDown.Name = "tradeIDNumericUpDown";
this.tradeIDNumericUpDown.Size = new System.Drawing.Size(120, 22);
this.tradeIDNumericUpDown.TabIndex = 0;
this.tradeIDNumericUpDown.ValueChanged += new System.EventHandler(this.tradeIDNumericUpDown_ValueChanged);
//
// tradeIDLabel
//
this.tradeIDLabel.AutoSize = true;
this.tradeIDLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tradeIDLabel.Location = new System.Drawing.Point(18, 27);
this.tradeIDLabel.Name = "tradeIDLabel";
this.tradeIDLabel.Size = new System.Drawing.Size(60, 16);
this.tradeIDLabel.TabIndex = 1;
this.tradeIDLabel.Text = "Trade ID";
//
// addFileButton
//
this.addFileButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.addFileButton.Image = global::DSPRE.Properties.Resources.addIcon;
this.addFileButton.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.addFileButton.Location = new System.Drawing.Point(480, 242);
this.addFileButton.Name = "addFileButton";
this.addFileButton.Size = new System.Drawing.Size(126, 40);
this.addFileButton.TabIndex = 13;
this.addFileButton.Text = "Add File";
this.addFileButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.addFileButton.UseVisualStyleBackColor = true;
this.addFileButton.Click += new System.EventHandler(this.addFileButton_Click);
//
// removeLastButton
//
this.removeLastButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.removeLastButton.Image = global::DSPRE.Properties.Resources.deleteIcon;
this.removeLastButton.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.removeLastButton.Location = new System.Drawing.Point(480, 292);
this.removeLastButton.Name = "removeLastButton";
this.removeLastButton.Size = new System.Drawing.Size(126, 40);
this.removeLastButton.TabIndex = 14;
this.removeLastButton.Text = "Remove Last";
this.removeLastButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.removeLastButton.UseVisualStyleBackColor = true;
this.removeLastButton.Click += new System.EventHandler(this.removeLastButton_Click);
//
// TradeEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(641, 460);
this.Controls.Add(this.mainPanel);
this.Name = "TradeEditor";
this.Text = "TradeEditor";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TradeEditor_FormClosing);
this.mainPanel.ResumeLayout(false);
this.textDataGroupBox.ResumeLayout(false);
this.textDataGroupBox.PerformLayout();
this.tradeDataGroupBox.ResumeLayout(false);
this.tradeDataGroupBox.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.otIDNumericUpDown)).EndInit();
this.monDataGroupBox.ResumeLayout(false);
this.monDataPanel.ResumeLayout(false);
this.monDataPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.unknownNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pidNumericUpDown)).EndInit();
this.contestGroupBox.ResumeLayout(false);
this.contestGroupBox.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.toughNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.smartNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.cuteNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.beautyNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.coolNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.sheenNumericUpDown)).EndInit();
this.IVGroupBox.ResumeLayout(false);
this.IVGroupBox.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.speIVNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spdIVNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.spaIVNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.defIVNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.atkIVNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.hpIVNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tradeIDNumericUpDown)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel mainPanel;
private System.Windows.Forms.NumericUpDown tradeIDNumericUpDown;
private System.Windows.Forms.Label tradeIDLabel;
private System.Windows.Forms.GroupBox tradeDataGroupBox;
private System.Windows.Forms.GroupBox textDataGroupBox;
private System.Windows.Forms.Label speciesLabel;
private System.Windows.Forms.ComboBox speciesComboBox;
private System.Windows.Forms.Panel monDataPanel;
private System.Windows.Forms.GroupBox IVGroupBox;
private System.Windows.Forms.Label speIVLabel;
private System.Windows.Forms.Label spdIVLabel;
private System.Windows.Forms.Label spaIVLabel;
private System.Windows.Forms.Label defIVLabel;
private System.Windows.Forms.Label atkIVLabel;
private System.Windows.Forms.Label hpIVLabel;
private System.Windows.Forms.NumericUpDown speIVNumericUpDown;
private System.Windows.Forms.NumericUpDown spdIVNumericUpDown;
private System.Windows.Forms.NumericUpDown spaIVNumericUpDown;
private System.Windows.Forms.NumericUpDown defIVNumericUpDown;
private System.Windows.Forms.NumericUpDown atkIVNumericUpDown;
private System.Windows.Forms.NumericUpDown hpIVNumericUpDown;
private System.Windows.Forms.GroupBox contestGroupBox;
private System.Windows.Forms.NumericUpDown toughNumericUpDown;
private System.Windows.Forms.NumericUpDown smartNumericUpDown;
private System.Windows.Forms.NumericUpDown cuteNumericUpDown;
private System.Windows.Forms.NumericUpDown beautyNumericUpDown;
private System.Windows.Forms.NumericUpDown coolNumericUpDown;
private System.Windows.Forms.NumericUpDown sheenNumericUpDown;
private System.Windows.Forms.Label toughLabel;
private System.Windows.Forms.Label smartLabel;
private System.Windows.Forms.Label cuteLabel;
private System.Windows.Forms.Label beautyLabel;
private System.Windows.Forms.Label coolLabel;
private System.Windows.Forms.Label sheenLabel;
private System.Windows.Forms.ComboBox heldItemComboBox;
private System.Windows.Forms.Label heldItemLabel;
private System.Windows.Forms.GroupBox monDataGroupBox;
private System.Windows.Forms.ComboBox langComboBox;
private System.Windows.Forms.Label langLabel;
private System.Windows.Forms.NumericUpDown otIDNumericUpDown;
private System.Windows.Forms.Label otIDLabel;
private System.Windows.Forms.Label otGenderLabel;
private System.Windows.Forms.ComboBox otGenderComboBox;
private System.Windows.Forms.NumericUpDown pidNumericUpDown;
private System.Windows.Forms.Label pidLabel;
private System.Windows.Forms.NumericUpDown unknownNumericUpDown;
private System.Windows.Forms.Label unknownLabel;
private System.Windows.Forms.ComboBox abilityComboBox;
private System.Windows.Forms.Label abilityLabel;
private System.Windows.Forms.ComboBox requestedComboBox;
private System.Windows.Forms.Label requestedLabel;
private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.Button saveTradeButton;
private System.Windows.Forms.TextBox nicknameTextBox;
private System.Windows.Forms.TextBox otNameTextBox;
private System.Windows.Forms.Label nicknameLabel;
private System.Windows.Forms.Label otNameLabel;
private System.Windows.Forms.Button saveTextDataButton;
private System.Windows.Forms.Button saveAllButton;
private System.Windows.Forms.Button addFileButton;
private System.Windows.Forms.Button removeLastButton;
}
}

View File

@@ -0,0 +1,546 @@
using DSPRE.ROMFiles;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DSPRE.Editors
{
public partial class TradeEditor : Form
{
private TradeData curTradeData;
private TextArchive tradeArchive;
// Track if any changes have been made
private bool tradeDirty = false;
private bool textDirty = false;
#region Enums
public enum OriginLang
{
NONE = 0,
JAPANESE = 1,
ENGLISH = 2,
FRENCH = 3,
ITALIAN = 4,
GERMAN = 5,
UNUSED = 6,
SPANISH = 7,
KOREAN = 8
}
#endregion
public TradeEditor()
{
Helpers.DisableHandlers();
AppLogger.Debug("TradeEditor: Initializing Trade Editor.");
InitializeComponent();
InitLimits();
InitDataRanges();
SetToolTips();
RegisterMarkDirtyHandlers();
if (TradeData.GetTradeCount() == 0)
{
MessageBox.Show("No trades could be found! The narc may have failed to unpack.", "Loading Trades Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
AppLogger.Error("TradeEditor: Loading trades failed.");
return;
}
if (RomInfo.gameFamily != RomInfo.GameFamilies.HGSS)
{
unknownNumericUpDown.Enabled = false;
}
// PLAT: Overlay 6, 0x8050-0x8053: dc f5 f0 fb -> 00 00 00 00 to dummy out ASSERT
// Disable buttons until trade expansion is implemented
addFileButton.Enabled = false;
removeLastButton.Enabled = false;
tradeArchive = new TextArchive(GetTextBankIndex());
LoadFromFile(0);
}
private void InitLimits()
{
// IVs: 0-31
hpIVNumericUpDown.Minimum = 0;
hpIVNumericUpDown.Maximum = 31;
atkIVNumericUpDown.Minimum = 0;
atkIVNumericUpDown.Maximum = 31;
defIVNumericUpDown.Minimum = 0;
defIVNumericUpDown.Maximum = 31;
speIVNumericUpDown.Minimum = 0;
speIVNumericUpDown.Maximum = 31;
spaIVNumericUpDown.Minimum = 0;
spaIVNumericUpDown.Maximum = 31;
spdIVNumericUpDown.Minimum = 0;
spdIVNumericUpDown.Maximum = 31;
// Contest stats: 0-255
coolNumericUpDown.Minimum = 0;
coolNumericUpDown.Maximum = 255;
beautyNumericUpDown.Minimum = 0;
beautyNumericUpDown.Maximum = 255;
cuteNumericUpDown.Minimum = 0;
cuteNumericUpDown.Maximum = 255;
smartNumericUpDown.Minimum = 0;
smartNumericUpDown.Maximum = 255;
toughNumericUpDown.Minimum = 0;
toughNumericUpDown.Maximum = 255;
// PID: (32-bit unsigned)
pidNumericUpDown.Minimum = 0;
pidNumericUpDown.Maximum = int.MaxValue;
// Sheen: 0-255
sheenNumericUpDown.Minimum = 0;
sheenNumericUpDown.Maximum = 255;
// Unknown: (32-bit unsigned)
unknownNumericUpDown.Minimum = 0;
unknownNumericUpDown.Maximum = int.MaxValue;
// Trade ID: (dynamic based on loaded data)
tradeIDNumericUpDown.Minimum = 0;
tradeIDNumericUpDown.Maximum = TradeData.GetTradeCount() - 1;
// OT ID: (32-bit unsigned)
otIDNumericUpDown.Minimum = 0;
otIDNumericUpDown.Maximum = int.MaxValue;
// Text fields
otNameTextBox.MaxLength = 7;
nicknameTextBox.MaxLength = 10;
}
private void InitDataRanges()
{
// Species Names
speciesComboBox.DataSource = RomInfo.GetPokemonNames();
speciesComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
requestedComboBox.DataSource = RomInfo.GetPokemonNames();
requestedComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
// Abilities
abilityComboBox.DataSource = RomInfo.GetAbilityNames();
abilityComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
// Held Items
heldItemComboBox.DataSource = RomInfo.GetItemNames();
heldItemComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
// OT Gender
otGenderComboBox.DataSource = new string[] { "Male", "Female" };
// Languages
langComboBox.DataSource = Enum.GetNames(typeof(OriginLang));
langComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
}
private void SetToolTips()
{
SetToolTipsForControls(new Control[] { tradeIDNumericUpDown, tradeIDLabel }, "The Trade ID to edit.");
SetToolTipsForControls(new Control[] { speciesComboBox, speciesLabel }, "The species of the Pokémon being traded.");
SetToolTipsForControls(new Control[] { IVGroupBox }, "Individual Values (IVs)");
SetToolTipsForControls(new Control[] { abilityComboBox, abilityLabel }, "The ability of the Pokémon.\nThis value is unused and will have no effect!");
SetToolTipsForControls(new Control[] { otIDNumericUpDown, otIDLabel }, "The Original Trainer ID of the Pokémon.");
SetToolTipsForControls(new Control[] { contestGroupBox }, "Contest stats for the Pokémon.");
SetToolTipsForControls(new Control[] { pidNumericUpDown, pidLabel }, "The PID of the Pokémon.\nDetermines ability and nature.");
SetToolTipsForControls(new Control[] { heldItemComboBox, heldItemLabel }, "The held item of the Pokémon.");
SetToolTipsForControls(new Control[] { otGenderComboBox, otGenderLabel }, "The gender of the Original Trainer (OT).\nThe OT name is determined by the text bank.");
SetToolTipsForControls(new Control[] { langComboBox, langLabel }, "The language of origin of the traded Pokémon.");
SetToolTipsForControls(new Control[] { requestedComboBox, requestedLabel }, "The species of the requested Pokémon.\nWhether the Pokémon selected by the player matches this species or not is checked via scripting.");
SetToolTipsForControls(new Control[] { unknownNumericUpDown, unknownLabel }, "An unknown value, present in HGSS only.\nAppears to be unused.");
SetToolTipsForControls(new Control[] { otNameTextBox, otNameLabel },
$"The Original Trainer's name.\nStored in text bank {GetTextBankIndex()}.\nAt most {otNameTextBox.MaxLength} characters.");
SetToolTipsForControls(new Control[] { nicknameTextBox, nicknameLabel },
$"The nickname of the Pokémon.\nStored in text bank {GetTextBankIndex()}.\nAt most {nicknameTextBox.MaxLength} characters.");
SetToolTipsForControls(new Control[] { saveTradeButton }, "Save the current trade data to file.");
SetToolTipsForControls(new Control[] { saveTextDataButton }, "Save the current text data to file.");
SetToolTipsForControls(new Control[] { saveAllButton }, "Save both trade data and text data to file.");
// ToDo: Remove these tooltips when the features are implemented
SetToolTipsForControls(new Control[] { addFileButton, removeLastButton }, "Coming soon!\nThis feature is not yet implemented.\nIt will allow you to add or remove trades from the trade data file.");
}
private void SetToolTipsForControls(IEnumerable<Control> controls, string text)
{
foreach (var control in controls)
{
toolTip.SetToolTip(control, text);
}
}
public void LoadFromFile(int tradeID)
{
Helpers.DisableHandlers();
curTradeData = new TradeData(tradeID);
tradeArchive = new TextArchive(GetTextBankIndex());
tradeIDNumericUpDown.Value = tradeID;
speciesComboBox.SelectedIndex = curTradeData.species;
hpIVNumericUpDown.Value = curTradeData.hpIV;
atkIVNumericUpDown.Value = curTradeData.atkIV;
defIVNumericUpDown.Value = curTradeData.defIV;
speIVNumericUpDown.Value = curTradeData.speedIV;
spaIVNumericUpDown.Value = curTradeData.spAtkIV;
spdIVNumericUpDown.Value = curTradeData.spDefIV;
abilityComboBox.SelectedIndex = curTradeData.ability;
otIDNumericUpDown.Value = curTradeData.otID;
coolNumericUpDown.Value = curTradeData.cool;
beautyNumericUpDown.Value = curTradeData.beauty;
cuteNumericUpDown.Value = curTradeData.cute;
smartNumericUpDown.Value = curTradeData.smart;
toughNumericUpDown.Value = curTradeData.tough;
pidNumericUpDown.Value = curTradeData.pid;
heldItemComboBox.SelectedIndex = curTradeData.heldItem;
otGenderComboBox.SelectedIndex = curTradeData.otGender;
sheenNumericUpDown.Value = curTradeData.sheen;
langComboBox.SelectedIndex = curTradeData.language;
requestedComboBox.SelectedIndex = curTradeData.requestedSpecies;
unknownNumericUpDown.Value = curTradeData.unknown;
otNameTextBox.Text = GetOTName(tradeID);
nicknameTextBox.Text = GetMonNickname(tradeID);
tradeDataGroupBox.Text = "Trade Data";
textDataGroupBox.Text = "Text Data";
this.Text = "Trade Editor";
tradeDirty = false;
textDirty = false;
Helpers.EnableHandlers();
}
private void SaveTradeToFile()
{
Helpers.DisableHandlers();
curTradeData.species = speciesComboBox.SelectedIndex;
curTradeData.hpIV = (int)hpIVNumericUpDown.Value;
curTradeData.atkIV = (int)atkIVNumericUpDown.Value;
curTradeData.defIV = (int)defIVNumericUpDown.Value;
curTradeData.speedIV = (int)speIVNumericUpDown.Value;
curTradeData.spAtkIV = (int)spaIVNumericUpDown.Value;
curTradeData.spDefIV = (int)spdIVNumericUpDown.Value;
curTradeData.ability = abilityComboBox.SelectedIndex;
curTradeData.otID = (int)otIDNumericUpDown.Value;
curTradeData.cool = (int)coolNumericUpDown.Value;
curTradeData.beauty = (int)beautyNumericUpDown.Value;
curTradeData.cute = (int)cuteNumericUpDown.Value;
curTradeData.smart = (int)smartNumericUpDown.Value;
curTradeData.tough = (int)toughNumericUpDown.Value;
curTradeData.pid = (int)pidNumericUpDown.Value;
curTradeData.heldItem = heldItemComboBox.SelectedIndex;
curTradeData.otGender = otGenderComboBox.SelectedIndex;
curTradeData.sheen = (int)sheenNumericUpDown.Value;
curTradeData.language = langComboBox.SelectedIndex;
curTradeData.requestedSpecies = requestedComboBox.SelectedIndex;
if (RomInfo.gameFamily == RomInfo.GameFamilies.HGSS)
{
curTradeData.unknown = (int)unknownNumericUpDown.Value;
}
else
{
curTradeData.unknown = 0;
}
curTradeData.SaveToFileDefaultDir((int)tradeIDNumericUpDown.Value, false);
tradeDataGroupBox.Text = "Trade Data";
tradeDirty = false;
if (!textDirty)
{
this.Text = "Trade Editor";
}
AppLogger.Debug($"TradeEditor: Saved trade data for ID {curTradeData.id}.");
Helpers.EnableHandlers();
}
private void SaveTextDataToFile()
{
Helpers.DisableHandlers();
int tradeID = (int)tradeIDNumericUpDown.Value;
if (tradeID < 0 || tradeID + TradeData.GetTradeCount() > tradeArchive.messages.Count)
{
MessageBox.Show("Can't save to text bank. Index is out of range.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
AppLogger.Error("TradeEditor: Can't save to text bank. Index is out of range.");
Helpers.EnableHandlers();
return;
}
// Nickname
tradeArchive.messages[tradeID] = nicknameTextBox.Text;
// OT Name
tradeArchive.messages[tradeID + TradeData.GetTradeCount()] = otNameTextBox.Text;
tradeArchive.SaveToFileDefaultDir(GetTextBankIndex(), false);
// Reset the text data group box and dirty flags
textDataGroupBox.Text = "Text Data";
textDirty = false;
if (!tradeDirty)
{
this.Text = "Trade Editor";
}
AppLogger.Debug($"TradeEditor: Saved trade text data to message bank {GetTextBankIndex()}");
Helpers.EnableHandlers();
}
private int GetTextBankIndex()
{
switch (RomInfo.gameFamily)
{
case RomInfo.GameFamilies.DP:
switch (RomInfo.gameLanguage)
{
case RomInfo.GameLanguages.Japanese:
return 324;
default:
return 326;
}
case RomInfo.GameFamilies.Plat:
switch (RomInfo.gameLanguage)
{
case RomInfo.GameLanguages.Japanese:
return 369;
default:
return 370;
}
case RomInfo.GameFamilies.HGSS:
switch (RomInfo.gameLanguage)
{
case RomInfo.GameLanguages.Japanese:
return 198;
default:
return 200;
}
default:
AppLogger.Error("TradeEditor: Invalid game family for text bank index retrieval.");
MessageBox.Show("Invalid game family for text bank index retrieval.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return 0;
}
}
private string GetMonNickname(int tradeID)
{
string msg = tradeArchive.messages[tradeID];
if (msg.Length > nicknameTextBox.MaxLength)
{
msg = msg.Substring(0, nicknameTextBox.MaxLength);
}
return msg;
}
private string GetOTName(int tradeID)
{
int index = tradeID + TradeData.GetTradeCount();
string msg = tradeArchive.messages[index];
if (msg.Length > otNameTextBox.MaxLength)
{
msg = msg.Substring(0, otNameTextBox.MaxLength);
}
return msg;
}
private void RegisterMarkDirtyHandlers()
{
// ComboBoxes
speciesComboBox.SelectedIndexChanged += MarkDirty;
abilityComboBox.SelectedIndexChanged += MarkDirty;
heldItemComboBox.SelectedIndexChanged += MarkDirty;
otGenderComboBox.SelectedIndexChanged += MarkDirty;
langComboBox.SelectedIndexChanged += MarkDirty;
requestedComboBox.SelectedIndexChanged += MarkDirty;
// NumericUpDowns
hpIVNumericUpDown.ValueChanged += MarkDirty;
atkIVNumericUpDown.ValueChanged += MarkDirty;
defIVNumericUpDown.ValueChanged += MarkDirty;
speIVNumericUpDown.ValueChanged += MarkDirty;
spaIVNumericUpDown.ValueChanged += MarkDirty;
spdIVNumericUpDown.ValueChanged += MarkDirty;
otIDNumericUpDown.ValueChanged += MarkDirty;
coolNumericUpDown.ValueChanged += MarkDirty;
beautyNumericUpDown.ValueChanged += MarkDirty;
cuteNumericUpDown.ValueChanged += MarkDirty;
smartNumericUpDown.ValueChanged += MarkDirty;
toughNumericUpDown.ValueChanged += MarkDirty;
pidNumericUpDown.ValueChanged += MarkDirty;
sheenNumericUpDown.ValueChanged += MarkDirty;
unknownNumericUpDown.ValueChanged += MarkDirty;
// TextBoxes
otNameTextBox.TextChanged += MarkDirty;
nicknameTextBox.TextChanged += MarkDirty;
}
#region Handlers
private void MarkDirty(object sender, EventArgs e)
{
if (Helpers.HandlersDisabled)
{
return;
}
Helpers.DisableHandlers();
if (sender.Equals(otNameTextBox) || sender.Equals(nicknameTextBox))
{
textDataGroupBox.Text = "Text Data*";
this.Text = "Trade Editor*";
textDirty = true;
}
else
{
tradeDataGroupBox.Text = "Trade Data*";
this.Text = "Trade Editor*";
tradeDirty = true;
}
Helpers.EnableHandlers();
}
private void tradeIDNumericUpDown_ValueChanged(object sender, EventArgs e)
{
if (Helpers.HandlersDisabled)
{
return;
}
Helpers.DisableHandlers();
if (tradeDirty || textDirty)
{
DialogResult result = MessageBox.Show("You have unsaved changes. Do you want to save before changing the Trade ID?", "Unsaved Changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
SaveTradeToFile();
SaveTextDataToFile();
}
else if (result == DialogResult.Cancel)
{
// Revert the change
tradeIDNumericUpDown.Value = curTradeData.id;
Helpers.EnableHandlers();
return;
}
}
int tradeID = (int)tradeIDNumericUpDown.Value;
if (tradeID < 0 || tradeID >= TradeData.GetTradeCount())
{
MessageBox.Show("Invalid Trade ID selected.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
LoadFromFile(tradeID);
Helpers.EnableHandlers();
}
private void saveTradeButton_Click(object sender, EventArgs e)
{
SaveTradeToFile();
}
private void saveTextDataButton_Click(object sender, EventArgs e)
{
SaveTextDataToFile();
}
private void saveAllButton_Click(object sender, EventArgs e)
{
SaveTradeToFile();
SaveTextDataToFile();
}
private void TradeEditor_FormClosing(object sender, FormClosingEventArgs e)
{
if (tradeDirty || textDirty)
{
DialogResult result = MessageBox.Show("You have unsaved changes. Do you want to save before closing?", "Unsaved Changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
SaveTradeToFile();
SaveTextDataToFile();
}
else if (result == DialogResult.Cancel)
{
e.Cancel = true; // Cancel the closing
}
}
}
private void addFileButton_Click(object sender, EventArgs e)
{
TradeData newTrade = new TradeData(TradeData.GetTradeCount());
newTrade.SaveToFileDefaultDir(newTrade.id, false);
tradeIDNumericUpDown.Maximum = TradeData.GetTradeCount() - 1; // Update the maximum value
// Adjust text archive to accommodate the new trade
int lastNicknameIndex = TradeData.GetTradeCount() - 1;
tradeArchive.messages.Insert(lastNicknameIndex, "Nickname");
tradeArchive.messages.Add("OT Name");
tradeArchive.SaveToFileDefaultDir(GetTextBankIndex(), false);
MessageBox.Show($"Added new trade with id {newTrade.id}", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void removeLastButton_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Are you sure you want to remove the last trade? This action cannot be undone.", "Confirm Removal", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result != DialogResult.Yes)
{
return; // User cancelled the removal
}
if (TradeData.GetTradeCount() <= 1)
{
MessageBox.Show("Cannot remove the last trade.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
int lastTradeID = TradeData.GetTradeCount() - 1;
try
{
File.Delete(RomInfo.gameDirs[RomInfo.DirNames.tradeData].unpackedDir + "\\" + lastTradeID.ToString("D4"));
}
catch (Exception ex)
{
MessageBox.Show($"Failed to delete trade file: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
AppLogger.Error($"TradeEditor: Failed to delete trade file for ID {lastTradeID}: {ex.Message}");
return;
}
tradeIDNumericUpDown.Maximum = lastTradeID - 1; // Update the maximum value
// Adjust text archive to remove the last trade's text
if (tradeArchive.messages.Count > lastTradeID)
{
tradeArchive.messages.RemoveAt(lastTradeID); // Remove Nickname
tradeArchive.messages.RemoveAt(tradeArchive.messages.Count - 1); // Remove OT Name
tradeArchive.SaveToFileDefaultDir(GetTextBankIndex(), false);
}
}
#endregion
}
}

View File

@@ -0,0 +1,123 @@
<?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>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -536,6 +536,7 @@
this.flyWarpEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.itemEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.overworldEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tradeEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
@@ -6735,7 +6736,8 @@
this.moveDataEditorToolStripMenuItem,
this.flyWarpEditorToolStripMenuItem,
this.itemEditorToolStripMenuItem,
this.overworldEditorToolStripMenuItem});
this.overworldEditorToolStripMenuItem,
this.tradeEditorToolStripMenuItem});
this.otherEditorsToolStripMenuItem.Enabled = false;
this.otherEditorsToolStripMenuItem.Name = "otherEditorsToolStripMenuItem";
this.otherEditorsToolStripMenuItem.Size = new System.Drawing.Size(88, 20);
@@ -6789,6 +6791,13 @@
this.overworldEditorToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.overworldEditorToolStripMenuItem.Text = "Overworld Editor";
this.overworldEditorToolStripMenuItem.Click += new System.EventHandler(this.overworldEditorToolStripMenuItem_Click);
//
// tradeEditorToolStripMenuItem
//
this.tradeEditorToolStripMenuItem.Name = "tradeEditorToolStripMenuItem";
this.tradeEditorToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.tradeEditorToolStripMenuItem.Text = "Trade Editor";
this.tradeEditorToolStripMenuItem.Click += new System.EventHandler(this.tradeEditorToolStripMenuItem_Click);
//
// aboutToolStripMenuItem1
//
@@ -7946,6 +7955,7 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ToolStripMenuItem flyWarpEditorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem itemEditorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem tradeEditorToolStripMenuItem;
private System.Windows.Forms.Button popoutTextEditorButton;
private System.Windows.Forms.Label textEditorPoppedOutLabel;
private System.Windows.Forms.Button popoutLevelScriptEditorButton;

View File

@@ -7270,6 +7270,14 @@ namespace DSPRE {
flyEditor.Show();
}
private void tradeEditorToolStripMenuItem_Click(object sender, EventArgs e)
{
DSUtils.TryUnpackNarcs(new List<DirNames> { DirNames.tradeData });
TradeEditor tradeEditor = new TradeEditor();
tradeEditor.Show();
}
private void itemEditorToolStripMenuItem_Click(object sender, EventArgs e)
{
Helpers.statusLabelMessage("Setting up Item Data Editor...");

View File

@@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static DSPRE.RomInfo;
namespace DSPRE.ROMFiles
{
internal class TradeData : RomFile
{
public int id;
// TradeData structure in narc
public int species;
public int hpIV;
public int atkIV;
public int defIV;
public int speedIV;
public int spAtkIV;
public int spDefIV;
public int ability; // unused
public int otID;
public int cool;
public int beauty;
public int cute;
public int smart;
public int tough;
public int pid;
public int heldItem;
public int otGender;
public int sheen;
public int language;
public int requestedSpecies;
public int unknown; // unused?
public TradeData(int id, Stream stream)
{
this.id = id;
using (BinaryReader br = new BinaryReader(stream))
{
species = br.ReadInt32();
hpIV = br.ReadInt32();
atkIV = br.ReadInt32();
defIV = br.ReadInt32();
speedIV = br.ReadInt32();
spAtkIV = br.ReadInt32();
spDefIV = br.ReadInt32();
ability = br.ReadInt32(); // appears unused
otID = br.ReadInt32();
cool = br.ReadInt32();
beauty = br.ReadInt32();
cute = br.ReadInt32();
smart = br.ReadInt32();
tough = br.ReadInt32();
pid = br.ReadInt32();
heldItem = br.ReadInt32();
otGender = br.ReadInt32();
sheen = br.ReadInt32();
language = br.ReadInt32();
requestedSpecies = br.ReadInt32();
if (RomInfo.gameFamily == GameFamilies.HGSS)
{
unknown = br.ReadInt32(); // unused?
}
}
}
public TradeData(int id) : this(id, GetStream(id)) { }
private static Stream GetStream(int id)
{
if (!File.Exists(RomInfo.gameDirs[DirNames.tradeData].unpackedDir + "\\" + id.ToString("D4")))
{
// If the file does not exist, create it with default values
FileStream fileStream = new FileStream(RomInfo.gameDirs[DirNames.tradeData].unpackedDir + "\\" + id.ToString("D4"), FileMode.Create);
fileStream.Write(new byte[0x50], 0, 0x50); // create an empty file
if (RomInfo.gameFamily == GameFamilies.HGSS)
{
fileStream.Write(new byte[0x04], 0, 0x04); // HGSS only
}
fileStream.Seek(0, SeekOrigin.Begin); // Reset the position to the start of the file
return fileStream;
}
return new FileStream(RomInfo.gameDirs[DirNames.tradeData].unpackedDir + "\\" + id.ToString("D4"), FileMode.Open);
}
public override byte[] ToByteArray()
{
using (MemoryStream ms = new MemoryStream())
using (BinaryWriter bw = new BinaryWriter(ms))
{
bw.Write(species);
bw.Write(hpIV);
bw.Write(atkIV);
bw.Write(defIV);
bw.Write(speedIV);
bw.Write(spAtkIV);
bw.Write(spDefIV);
bw.Write(ability); // unused
bw.Write(otID);
bw.Write(cool);
bw.Write(beauty);
bw.Write(cute);
bw.Write(smart);
bw.Write(tough);
bw.Write(pid);
bw.Write(heldItem);
bw.Write(otGender);
bw.Write(sheen);
bw.Write(language);
bw.Write(requestedSpecies);
if (RomInfo.gameFamily == GameFamilies.HGSS)
{
bw.Write(unknown); // HGSS only
}
return ms.ToArray();
}
}
public void SaveToFileDefaultDir(int IDtoReplace, bool showSuccessMessage = true)
{
SaveToFileDefaultDir(DirNames.tradeData, IDtoReplace, showSuccessMessage);
}
public void SaveToFileExplorePath(string suggestedFileName, bool showSuccessMessage = true)
{
SaveToFileExplorePath("Gen IV Trade data", "bin", suggestedFileName, showSuccessMessage);
}
public static int GetTradeCount()
{
return Directory.GetFiles(RomInfo.gameDirs[DirNames.tradeData].unpackedDir, "*.*").Length;
}
}
}

View File

@@ -175,7 +175,9 @@ namespace DSPRE
evolutions,
itemData,
itemIcons
itemIcons,
tradeData
};
public static Dictionary<DirNames, (string packedDir, string unpackedDir)> gameDirs { get; private set; }
@@ -1024,7 +1026,7 @@ namespace DSPRE
switch (gameFamily)
{
case GameFamilies.DP:
itemNamesTextNumber = 344;
itemNamesTextNumber = gameLanguage == GameLanguages.Japanese ? 341 : 344;
itemDescriptionsTextNumber = 0;
break;
@@ -1470,7 +1472,9 @@ namespace DSPRE
[DirNames.otherPokemonBattleSprites] = @"data\poketool\pokegra\otherpoke.narc",
[DirNames.itemData] = @"data\itemtool\itemdata\item_data.narc",
[DirNames.itemIcons] = @"data\itemtool\itemdata\item_icon.narc"
[DirNames.itemIcons] = @"data\itemtool\itemdata\item_icon.narc",
[DirNames.tradeData] = @"data\fielddata\pokemon_trade\fld_trade.narc"
};
//Personal Data archive is different for Pearl
@@ -1482,6 +1486,11 @@ namespace DSPRE
personal += @"\personal.narc";
packedDirsDict[DirNames.personalPokeData] = personal;
if (gameLanguage != GameLanguages.Japanese)
{
packedDirsDict[DirNames.tradeData] = $@"data\resource\{GetLangResFolderName()}\pokemon_trade\fld_trade.narc";
}
break;
case GameFamilies.Plat:
@@ -1525,8 +1534,16 @@ namespace DSPRE
[DirNames.evolutions] = @"data\poketool\personal\evo.narc",
[DirNames.itemData] = @"data\itemtool\itemdata\pl_item_data.narc",
[DirNames.itemIcons] = @"data\itemtool\itemdata\item_icon.narc"
[DirNames.itemIcons] = @"data\itemtool\itemdata\item_icon.narc",
[DirNames.tradeData] = @"data\fielddata\pokemon_trade\fld_trade.narc"
};
if (gameLanguage != GameLanguages.Japanese && gameLanguage != GameLanguages.English)
{
packedDirsDict[DirNames.tradeData] = $@"data\resource\{GetLangResFolderName()}\pokemon_trade\fld_trade.narc";
}
break;
case GameFamilies.HGSS:
@@ -1567,6 +1584,7 @@ namespace DSPRE
[DirNames.evolutions] = @"data\a\0\3\4",
[DirNames.itemData] = @"data\a\0\1\7",
[DirNames.itemIcons] = @"data\a\0\1\8",
[DirNames.tradeData] = @"data\a\1\1\2",
[DirNames.safariZone] = @"data\a\2\3\0",
[DirNames.headbutt] = @"data\a\2\5\2", //both versions use the same folder with different data
@@ -1584,6 +1602,25 @@ namespace DSPRE
}
}
public static string GetLangResFolderName()
{
switch (gameLanguage)
{
case GameLanguages.English:
return "eng";
case GameLanguages.Italian:
return "ita";
case GameLanguages.French:
return "fra";
case GameLanguages.German:
return "ger";
case GameLanguages.Spanish:
return "spa";
default:
return "";
}
}
public void ResetMapCellsColorDictionary()
{
switch (gameFamily)