mirror of
https://github.com/kwsch/pkNX.git
synced 2026-10-02 14:16:55 -05:00
Add WIP trainer editor
This commit is contained in:
670
pkNX.WinForms/Controls/StatEditor.Designer.cs
generated
Normal file
670
pkNX.WinForms/Controls/StatEditor.Designer.cs
generated
Normal file
@@ -0,0 +1,670 @@
|
||||
namespace pkNX.WinForms.Controls
|
||||
{
|
||||
partial class StatEditor
|
||||
{
|
||||
/// <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 Component 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.FLP_Stats = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.FLP_StatHeader = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.FLP_StatsHeaderRight = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_IVs = new System.Windows.Forms.Label();
|
||||
this.Label_EVs = new System.Windows.Forms.Label();
|
||||
this.Label_Stats = new System.Windows.Forms.Label();
|
||||
this.FLP_HP = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_HP = new System.Windows.Forms.Label();
|
||||
this.TB_HPIV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.TB_HPEV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.Stat_HP = new System.Windows.Forms.MaskedTextBox();
|
||||
this.FLP_Atk = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_ATK = new System.Windows.Forms.Label();
|
||||
this.TB_ATKIV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.TB_ATKEV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.Stat_ATK = new System.Windows.Forms.MaskedTextBox();
|
||||
this.FLP_Def = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_DEF = new System.Windows.Forms.Label();
|
||||
this.TB_DEFIV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.TB_DEFEV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.Stat_DEF = new System.Windows.Forms.MaskedTextBox();
|
||||
this.FLP_SpA = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_SPA = new System.Windows.Forms.Label();
|
||||
this.TB_SPAIV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.TB_SPAEV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.Stat_SPA = new System.Windows.Forms.MaskedTextBox();
|
||||
this.FLP_SpD = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_SPD = new System.Windows.Forms.Label();
|
||||
this.TB_SPDIV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.TB_SPDEV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.Stat_SPD = new System.Windows.Forms.MaskedTextBox();
|
||||
this.FLP_Spe = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_SPE = new System.Windows.Forms.Label();
|
||||
this.TB_SPEIV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.TB_SPEEV = new System.Windows.Forms.MaskedTextBox();
|
||||
this.Stat_SPE = new System.Windows.Forms.MaskedTextBox();
|
||||
this.FLP_StatsTotal = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_Total = new System.Windows.Forms.Label();
|
||||
this.TB_IVTotal = new System.Windows.Forms.TextBox();
|
||||
this.TB_EVTotal = new System.Windows.Forms.TextBox();
|
||||
this.FLP_HPType = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.Label_HiddenPowerPrefix = new System.Windows.Forms.Label();
|
||||
this.CB_HPType = new System.Windows.Forms.ComboBox();
|
||||
this.FLP_Stats.SuspendLayout();
|
||||
this.FLP_StatHeader.SuspendLayout();
|
||||
this.FLP_StatsHeaderRight.SuspendLayout();
|
||||
this.FLP_HP.SuspendLayout();
|
||||
this.FLP_Atk.SuspendLayout();
|
||||
this.FLP_Def.SuspendLayout();
|
||||
this.FLP_SpA.SuspendLayout();
|
||||
this.FLP_SpD.SuspendLayout();
|
||||
this.FLP_Spe.SuspendLayout();
|
||||
this.FLP_StatsTotal.SuspendLayout();
|
||||
this.FLP_HPType.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// FLP_Stats
|
||||
//
|
||||
this.FLP_Stats.Controls.Add(this.FLP_StatHeader);
|
||||
this.FLP_Stats.Controls.Add(this.FLP_HP);
|
||||
this.FLP_Stats.Controls.Add(this.FLP_Atk);
|
||||
this.FLP_Stats.Controls.Add(this.FLP_Def);
|
||||
this.FLP_Stats.Controls.Add(this.FLP_SpA);
|
||||
this.FLP_Stats.Controls.Add(this.FLP_SpD);
|
||||
this.FLP_Stats.Controls.Add(this.FLP_Spe);
|
||||
this.FLP_Stats.Controls.Add(this.FLP_StatsTotal);
|
||||
this.FLP_Stats.Controls.Add(this.FLP_HPType);
|
||||
this.FLP_Stats.Location = new System.Drawing.Point(-14, 0);
|
||||
this.FLP_Stats.Name = "FLP_Stats";
|
||||
this.FLP_Stats.Size = new System.Drawing.Size(178, 209);
|
||||
this.FLP_Stats.TabIndex = 451;
|
||||
//
|
||||
// FLP_StatHeader
|
||||
//
|
||||
this.FLP_StatHeader.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_StatHeader.Controls.Add(this.FLP_StatsHeaderRight);
|
||||
this.FLP_StatHeader.Location = new System.Drawing.Point(0, 0);
|
||||
this.FLP_StatHeader.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_StatHeader.Name = "FLP_StatHeader";
|
||||
this.FLP_StatHeader.Size = new System.Drawing.Size(172, 22);
|
||||
this.FLP_StatHeader.TabIndex = 122;
|
||||
//
|
||||
// FLP_StatsHeaderRight
|
||||
//
|
||||
this.FLP_StatsHeaderRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_StatsHeaderRight.Controls.Add(this.Label_IVs);
|
||||
this.FLP_StatsHeaderRight.Controls.Add(this.Label_EVs);
|
||||
this.FLP_StatsHeaderRight.Controls.Add(this.Label_Stats);
|
||||
this.FLP_StatsHeaderRight.Location = new System.Drawing.Point(62, 0);
|
||||
this.FLP_StatsHeaderRight.Margin = new System.Windows.Forms.Padding(62, 0, 0, 0);
|
||||
this.FLP_StatsHeaderRight.Name = "FLP_StatsHeaderRight";
|
||||
this.FLP_StatsHeaderRight.Size = new System.Drawing.Size(112, 21);
|
||||
this.FLP_StatsHeaderRight.TabIndex = 123;
|
||||
//
|
||||
// Label_IVs
|
||||
//
|
||||
this.Label_IVs.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_IVs.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_IVs.Name = "Label_IVs";
|
||||
this.Label_IVs.Size = new System.Drawing.Size(30, 21);
|
||||
this.Label_IVs.TabIndex = 29;
|
||||
this.Label_IVs.Text = "IVs";
|
||||
this.Label_IVs.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// Label_EVs
|
||||
//
|
||||
this.Label_EVs.Location = new System.Drawing.Point(30, 0);
|
||||
this.Label_EVs.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_EVs.Name = "Label_EVs";
|
||||
this.Label_EVs.Size = new System.Drawing.Size(35, 21);
|
||||
this.Label_EVs.TabIndex = 27;
|
||||
this.Label_EVs.Text = "EVs";
|
||||
this.Label_EVs.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// Label_Stats
|
||||
//
|
||||
this.Label_Stats.Location = new System.Drawing.Point(65, 0);
|
||||
this.Label_Stats.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_Stats.Name = "Label_Stats";
|
||||
this.Label_Stats.Size = new System.Drawing.Size(35, 21);
|
||||
this.Label_Stats.TabIndex = 28;
|
||||
this.Label_Stats.Text = "Stats";
|
||||
this.Label_Stats.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// FLP_HP
|
||||
//
|
||||
this.FLP_HP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_HP.Controls.Add(this.Label_HP);
|
||||
this.FLP_HP.Controls.Add(this.TB_HPIV);
|
||||
this.FLP_HP.Controls.Add(this.TB_HPEV);
|
||||
this.FLP_HP.Controls.Add(this.Stat_HP);
|
||||
this.FLP_HP.Location = new System.Drawing.Point(0, 22);
|
||||
this.FLP_HP.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_HP.Name = "FLP_HP";
|
||||
this.FLP_HP.Size = new System.Drawing.Size(172, 21);
|
||||
this.FLP_HP.TabIndex = 123;
|
||||
//
|
||||
// Label_HP
|
||||
//
|
||||
this.Label_HP.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_HP.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_HP.Name = "Label_HP";
|
||||
this.Label_HP.Size = new System.Drawing.Size(65, 21);
|
||||
this.Label_HP.TabIndex = 19;
|
||||
this.Label_HP.Text = "HP:";
|
||||
this.Label_HP.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// TB_HPIV
|
||||
//
|
||||
this.TB_HPIV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_HPIV.Location = new System.Drawing.Point(65, 0);
|
||||
this.TB_HPIV.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.TB_HPIV.Mask = "00";
|
||||
this.TB_HPIV.Name = "TB_HPIV";
|
||||
this.TB_HPIV.Size = new System.Drawing.Size(22, 20);
|
||||
this.TB_HPIV.TabIndex = 46;
|
||||
this.TB_HPIV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_HPIV.TextChanged += new System.EventHandler(this.UpdateIV);
|
||||
//
|
||||
// TB_HPEV
|
||||
//
|
||||
this.TB_HPEV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_HPEV.Location = new System.Drawing.Point(93, 0);
|
||||
this.TB_HPEV.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.TB_HPEV.Mask = "000";
|
||||
this.TB_HPEV.Name = "TB_HPEV";
|
||||
this.TB_HPEV.Size = new System.Drawing.Size(28, 20);
|
||||
this.TB_HPEV.TabIndex = 47;
|
||||
this.TB_HPEV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_HPEV.TextChanged += new System.EventHandler(this.UpdateEV);
|
||||
//
|
||||
// Stat_HP
|
||||
//
|
||||
this.Stat_HP.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.Stat_HP.Enabled = false;
|
||||
this.Stat_HP.Location = new System.Drawing.Point(127, 0);
|
||||
this.Stat_HP.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.Stat_HP.Mask = "00000";
|
||||
this.Stat_HP.Name = "Stat_HP";
|
||||
this.Stat_HP.PromptChar = ' ';
|
||||
this.Stat_HP.Size = new System.Drawing.Size(37, 20);
|
||||
this.Stat_HP.TabIndex = 48;
|
||||
this.Stat_HP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// FLP_Atk
|
||||
//
|
||||
this.FLP_Atk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_Atk.Controls.Add(this.Label_ATK);
|
||||
this.FLP_Atk.Controls.Add(this.TB_ATKIV);
|
||||
this.FLP_Atk.Controls.Add(this.TB_ATKEV);
|
||||
this.FLP_Atk.Controls.Add(this.Stat_ATK);
|
||||
this.FLP_Atk.Location = new System.Drawing.Point(0, 43);
|
||||
this.FLP_Atk.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_Atk.Name = "FLP_Atk";
|
||||
this.FLP_Atk.Size = new System.Drawing.Size(172, 21);
|
||||
this.FLP_Atk.TabIndex = 124;
|
||||
//
|
||||
// Label_ATK
|
||||
//
|
||||
this.Label_ATK.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_ATK.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_ATK.Name = "Label_ATK";
|
||||
this.Label_ATK.Size = new System.Drawing.Size(65, 21);
|
||||
this.Label_ATK.TabIndex = 20;
|
||||
this.Label_ATK.Text = "Atk:";
|
||||
this.Label_ATK.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// TB_ATKIV
|
||||
//
|
||||
this.TB_ATKIV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_ATKIV.Location = new System.Drawing.Point(65, 0);
|
||||
this.TB_ATKIV.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.TB_ATKIV.Mask = "00";
|
||||
this.TB_ATKIV.Name = "TB_ATKIV";
|
||||
this.TB_ATKIV.Size = new System.Drawing.Size(22, 20);
|
||||
this.TB_ATKIV.TabIndex = 47;
|
||||
this.TB_ATKIV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_ATKIV.TextChanged += new System.EventHandler(this.UpdateIV);
|
||||
//
|
||||
// TB_ATKEV
|
||||
//
|
||||
this.TB_ATKEV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_ATKEV.Location = new System.Drawing.Point(93, 0);
|
||||
this.TB_ATKEV.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.TB_ATKEV.Mask = "000";
|
||||
this.TB_ATKEV.Name = "TB_ATKEV";
|
||||
this.TB_ATKEV.Size = new System.Drawing.Size(28, 20);
|
||||
this.TB_ATKEV.TabIndex = 48;
|
||||
this.TB_ATKEV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_ATKEV.TextChanged += new System.EventHandler(this.UpdateEV);
|
||||
//
|
||||
// Stat_ATK
|
||||
//
|
||||
this.Stat_ATK.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.Stat_ATK.Enabled = false;
|
||||
this.Stat_ATK.Location = new System.Drawing.Point(127, 0);
|
||||
this.Stat_ATK.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.Stat_ATK.Mask = "00000";
|
||||
this.Stat_ATK.Name = "Stat_ATK";
|
||||
this.Stat_ATK.PromptChar = ' ';
|
||||
this.Stat_ATK.Size = new System.Drawing.Size(37, 20);
|
||||
this.Stat_ATK.TabIndex = 49;
|
||||
this.Stat_ATK.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// FLP_Def
|
||||
//
|
||||
this.FLP_Def.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_Def.Controls.Add(this.Label_DEF);
|
||||
this.FLP_Def.Controls.Add(this.TB_DEFIV);
|
||||
this.FLP_Def.Controls.Add(this.TB_DEFEV);
|
||||
this.FLP_Def.Controls.Add(this.Stat_DEF);
|
||||
this.FLP_Def.Location = new System.Drawing.Point(0, 64);
|
||||
this.FLP_Def.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_Def.Name = "FLP_Def";
|
||||
this.FLP_Def.Size = new System.Drawing.Size(172, 21);
|
||||
this.FLP_Def.TabIndex = 125;
|
||||
//
|
||||
// Label_DEF
|
||||
//
|
||||
this.Label_DEF.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_DEF.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_DEF.Name = "Label_DEF";
|
||||
this.Label_DEF.Size = new System.Drawing.Size(65, 21);
|
||||
this.Label_DEF.TabIndex = 21;
|
||||
this.Label_DEF.Text = "Def:";
|
||||
this.Label_DEF.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// TB_DEFIV
|
||||
//
|
||||
this.TB_DEFIV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_DEFIV.Location = new System.Drawing.Point(65, 0);
|
||||
this.TB_DEFIV.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.TB_DEFIV.Mask = "00";
|
||||
this.TB_DEFIV.Name = "TB_DEFIV";
|
||||
this.TB_DEFIV.Size = new System.Drawing.Size(22, 20);
|
||||
this.TB_DEFIV.TabIndex = 48;
|
||||
this.TB_DEFIV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_DEFIV.TextChanged += new System.EventHandler(this.UpdateIV);
|
||||
//
|
||||
// TB_DEFEV
|
||||
//
|
||||
this.TB_DEFEV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_DEFEV.Location = new System.Drawing.Point(93, 0);
|
||||
this.TB_DEFEV.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.TB_DEFEV.Mask = "000";
|
||||
this.TB_DEFEV.Name = "TB_DEFEV";
|
||||
this.TB_DEFEV.Size = new System.Drawing.Size(28, 20);
|
||||
this.TB_DEFEV.TabIndex = 49;
|
||||
this.TB_DEFEV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_DEFEV.TextChanged += new System.EventHandler(this.UpdateEV);
|
||||
//
|
||||
// Stat_DEF
|
||||
//
|
||||
this.Stat_DEF.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.Stat_DEF.Enabled = false;
|
||||
this.Stat_DEF.Location = new System.Drawing.Point(127, 0);
|
||||
this.Stat_DEF.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.Stat_DEF.Mask = "00000";
|
||||
this.Stat_DEF.Name = "Stat_DEF";
|
||||
this.Stat_DEF.PromptChar = ' ';
|
||||
this.Stat_DEF.Size = new System.Drawing.Size(37, 20);
|
||||
this.Stat_DEF.TabIndex = 50;
|
||||
this.Stat_DEF.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// FLP_SpA
|
||||
//
|
||||
this.FLP_SpA.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_SpA.Controls.Add(this.Label_SPA);
|
||||
this.FLP_SpA.Controls.Add(this.TB_SPAIV);
|
||||
this.FLP_SpA.Controls.Add(this.TB_SPAEV);
|
||||
this.FLP_SpA.Controls.Add(this.Stat_SPA);
|
||||
this.FLP_SpA.Location = new System.Drawing.Point(0, 85);
|
||||
this.FLP_SpA.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_SpA.Name = "FLP_SpA";
|
||||
this.FLP_SpA.Size = new System.Drawing.Size(172, 21);
|
||||
this.FLP_SpA.TabIndex = 126;
|
||||
//
|
||||
// Label_SPA
|
||||
//
|
||||
this.Label_SPA.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_SPA.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_SPA.Name = "Label_SPA";
|
||||
this.Label_SPA.Size = new System.Drawing.Size(65, 21);
|
||||
this.Label_SPA.TabIndex = 51;
|
||||
this.Label_SPA.Text = "SpA:";
|
||||
this.Label_SPA.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// TB_SPAIV
|
||||
//
|
||||
this.TB_SPAIV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_SPAIV.Location = new System.Drawing.Point(65, 0);
|
||||
this.TB_SPAIV.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.TB_SPAIV.Mask = "00";
|
||||
this.TB_SPAIV.Name = "TB_SPAIV";
|
||||
this.TB_SPAIV.Size = new System.Drawing.Size(22, 20);
|
||||
this.TB_SPAIV.TabIndex = 49;
|
||||
this.TB_SPAIV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_SPAIV.TextChanged += new System.EventHandler(this.UpdateIV);
|
||||
//
|
||||
// TB_SPAEV
|
||||
//
|
||||
this.TB_SPAEV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_SPAEV.Location = new System.Drawing.Point(93, 0);
|
||||
this.TB_SPAEV.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.TB_SPAEV.Mask = "000";
|
||||
this.TB_SPAEV.Name = "TB_SPAEV";
|
||||
this.TB_SPAEV.Size = new System.Drawing.Size(28, 20);
|
||||
this.TB_SPAEV.TabIndex = 50;
|
||||
this.TB_SPAEV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_SPAEV.TextChanged += new System.EventHandler(this.UpdateEV);
|
||||
//
|
||||
// Stat_SPA
|
||||
//
|
||||
this.Stat_SPA.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.Stat_SPA.Enabled = false;
|
||||
this.Stat_SPA.Location = new System.Drawing.Point(127, 0);
|
||||
this.Stat_SPA.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.Stat_SPA.Mask = "00000";
|
||||
this.Stat_SPA.Name = "Stat_SPA";
|
||||
this.Stat_SPA.PromptChar = ' ';
|
||||
this.Stat_SPA.Size = new System.Drawing.Size(37, 20);
|
||||
this.Stat_SPA.TabIndex = 52;
|
||||
this.Stat_SPA.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// FLP_SpD
|
||||
//
|
||||
this.FLP_SpD.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_SpD.Controls.Add(this.Label_SPD);
|
||||
this.FLP_SpD.Controls.Add(this.TB_SPDIV);
|
||||
this.FLP_SpD.Controls.Add(this.TB_SPDEV);
|
||||
this.FLP_SpD.Controls.Add(this.Stat_SPD);
|
||||
this.FLP_SpD.Location = new System.Drawing.Point(0, 106);
|
||||
this.FLP_SpD.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_SpD.Name = "FLP_SpD";
|
||||
this.FLP_SpD.Size = new System.Drawing.Size(172, 21);
|
||||
this.FLP_SpD.TabIndex = 127;
|
||||
//
|
||||
// Label_SPD
|
||||
//
|
||||
this.Label_SPD.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_SPD.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_SPD.Name = "Label_SPD";
|
||||
this.Label_SPD.Size = new System.Drawing.Size(65, 21);
|
||||
this.Label_SPD.TabIndex = 23;
|
||||
this.Label_SPD.Text = "SpD:";
|
||||
this.Label_SPD.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// TB_SPDIV
|
||||
//
|
||||
this.TB_SPDIV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_SPDIV.Location = new System.Drawing.Point(65, 0);
|
||||
this.TB_SPDIV.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.TB_SPDIV.Mask = "00";
|
||||
this.TB_SPDIV.Name = "TB_SPDIV";
|
||||
this.TB_SPDIV.Size = new System.Drawing.Size(22, 20);
|
||||
this.TB_SPDIV.TabIndex = 5;
|
||||
this.TB_SPDIV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_SPDIV.TextChanged += new System.EventHandler(this.UpdateIV);
|
||||
//
|
||||
// TB_SPDEV
|
||||
//
|
||||
this.TB_SPDEV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_SPDEV.Location = new System.Drawing.Point(93, 0);
|
||||
this.TB_SPDEV.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.TB_SPDEV.Mask = "000";
|
||||
this.TB_SPDEV.Name = "TB_SPDEV";
|
||||
this.TB_SPDEV.Size = new System.Drawing.Size(28, 20);
|
||||
this.TB_SPDEV.TabIndex = 11;
|
||||
this.TB_SPDEV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_SPDEV.TextChanged += new System.EventHandler(this.UpdateEV);
|
||||
//
|
||||
// Stat_SPD
|
||||
//
|
||||
this.Stat_SPD.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.Stat_SPD.Enabled = false;
|
||||
this.Stat_SPD.Location = new System.Drawing.Point(127, 0);
|
||||
this.Stat_SPD.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.Stat_SPD.Mask = "00000";
|
||||
this.Stat_SPD.Name = "Stat_SPD";
|
||||
this.Stat_SPD.PromptChar = ' ';
|
||||
this.Stat_SPD.Size = new System.Drawing.Size(37, 20);
|
||||
this.Stat_SPD.TabIndex = 49;
|
||||
this.Stat_SPD.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// FLP_Spe
|
||||
//
|
||||
this.FLP_Spe.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_Spe.Controls.Add(this.Label_SPE);
|
||||
this.FLP_Spe.Controls.Add(this.TB_SPEIV);
|
||||
this.FLP_Spe.Controls.Add(this.TB_SPEEV);
|
||||
this.FLP_Spe.Controls.Add(this.Stat_SPE);
|
||||
this.FLP_Spe.Location = new System.Drawing.Point(0, 127);
|
||||
this.FLP_Spe.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_Spe.Name = "FLP_Spe";
|
||||
this.FLP_Spe.Size = new System.Drawing.Size(172, 21);
|
||||
this.FLP_Spe.TabIndex = 128;
|
||||
//
|
||||
// Label_SPE
|
||||
//
|
||||
this.Label_SPE.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_SPE.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_SPE.Name = "Label_SPE";
|
||||
this.Label_SPE.Size = new System.Drawing.Size(65, 21);
|
||||
this.Label_SPE.TabIndex = 24;
|
||||
this.Label_SPE.Text = "Spe:";
|
||||
this.Label_SPE.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// TB_SPEIV
|
||||
//
|
||||
this.TB_SPEIV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_SPEIV.Location = new System.Drawing.Point(65, 0);
|
||||
this.TB_SPEIV.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.TB_SPEIV.Mask = "00";
|
||||
this.TB_SPEIV.Name = "TB_SPEIV";
|
||||
this.TB_SPEIV.Size = new System.Drawing.Size(22, 20);
|
||||
this.TB_SPEIV.TabIndex = 51;
|
||||
this.TB_SPEIV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_SPEIV.TextChanged += new System.EventHandler(this.UpdateIV);
|
||||
//
|
||||
// TB_SPEEV
|
||||
//
|
||||
this.TB_SPEEV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_SPEEV.Location = new System.Drawing.Point(93, 0);
|
||||
this.TB_SPEEV.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.TB_SPEEV.Mask = "000";
|
||||
this.TB_SPEEV.Name = "TB_SPEEV";
|
||||
this.TB_SPEEV.Size = new System.Drawing.Size(28, 20);
|
||||
this.TB_SPEEV.TabIndex = 52;
|
||||
this.TB_SPEEV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.TB_SPEEV.TextChanged += new System.EventHandler(this.UpdateEV);
|
||||
//
|
||||
// Stat_SPE
|
||||
//
|
||||
this.Stat_SPE.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.Stat_SPE.Enabled = false;
|
||||
this.Stat_SPE.Location = new System.Drawing.Point(127, 0);
|
||||
this.Stat_SPE.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.Stat_SPE.Mask = "00000";
|
||||
this.Stat_SPE.Name = "Stat_SPE";
|
||||
this.Stat_SPE.PromptChar = ' ';
|
||||
this.Stat_SPE.Size = new System.Drawing.Size(37, 20);
|
||||
this.Stat_SPE.TabIndex = 53;
|
||||
this.Stat_SPE.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// FLP_StatsTotal
|
||||
//
|
||||
this.FLP_StatsTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_StatsTotal.Controls.Add(this.Label_Total);
|
||||
this.FLP_StatsTotal.Controls.Add(this.TB_IVTotal);
|
||||
this.FLP_StatsTotal.Controls.Add(this.TB_EVTotal);
|
||||
this.FLP_StatsTotal.Location = new System.Drawing.Point(0, 148);
|
||||
this.FLP_StatsTotal.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_StatsTotal.Name = "FLP_StatsTotal";
|
||||
this.FLP_StatsTotal.Size = new System.Drawing.Size(172, 21);
|
||||
this.FLP_StatsTotal.TabIndex = 129;
|
||||
//
|
||||
// Label_Total
|
||||
//
|
||||
this.Label_Total.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_Total.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_Total.Name = "Label_Total";
|
||||
this.Label_Total.Size = new System.Drawing.Size(65, 21);
|
||||
this.Label_Total.TabIndex = 25;
|
||||
this.Label_Total.Text = "Total:";
|
||||
this.Label_Total.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// TB_IVTotal
|
||||
//
|
||||
this.TB_IVTotal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_IVTotal.Enabled = false;
|
||||
this.TB_IVTotal.Location = new System.Drawing.Point(65, 0);
|
||||
this.TB_IVTotal.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.TB_IVTotal.MaxLength = 3;
|
||||
this.TB_IVTotal.Name = "TB_IVTotal";
|
||||
this.TB_IVTotal.Size = new System.Drawing.Size(22, 20);
|
||||
this.TB_IVTotal.TabIndex = 44;
|
||||
this.TB_IVTotal.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// TB_EVTotal
|
||||
//
|
||||
this.TB_EVTotal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TB_EVTotal.Enabled = false;
|
||||
this.TB_EVTotal.Location = new System.Drawing.Point(93, 0);
|
||||
this.TB_EVTotal.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.TB_EVTotal.MaxLength = 3;
|
||||
this.TB_EVTotal.Name = "TB_EVTotal";
|
||||
this.TB_EVTotal.Size = new System.Drawing.Size(28, 20);
|
||||
this.TB_EVTotal.TabIndex = 43;
|
||||
this.TB_EVTotal.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// FLP_HPType
|
||||
//
|
||||
this.FLP_HPType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.FLP_HPType.Controls.Add(this.Label_HiddenPowerPrefix);
|
||||
this.FLP_HPType.Controls.Add(this.CB_HPType);
|
||||
this.FLP_HPType.Location = new System.Drawing.Point(0, 169);
|
||||
this.FLP_HPType.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.FLP_HPType.Name = "FLP_HPType";
|
||||
this.FLP_HPType.Size = new System.Drawing.Size(172, 21);
|
||||
this.FLP_HPType.TabIndex = 130;
|
||||
//
|
||||
// Label_HiddenPowerPrefix
|
||||
//
|
||||
this.Label_HiddenPowerPrefix.Location = new System.Drawing.Point(0, 0);
|
||||
this.Label_HiddenPowerPrefix.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.Label_HiddenPowerPrefix.Name = "Label_HiddenPowerPrefix";
|
||||
this.Label_HiddenPowerPrefix.Size = new System.Drawing.Size(102, 21);
|
||||
this.Label_HiddenPowerPrefix.TabIndex = 29;
|
||||
this.Label_HiddenPowerPrefix.Text = "Hidden Power:";
|
||||
this.Label_HiddenPowerPrefix.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// CB_HPType
|
||||
//
|
||||
this.CB_HPType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.CB_HPType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.CB_HPType.DropDownWidth = 80;
|
||||
this.CB_HPType.FormattingEnabled = true;
|
||||
this.CB_HPType.Location = new System.Drawing.Point(102, 0);
|
||||
this.CB_HPType.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.CB_HPType.Name = "CB_HPType";
|
||||
this.CB_HPType.Size = new System.Drawing.Size(70, 21);
|
||||
this.CB_HPType.TabIndex = 44;
|
||||
this.CB_HPType.SelectedIndexChanged += new System.EventHandler(this.ChangeHPType);
|
||||
//
|
||||
// StatEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.FLP_Stats);
|
||||
this.Name = "StatEditor";
|
||||
this.Size = new System.Drawing.Size(165, 212);
|
||||
this.FLP_Stats.ResumeLayout(false);
|
||||
this.FLP_StatHeader.ResumeLayout(false);
|
||||
this.FLP_StatsHeaderRight.ResumeLayout(false);
|
||||
this.FLP_HP.ResumeLayout(false);
|
||||
this.FLP_HP.PerformLayout();
|
||||
this.FLP_Atk.ResumeLayout(false);
|
||||
this.FLP_Atk.PerformLayout();
|
||||
this.FLP_Def.ResumeLayout(false);
|
||||
this.FLP_Def.PerformLayout();
|
||||
this.FLP_SpA.ResumeLayout(false);
|
||||
this.FLP_SpA.PerformLayout();
|
||||
this.FLP_SpD.ResumeLayout(false);
|
||||
this.FLP_SpD.PerformLayout();
|
||||
this.FLP_Spe.ResumeLayout(false);
|
||||
this.FLP_Spe.PerformLayout();
|
||||
this.FLP_StatsTotal.ResumeLayout(false);
|
||||
this.FLP_StatsTotal.PerformLayout();
|
||||
this.FLP_HPType.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_Stats;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_StatHeader;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_StatsHeaderRight;
|
||||
private System.Windows.Forms.Label Label_IVs;
|
||||
private System.Windows.Forms.Label Label_EVs;
|
||||
private System.Windows.Forms.Label Label_Stats;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_HP;
|
||||
private System.Windows.Forms.Label Label_HP;
|
||||
private System.Windows.Forms.MaskedTextBox TB_HPIV;
|
||||
private System.Windows.Forms.MaskedTextBox TB_HPEV;
|
||||
private System.Windows.Forms.MaskedTextBox Stat_HP;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_Atk;
|
||||
private System.Windows.Forms.Label Label_ATK;
|
||||
private System.Windows.Forms.MaskedTextBox TB_ATKIV;
|
||||
private System.Windows.Forms.MaskedTextBox TB_ATKEV;
|
||||
private System.Windows.Forms.MaskedTextBox Stat_ATK;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_Def;
|
||||
private System.Windows.Forms.Label Label_DEF;
|
||||
private System.Windows.Forms.MaskedTextBox TB_DEFIV;
|
||||
private System.Windows.Forms.MaskedTextBox TB_DEFEV;
|
||||
private System.Windows.Forms.MaskedTextBox Stat_DEF;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_SpA;
|
||||
private System.Windows.Forms.Label Label_SPA;
|
||||
private System.Windows.Forms.MaskedTextBox TB_SPAIV;
|
||||
private System.Windows.Forms.MaskedTextBox TB_SPAEV;
|
||||
private System.Windows.Forms.MaskedTextBox Stat_SPA;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_SpD;
|
||||
private System.Windows.Forms.Label Label_SPD;
|
||||
private System.Windows.Forms.MaskedTextBox TB_SPDIV;
|
||||
private System.Windows.Forms.MaskedTextBox TB_SPDEV;
|
||||
private System.Windows.Forms.MaskedTextBox Stat_SPD;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_Spe;
|
||||
private System.Windows.Forms.Label Label_SPE;
|
||||
private System.Windows.Forms.MaskedTextBox TB_SPEIV;
|
||||
private System.Windows.Forms.MaskedTextBox TB_SPEEV;
|
||||
private System.Windows.Forms.MaskedTextBox Stat_SPE;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_StatsTotal;
|
||||
private System.Windows.Forms.Label Label_Total;
|
||||
private System.Windows.Forms.TextBox TB_IVTotal;
|
||||
private System.Windows.Forms.TextBox TB_EVTotal;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLP_HPType;
|
||||
private System.Windows.Forms.Label Label_HiddenPowerPrefix;
|
||||
private System.Windows.Forms.ComboBox CB_HPType;
|
||||
}
|
||||
}
|
||||
136
pkNX.WinForms/Controls/StatEditor.cs
Normal file
136
pkNX.WinForms/Controls/StatEditor.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using pkNX.Structures;
|
||||
using Util = pkNX.Randomization.Util;
|
||||
|
||||
namespace pkNX.WinForms.Controls
|
||||
{
|
||||
public partial class StatEditor : UserControl
|
||||
{
|
||||
public StatEditor()
|
||||
{
|
||||
InitializeComponent();
|
||||
tb_iv = new[] { TB_HPIV, TB_ATKIV, TB_DEFIV, TB_SPEIV, TB_SPAIV, TB_SPDIV };
|
||||
tb_ev = new[] { TB_HPEV, TB_ATKEV, TB_DEFEV, TB_SPEEV, TB_SPAEV, TB_SPDEV };
|
||||
labarray = new[] { Label_ATK, Label_DEF, Label_SPE, Label_SPA, Label_SPD };
|
||||
}
|
||||
|
||||
public void Initialize(string[] types)
|
||||
{
|
||||
UpdatingFields = true;
|
||||
foreach (var t in types.Skip(1))
|
||||
CB_HPType.Items.Add(t);
|
||||
UpdatingFields = false;
|
||||
}
|
||||
|
||||
public PersonalTable Personal { private get; set; }
|
||||
public bool UpdatingFields;
|
||||
public StatPKM PKM { get; set; }
|
||||
|
||||
private readonly MaskedTextBox[] tb_iv;
|
||||
private readonly MaskedTextBox[] tb_ev;
|
||||
private readonly Label[] labarray;
|
||||
|
||||
public void UpdateStats()
|
||||
{
|
||||
if (UpdatingFields)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
UpdatingFields = true;
|
||||
if (Util.ToInt32(tb_iv[i].Text) > 31)
|
||||
tb_iv[i].Text = "31";
|
||||
if (Util.ToInt32(tb_ev[i].Text) > 255)
|
||||
tb_ev[i].Text = "255";
|
||||
UpdatingFields = false;
|
||||
}
|
||||
|
||||
var pi = Personal.GetFormeEntry(PKM.Species, PKM.Form);
|
||||
var stats = PKM.GetStats(pi);
|
||||
|
||||
Stat_HP.Text = stats[0].ToString();
|
||||
Stat_ATK.Text = stats[1].ToString();
|
||||
Stat_DEF.Text = stats[2].ToString();
|
||||
Stat_SPA.Text = stats[4].ToString();
|
||||
Stat_SPD.Text = stats[5].ToString();
|
||||
Stat_SPE.Text = stats[3].ToString();
|
||||
|
||||
TB_IVTotal.Text = tb_iv.Select(z => Util.ToInt32(z.Text)).Sum().ToString();
|
||||
TB_EVTotal.Text = tb_ev.Select(z => Util.ToInt32(z.Text)).Sum().ToString();
|
||||
|
||||
// Recolor the Stat Labels based on boosted stats.
|
||||
RecolorStatLabels();
|
||||
UpdatingFields = true;
|
||||
CB_HPType.SelectedIndex = PKM.HiddenPowerType;
|
||||
UpdatingFields = false;
|
||||
}
|
||||
|
||||
private void RecolorStatLabels()
|
||||
{
|
||||
int incr = (PKM.Nature / 5);
|
||||
int decr = (PKM.Nature % 5);
|
||||
// Reset Label Colors
|
||||
foreach (Label label in labarray)
|
||||
label.ResetForeColor();
|
||||
|
||||
// Set Colored StatLabels only if Nature isn't Neutral
|
||||
if (incr != decr)
|
||||
{
|
||||
labarray[incr].ForeColor = Color.Red;
|
||||
labarray[decr].ForeColor = Color.Blue;
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadStats(StatPKM pkm)
|
||||
{
|
||||
PKM = pkm;
|
||||
|
||||
UpdatingFields = true;
|
||||
for (int i = 0; i < 6; i++)
|
||||
tb_iv[i].Text = pkm.GetIV(i).ToString("00");
|
||||
for (int i = 0; i < 6; i++)
|
||||
tb_ev[i].Text = pkm.GetEV(i).ToString("00");
|
||||
CB_HPType.SelectedIndex = PKM.HiddenPowerType;
|
||||
UpdatingFields = false;
|
||||
UpdateStats();
|
||||
}
|
||||
|
||||
private void UpdateIV(object sender, EventArgs e)
|
||||
{
|
||||
if (UpdatingFields || !(sender is MaskedTextBox t))
|
||||
return;
|
||||
var index = Array.IndexOf(tb_iv, t);
|
||||
if (index < 0)
|
||||
return;
|
||||
int value = Math.Min(31, Util.ToInt32(t.Text));
|
||||
PKM.SetIV(index, value);
|
||||
UpdatingFields = true;
|
||||
CB_HPType.SelectedIndex = PKM.HiddenPowerType;
|
||||
UpdatingFields = false;
|
||||
UpdateStats();
|
||||
}
|
||||
|
||||
private void UpdateEV(object sender, EventArgs e)
|
||||
{
|
||||
if (UpdatingFields || !(sender is MaskedTextBox t))
|
||||
return;
|
||||
var index = Array.IndexOf(tb_iv, t);
|
||||
if (index < 0)
|
||||
return;
|
||||
int value = Math.Min(252, Util.ToInt32(t.Text));
|
||||
PKM.SetEV(index, value);
|
||||
UpdateStats();
|
||||
}
|
||||
|
||||
private void ChangeHPType(object sender, EventArgs e)
|
||||
{
|
||||
if (UpdatingFields)
|
||||
return;
|
||||
PKM.SetHPIVs(CB_HPType.SelectedIndex);
|
||||
UpdateStats();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
pkNX.WinForms/Controls/StatEditor.resx
Normal file
120
pkNX.WinForms/Controls/StatEditor.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>
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.IO;
|
||||
using pkNX.Containers;
|
||||
using pkNX.Game;
|
||||
using pkNX.Structures;
|
||||
|
||||
@@ -9,33 +8,46 @@ internal class EditorGG : EditorBase
|
||||
{
|
||||
protected internal EditorGG(GameManager rom) : base(rom) { }
|
||||
|
||||
public void EditTrainers()
|
||||
{
|
||||
WinFormsUtil.Alert("Not implemented yet.");
|
||||
}
|
||||
|
||||
public void EditCommon()
|
||||
{
|
||||
var text = ROM.GetFile(GameFile.GameText);
|
||||
((FolderContainer) text).Initialize(z => Path.GetExtension(z) == ".dat");
|
||||
var text = ROM.GetFilteredFolder(GameFile.GameText, z => Path.GetExtension(z) == ".dat");
|
||||
var config = new TextConfig(ROM.Game);
|
||||
var tc = new TextContainer(text, config);
|
||||
var editor = new TextEditor(tc, TextEditor.TextEditorMode.Common);
|
||||
editor.ShowDialog();
|
||||
if (!editor.Modified)
|
||||
var form = new TextEditor(tc, TextEditor.TextEditorMode.Common);
|
||||
form.ShowDialog();
|
||||
if (!form.Modified)
|
||||
text.CancelEdits();
|
||||
}
|
||||
|
||||
public void EditScript()
|
||||
{
|
||||
var text = ROM.GetFile(GameFile.StoryText);
|
||||
((FolderContainer)text).Initialize(z => Path.GetExtension(z) == ".dat");
|
||||
var text = ROM.GetFilteredFolder(GameFile.StoryText, z => Path.GetExtension(z) == ".dat");
|
||||
var config = new TextConfig(ROM.Game);
|
||||
var tc = new TextContainer(text, config);
|
||||
var editor = new TextEditor(tc, TextEditor.TextEditorMode.Script);
|
||||
editor.ShowDialog();
|
||||
if (!editor.Modified)
|
||||
var form = new TextEditor(tc, TextEditor.TextEditorMode.Script);
|
||||
form.ShowDialog();
|
||||
if (!form.Modified)
|
||||
text.CancelEdits();
|
||||
}
|
||||
|
||||
public void EditTrainers()
|
||||
{
|
||||
var editor = new TrainerEditor
|
||||
{
|
||||
ReadClass = data => new TrainerClass7b(data),
|
||||
ReadPoke = data => new TrainerPoke7b(data),
|
||||
ReadTrainer = data => new TrainerData7b(data),
|
||||
ReadTeam = TrainerPoke7b.ReadTeam,
|
||||
WriteTeam = TrainerPoke7b.WriteTeam,
|
||||
TrainerData = ROM.GetFilteredFolder(GameFile.TrainerData),
|
||||
TrainerPoke = ROM.GetFilteredFolder(GameFile.TrainerPoke),
|
||||
TrainerClass = ROM.GetFilteredFolder(GameFile.TrainerClass),
|
||||
};
|
||||
editor.Initialize();
|
||||
var form = new BTTE(ROM, editor);
|
||||
form.ShowDialog();
|
||||
if (!form.Modified)
|
||||
editor.CancelEdits();
|
||||
}
|
||||
}
|
||||
}
|
||||
492
pkNX.WinForms/Subforms/BTTE.cs
Normal file
492
pkNX.WinForms/Subforms/BTTE.cs
Normal file
@@ -0,0 +1,492 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using pkNX.Game;
|
||||
using pkNX.Structures;
|
||||
using pkNX.Sprites;
|
||||
|
||||
namespace pkNX.WinForms
|
||||
{
|
||||
public partial class BTTE : Form
|
||||
{
|
||||
private string[][] AltForms;
|
||||
private int entry = -1;
|
||||
private PictureBox[] pba;
|
||||
|
||||
private readonly PersonalTable Personal;
|
||||
private readonly GameManager Game;
|
||||
private readonly TrainerEditor Trainers;
|
||||
|
||||
private readonly string[] abilitylist;
|
||||
private readonly string[] movelist;
|
||||
private readonly string[] itemlist;
|
||||
private readonly string[] specieslist;
|
||||
private readonly string[] types;
|
||||
private readonly string[] natures;
|
||||
private readonly string[] trName;
|
||||
private readonly string[] trClass;
|
||||
|
||||
public BTTE(GameManager game, TrainerEditor editor)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Stats.Personal = Personal = game.Data.PersonalData;
|
||||
Game = game;
|
||||
Trainers = editor;
|
||||
|
||||
trClass = Game.GetStrings(TextName.TrainerClasses);
|
||||
trName = Game.GetStrings(TextName.TrainerClasses);
|
||||
|
||||
abilitylist = Game.GetStrings(TextName.AbilityNames);
|
||||
movelist = Game.GetStrings(TextName.MoveNames);
|
||||
itemlist = Game.GetStrings(TextName.ItemNames);
|
||||
specieslist = Game.GetStrings(TextName.SpeciesNames);
|
||||
types = Game.GetStrings(TextName.Types);
|
||||
natures = Game.GetStrings(TextName.Natures);
|
||||
trName = Game.GetStrings(TextName.TrainerNames);
|
||||
trClass = Game.GetStrings(TextName.TrainerClasses);
|
||||
|
||||
mnuView.Click += ClickView;
|
||||
mnuSet.Click += ClickSet;
|
||||
mnuDelete.Click += ClickDelete;
|
||||
Setup();
|
||||
foreach (var pb in pba)
|
||||
pb.Click += ClickSlot;
|
||||
|
||||
CB_TrainerID.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
public bool Modified { get; set; }
|
||||
|
||||
private int GetSlot(object sender)
|
||||
{
|
||||
var send = ((sender as ToolStripItem)?.Owner as ContextMenuStrip)?.SourceControl ?? sender as PictureBox;
|
||||
return Array.IndexOf(pba, send);
|
||||
}
|
||||
|
||||
private void ClickSlot(object sender, EventArgs e)
|
||||
{
|
||||
switch (ModifierKeys)
|
||||
{
|
||||
case Keys.Control: ClickView(sender, e); break;
|
||||
case Keys.Shift: ClickSet(sender, e); break;
|
||||
case Keys.Alt: ClickDelete(sender, e); break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ClickView(object sender, EventArgs e)
|
||||
{
|
||||
int slot = GetSlot(sender);
|
||||
if (pba[slot].Image == null)
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
return;
|
||||
}
|
||||
|
||||
// Load the PKM
|
||||
var pk = Trainers[entry].Team[slot];
|
||||
if (pk.Species != 0)
|
||||
{
|
||||
try { PopulateFields(pk); }
|
||||
catch { }
|
||||
// Visual to display what slot is currently loaded.
|
||||
GetSlotColor(slot, Sprites.Properties.Resources.slotView);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Media.SystemSounds.Exclamation.Play();
|
||||
}
|
||||
}
|
||||
|
||||
private void ClickSet(object sender, EventArgs e)
|
||||
{
|
||||
int slot = GetSlot(sender);
|
||||
if (CB_Species.SelectedIndex == 0)
|
||||
{ WinFormsUtil.Alert("Can't set empty slot."); return; }
|
||||
|
||||
var pk = PreparePKM();
|
||||
var tr = Trainers[entry];
|
||||
if (slot < tr.Team.Count)
|
||||
{
|
||||
tr.Team[slot] = pk;
|
||||
}
|
||||
else
|
||||
{
|
||||
tr.Team.Add(pk);
|
||||
slot = tr.Team.Count - 1;
|
||||
}
|
||||
|
||||
GetQuickFiller(pba[slot], pk);
|
||||
GetSlotColor(slot, Sprites.Properties.Resources.slotSet);
|
||||
}
|
||||
|
||||
private void ClickDelete(object sender, EventArgs e)
|
||||
{
|
||||
int slot = GetSlot(sender);
|
||||
|
||||
if (slot < Trainers[entry].Team.Count)
|
||||
Trainers[entry].Team.RemoveAt(slot);
|
||||
|
||||
PopulateTeam(Trainers[entry].Team);
|
||||
GetSlotColor(slot, Sprites.Properties.Resources.slotDel);
|
||||
}
|
||||
|
||||
private void PopulateTeam(IList<TrainerPoke> team)
|
||||
{
|
||||
for (int i = 0; i < team.Count; i++)
|
||||
GetQuickFiller(pba[i], team[i]);
|
||||
for (int i = team.Count; i < 6; i++)
|
||||
pba[i].Image = null;
|
||||
}
|
||||
|
||||
private void GetSlotColor(int slot, Image color)
|
||||
{
|
||||
foreach (PictureBox t in pba)
|
||||
t.BackgroundImage = null;
|
||||
|
||||
pba[slot].BackgroundImage = color;
|
||||
}
|
||||
|
||||
private static void GetQuickFiller(PictureBox pb, TrainerPoke pk)
|
||||
{
|
||||
var rawImg = SpriteBuilder.GetSprite(pk.Species, pk.Form, pk.Gender, pk.HeldItem, false, pk.Shiny);
|
||||
pb.Image = ImageUtil.ScaleImage((Bitmap)rawImg, 2);
|
||||
}
|
||||
|
||||
// Top Level Functions
|
||||
private void RefreshFormAbility(object sender, EventArgs e)
|
||||
{
|
||||
if (entry < 0)
|
||||
return;
|
||||
pkm.Form = CB_Forme.SelectedIndex;
|
||||
RefreshPKMSlotAbility();
|
||||
|
||||
if (!Stats.UpdatingFields)
|
||||
Stats.UpdateStats();
|
||||
}
|
||||
|
||||
private void RefreshSpeciesAbility(object sender, EventArgs e)
|
||||
{
|
||||
if (entry < 0)
|
||||
return;
|
||||
pkm.Species = (ushort)CB_Species.SelectedIndex;
|
||||
FormUtil.SetForms(CB_Species.SelectedIndex, CB_Forme, AltForms);
|
||||
RefreshPKMSlotAbility();
|
||||
|
||||
if (!Stats.UpdatingFields)
|
||||
Stats.UpdateStats();
|
||||
}
|
||||
|
||||
private void RefreshPKMSlotAbility()
|
||||
{
|
||||
int previousAbilityIndex = CB_Ability.SelectedIndex;
|
||||
|
||||
int species = CB_Species.SelectedIndex;
|
||||
int formnum = CB_Forme.SelectedIndex;
|
||||
int index = Personal[species].FormeIndex(species, formnum);
|
||||
|
||||
CB_Ability.Items.Clear();
|
||||
CB_Ability.Items.Add("Any (1 or 2)");
|
||||
CB_Ability.Items.Add(abilitylist[Personal[index].Abilities[0]] + " (1)");
|
||||
CB_Ability.Items.Add(abilitylist[Personal[index].Abilities[1]] + " (2)");
|
||||
CB_Ability.Items.Add(abilitylist[Personal[index].Abilities[2]] + " (H)");
|
||||
|
||||
CB_Ability.SelectedIndex = previousAbilityIndex;
|
||||
}
|
||||
|
||||
private static string GetEntryTitle(string str, int i) => $"{str} - {i:000}";
|
||||
|
||||
private void Setup()
|
||||
{
|
||||
AltForms = new byte[Personal.TableLength].Select(_ => Enumerable.Range(0, 32).Select(i => i.ToString()).ToArray()).ToArray();
|
||||
CB_TrainerID.Items.Clear();
|
||||
for (int i = 0; i < Trainers.Length; i++)
|
||||
CB_TrainerID.Items.Add(GetEntryTitle(trName[i] ?? "UNKNOWN", i));
|
||||
|
||||
CB_Trainer_Class.Items.Clear();
|
||||
for (int i = 0; i < trClass.Length; i++)
|
||||
CB_Trainer_Class.Items.Add(GetEntryTitle(trClass[i], i));
|
||||
|
||||
specieslist[0] = "---";
|
||||
abilitylist[0] = itemlist[0] = movelist[0] = "(None)";
|
||||
pba = new[] { PB_Team1, PB_Team2, PB_Team3, PB_Team4, PB_Team5, PB_Team6 };
|
||||
|
||||
CB_Species.Items.Clear();
|
||||
foreach (string s in specieslist)
|
||||
CB_Species.Items.Add(s);
|
||||
|
||||
CB_Move1.Items.Clear();
|
||||
CB_Move2.Items.Clear();
|
||||
CB_Move3.Items.Clear();
|
||||
CB_Move4.Items.Clear();
|
||||
foreach (string s in movelist)
|
||||
{
|
||||
CB_Move1.Items.Add(s);
|
||||
CB_Move2.Items.Add(s);
|
||||
CB_Move3.Items.Add(s);
|
||||
CB_Move4.Items.Add(s);
|
||||
}
|
||||
|
||||
Stats.Initialize(types);
|
||||
|
||||
CB_Nature.Items.Clear();
|
||||
CB_Nature.Items.AddRange(natures.Take(25).ToArray());
|
||||
|
||||
CB_Item.Items.Clear();
|
||||
foreach (string s in itemlist)
|
||||
CB_Item.Items.Add(s);
|
||||
|
||||
CB_Gender.Items.Clear();
|
||||
CB_Gender.Items.Add("- / Genderless/Random");
|
||||
CB_Gender.Items.Add("♂ / Male");
|
||||
CB_Gender.Items.Add("♀ / Female");
|
||||
|
||||
CB_Forme.Items.Add("");
|
||||
|
||||
CB_Species.SelectedIndex = 0;
|
||||
CB_Item_1.Items.Clear();
|
||||
CB_Item_2.Items.Clear();
|
||||
CB_Item_3.Items.Clear();
|
||||
CB_Item_4.Items.Clear();
|
||||
foreach (string s in itemlist)
|
||||
{
|
||||
CB_Item_1.Items.Add(s);
|
||||
CB_Item_2.Items.Add(s);
|
||||
CB_Item_3.Items.Add(s);
|
||||
CB_Item_4.Items.Add(s);
|
||||
}
|
||||
|
||||
CB_Money.Items.Clear();
|
||||
for (int i = 0; i < 256; i++)
|
||||
{ CB_Money.Items.Add(i.ToString()); }
|
||||
|
||||
CB_TrainerID.SelectedIndex = 0;
|
||||
entry = 0;
|
||||
pkm = new TrainerPoke7b();
|
||||
PopulateFields(pkm);
|
||||
}
|
||||
|
||||
private void ChangeTrainerIndex(object sender, EventArgs e)
|
||||
{
|
||||
SaveEntry();
|
||||
LoadEntry();
|
||||
if (TC_trdata.SelectedIndex == TC_trdata.TabCount - 1) // last
|
||||
TC_trdata.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void SaveEntry()
|
||||
{
|
||||
if (entry < 0)
|
||||
return;
|
||||
var tr = Trainers[entry];
|
||||
PrepareTrainer(tr.Self);
|
||||
}
|
||||
|
||||
private bool loading;
|
||||
|
||||
private void LoadEntry()
|
||||
{
|
||||
entry = CB_TrainerID.SelectedIndex;
|
||||
var tr = Trainers[entry];
|
||||
|
||||
loading = true;
|
||||
|
||||
PopulateFieldsTrainer(tr.Self);
|
||||
PopulateTeam(tr.Team);
|
||||
loading = false;
|
||||
}
|
||||
|
||||
private void UpdateTrainerName(object sender, EventArgs e)
|
||||
{
|
||||
if (loading)
|
||||
return;
|
||||
string str = TB_TrainerName.Text;
|
||||
CB_TrainerID.Items[entry] = GetEntryTitle(str, entry);
|
||||
}
|
||||
|
||||
private TrainerPoke pkm;
|
||||
|
||||
private void PopulateFields(TrainerPoke pk)
|
||||
{
|
||||
pkm = pk.Clone();
|
||||
|
||||
Stats.UpdatingFields = true;
|
||||
|
||||
CB_Species.SelectedIndex = pkm.Species;
|
||||
CB_Forme.SelectedIndex = pkm.Form;
|
||||
CB_Ability.SelectedIndex = pkm.Ability;
|
||||
CB_Nature.SelectedIndex = pkm.Nature;
|
||||
NUD_Level.Value = Math.Min(NUD_Level.Maximum, pkm.Level);
|
||||
CB_Item.SelectedIndex = pkm.HeldItem;
|
||||
CHK_Shiny.Checked = pkm.Shiny;
|
||||
CB_Gender.SelectedIndex = pkm.Gender;
|
||||
|
||||
CB_Move1.SelectedIndex = pkm.Move1;
|
||||
CB_Move2.SelectedIndex = pkm.Move2;
|
||||
CB_Move3.SelectedIndex = pkm.Move3;
|
||||
CB_Move4.SelectedIndex = pkm.Move4;
|
||||
|
||||
Stats.LoadStats(pk);
|
||||
}
|
||||
|
||||
private TrainerPoke PreparePKM()
|
||||
{
|
||||
var pk = pkm.Clone();
|
||||
pk.Species = CB_Species.SelectedIndex;
|
||||
pk.Form = CB_Forme.SelectedIndex;
|
||||
pk.Level = (byte)NUD_Level.Value;
|
||||
pk.Ability = CB_Ability.SelectedIndex;
|
||||
pk.HeldItem = CB_Item.SelectedIndex;
|
||||
pk.Shiny = CHK_Shiny.Checked;
|
||||
pk.Nature = CB_Nature.SelectedIndex;
|
||||
pk.Gender = CB_Gender.SelectedIndex;
|
||||
|
||||
pk.Move1 = CB_Move1.SelectedIndex;
|
||||
pk.Move2 = CB_Move2.SelectedIndex;
|
||||
pk.Move3 = CB_Move3.SelectedIndex;
|
||||
pk.Move4 = CB_Move4.SelectedIndex;
|
||||
|
||||
return pk;
|
||||
}
|
||||
|
||||
private void PopulateFieldsTrainer(TrainerData tr)
|
||||
{
|
||||
// Load Trainer Data
|
||||
CB_Trainer_Class.SelectedIndex = tr.Class;
|
||||
CB_Item_1.SelectedIndex = tr.Item1;
|
||||
CB_Item_2.SelectedIndex = tr.Item2;
|
||||
CB_Item_3.SelectedIndex = tr.Item3;
|
||||
CB_Item_4.SelectedIndex = tr.Item4;
|
||||
CB_Money.SelectedIndex = tr.Money;
|
||||
NUD_AI.Value = (int)tr.AI;
|
||||
}
|
||||
|
||||
private void PrepareTrainer(TrainerData tr)
|
||||
{
|
||||
tr.Class = (byte)CB_Trainer_Class.SelectedIndex;
|
||||
tr.Item1 = CB_Item_1.SelectedIndex;
|
||||
tr.Item2 = CB_Item_2.SelectedIndex;
|
||||
tr.Item3 = CB_Item_3.SelectedIndex;
|
||||
tr.Item4 = CB_Item_4.SelectedIndex;
|
||||
tr.Money = CB_Money.SelectedIndex;
|
||||
tr.AI = (uint)NUD_AI.Value;
|
||||
}
|
||||
|
||||
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||
{
|
||||
SaveEntry();
|
||||
base.OnFormClosing(e);
|
||||
}
|
||||
|
||||
private void DumpTxt(object sender, EventArgs e)
|
||||
{
|
||||
using (var sfd = new SaveFileDialog())
|
||||
{
|
||||
sfd.FileName = "Trainers.txt";
|
||||
if (sfd.ShowDialog() != DialogResult.OK)
|
||||
return;
|
||||
var sb = new StringBuilder();
|
||||
for (int i = 0; i < Trainers.Length; i++)
|
||||
sb.Append(GetTrainerString(Trainers[i]));
|
||||
File.WriteAllText(sfd.FileName, sb.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string GetTrainerString(VsTrainer Trainer)
|
||||
{
|
||||
var file = Trainer.ID;
|
||||
var tr = Trainer.Self;
|
||||
var name = Trainer.Name;
|
||||
var team = Trainer.Team;
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("======");
|
||||
sb.Append(file).Append(" - ").Append(trClass[tr.Class]).Append(" ").AppendLine(name);
|
||||
sb.AppendLine("======");
|
||||
sb.Append("Pokemon: ").Append(tr.NumPokemon).AppendLine();
|
||||
for (int i = 0; i < tr.NumPokemon; i++)
|
||||
{
|
||||
if (team[i].Shiny)
|
||||
sb.Append("Shiny ");
|
||||
sb.Append(specieslist[team[i].Species]);
|
||||
sb.Append(" (Lv. ").Append(team[i].Level).Append(") ");
|
||||
if (team[i].HeldItem > 0)
|
||||
sb.Append("@").Append(itemlist[team[i].HeldItem]);
|
||||
|
||||
if (team[i].Nature != 0)
|
||||
sb.Append(" (Nature: ").Append(natures[team[i].Nature]).Append(")");
|
||||
|
||||
sb.Append(" (Moves: ").Append(string.Join("/", team[i].Moves.Select(m => m == 0 ? "(None)" : movelist[m]))).Append(")");
|
||||
sb.Append(" IVs: ").Append(string.Join("/", team[i].IVs));
|
||||
sb.Append(" EVs: ").Append(string.Join("/", team[i].EVs));
|
||||
sb.AppendLine();
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private void UpdateStats(object sender, EventArgs e)
|
||||
{
|
||||
if (Stats.UpdatingFields)
|
||||
return;
|
||||
if (sender == CB_Nature)
|
||||
pkm.Nature = WinFormsUtil.GetIndex(CB_Nature);
|
||||
else if (sender == NUD_Level)
|
||||
pkm.Level = (int) NUD_Level.Value;
|
||||
|
||||
Stats.UpdateStats();
|
||||
}
|
||||
|
||||
private void B_HighAttack_Click(object sender, EventArgs e)
|
||||
{
|
||||
pkm.Species = CB_Species.SelectedIndex;
|
||||
pkm.Level = (int)NUD_Level.Value;
|
||||
pkm.Form = CB_Forme.SelectedIndex;
|
||||
//var moves = learn.GetHighPoweredMoves(pkm.Species, pkm.Form, 4);
|
||||
//SetMoves(moves);
|
||||
}
|
||||
|
||||
private void B_CurrentAttack_Click(object sender, EventArgs e)
|
||||
{
|
||||
pkm.Species = CB_Species.SelectedIndex;
|
||||
pkm.Level = (int)NUD_Level.Value;
|
||||
pkm.Form = CB_Forme.SelectedIndex;
|
||||
//var moves = learn.GetCurrentMoves(pkm.Species, pkm.Form, pkm.Level, 4);
|
||||
//SetMoves(moves);
|
||||
}
|
||||
|
||||
private void B_Clear_Click(object sender, EventArgs e) => SetMoves(new int[4]);
|
||||
|
||||
private void SetMoves(IList<int> moves)
|
||||
{
|
||||
var mcb = new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4 };
|
||||
for (int i = 0; i < mcb.Length; i++)
|
||||
mcb[i].SelectedIndex = moves[i];
|
||||
}
|
||||
}
|
||||
|
||||
public static class FormUtil
|
||||
{
|
||||
// Utility (Shared)
|
||||
internal static void SetForms(int species, ComboBox cb, string[][] AltForms)
|
||||
{
|
||||
cb.Items.Clear();
|
||||
string[] forms = AltForms[species];
|
||||
if (forms.Length < 2)
|
||||
{
|
||||
cb.Items.Add("");
|
||||
cb.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (string s in forms)
|
||||
cb.Items.Add(s);
|
||||
cb.Enabled = true;
|
||||
}
|
||||
cb.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
1003
pkNX.WinForms/Subforms/BTTE.designer.cs
generated
Normal file
1003
pkNX.WinForms/Subforms/BTTE.designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
123
pkNX.WinForms/Subforms/BTTE.resx
Normal file
123
pkNX.WinForms/Subforms/BTTE.resx
Normal 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="mnuVSD.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -4,7 +4,7 @@
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Util = pkNX.Randomization.Util;
|
||||
using pkNX.Randomization;
|
||||
|
||||
namespace pkNX.WinForms
|
||||
{
|
||||
|
||||
72
pkNX.WinForms/Subforms/TrainerEditor.cs
Normal file
72
pkNX.WinForms/Subforms/TrainerEditor.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using pkNX.Containers;
|
||||
using pkNX.Structures;
|
||||
|
||||
namespace pkNX.WinForms
|
||||
{
|
||||
public class TrainerEditor
|
||||
{
|
||||
public IFileContainer TrainerData;
|
||||
public IFileContainer TrainerPoke;
|
||||
public IFileContainer TrainerClass;
|
||||
public IFileContainer TrainerMsg;
|
||||
|
||||
public Func<byte[], TrainerData> ReadTrainer;
|
||||
public Func<byte[], TrainerPoke> ReadPoke;
|
||||
public Func<byte[], TrainerData, TrainerPoke7b[]> ReadTeam;
|
||||
public Func<TrainerPoke7b[], TrainerData, byte[]> WriteTeam;
|
||||
public Func<byte[], TrainerClass> ReadClass;
|
||||
|
||||
private VsTrainer[] Cache;
|
||||
private TrainerClass[] CacheClass;
|
||||
|
||||
public int Length => Cache.Length;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
Cache = new VsTrainer[TrainerData.Count];
|
||||
CacheClass = new TrainerClass[TrainerData.Count];
|
||||
}
|
||||
|
||||
public VsTrainer this[int index]
|
||||
{
|
||||
get => Cache[index] ?? (Cache[index] = LoadTrainer(index));
|
||||
set => Cache[index] = value;
|
||||
}
|
||||
|
||||
public TrainerClass GetClass(int index) => CacheClass[index] ?? (CacheClass[index] = ReadClass(TrainerClass[index]));
|
||||
|
||||
private VsTrainer LoadTrainer(int index)
|
||||
{
|
||||
var tr = ReadTrainer(TrainerData[index]);
|
||||
var poke = ReadTeam(TrainerPoke[index], tr);
|
||||
var data = new VsTrainer
|
||||
{
|
||||
ID = index,
|
||||
Self = tr,
|
||||
};
|
||||
data.Team.AddRange(poke);
|
||||
return data;
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
for (int i = 0; i < Length; i++)
|
||||
{
|
||||
var data = Cache[i];
|
||||
if (data == null)
|
||||
continue;
|
||||
data.Self.NumPokemon = data.Team.Count;
|
||||
TrainerData[i] = data.Self.Write();
|
||||
TrainerPoke[i] = data.Team.SelectMany(z => z.Write()).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public void CancelEdits()
|
||||
{
|
||||
TrainerData.CancelEdits();
|
||||
TrainerPoke.CancelEdits();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,5 +30,11 @@ internal static DialogResult Prompt(MessageBoxButtons btn, params string[] lines
|
||||
string msg = string.Join(Environment.NewLine + Environment.NewLine, lines);
|
||||
return MessageBox.Show(msg, "Prompt", btn, MessageBoxIcon.Asterisk);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the selected value of the input <see cref="cb"/>. If no value is selected, will return 0.
|
||||
/// </summary>
|
||||
/// <param name="cb">ComboBox to retrieve value for.</param>
|
||||
internal static int GetIndex(ComboBox cb) => (int)(cb?.SelectedValue ?? 0);
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,12 @@
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controls\StatEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\StatEditor.Designer.cs">
|
||||
<DependentUpon>StatEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainEditor\EditorAO.cs" />
|
||||
<Compile Include="MainEditor\EditorGG.cs" />
|
||||
<Compile Include="MainEditor\EditorORASDEMO.cs" />
|
||||
@@ -56,6 +62,12 @@
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Ripper\FileRipper.cs" />
|
||||
<Compile Include="Subforms\BTTE.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Subforms\BTTE.designer.cs">
|
||||
<DependentUpon>BTTE.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Subforms\TextContainer.cs" />
|
||||
<Compile Include="Subforms\TextEditor.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -63,7 +75,11 @@
|
||||
<Compile Include="Subforms\TextEditor.designer.cs">
|
||||
<DependentUpon>TextEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Subforms\TrainerEditor.cs" />
|
||||
<Compile Include="WinFormsUtil.cs" />
|
||||
<EmbeddedResource Include="Controls\StatEditor.resx">
|
||||
<DependentUpon>StatEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Main.resx">
|
||||
<DependentUpon>Main.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -77,6 +93,9 @@
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Subforms\BTTE.resx">
|
||||
<DependentUpon>BTTE.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Subforms\TextEditor.resx">
|
||||
<DependentUpon>TextEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -106,14 +125,16 @@
|
||||
<Name>pkNX.Randomization</Name>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\pkNX.Sprites\pkNX.Sprites.csproj">
|
||||
<Project>{55d82546-3dda-42e1-9a24-f6a08ee231b0}</Project>
|
||||
<Name>pkNX.Sprites</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\pkNX.Structures\pkNX.Structures.csproj">
|
||||
<Project>{01447516-8382-4e9b-8b6c-92ff0a2d0cbf}</Project>
|
||||
<Name>pkNX.Structures</Name>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Controls\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user