From d5daa001dda6927a1237d428dfaf78976f844028 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 17 Jan 2015 09:36:48 -0800 Subject: [PATCH] Add Distribution Super Training Flags Thanks SciresM! --- PKX/f1-Main.Designer.cs | 1 - PKX/f4-RibbMedal.Designer.cs | 92 +++++++++++++++++++++++++++++++++++- PKX/f4-RibbMedal.cs | 23 ++++++++- PKX/f4-RibbMedal.resx | 21 ++++++++ 4 files changed, 134 insertions(+), 3 deletions(-) diff --git a/PKX/f1-Main.Designer.cs b/PKX/f1-Main.Designer.cs index f7eabc052..df0a739be 100644 --- a/PKX/f1-Main.Designer.cs +++ b/PKX/f1-Main.Designer.cs @@ -2416,7 +2416,6 @@ public void InitializeComponent() this.CB_ExtraBytes.Items.AddRange(new object[] { "0x36", "0x37", - "0x3A", "0x3B", "0x3C", "0x3D", diff --git a/PKX/f4-RibbMedal.Designer.cs b/PKX/f4-RibbMedal.Designer.cs index ff84ff337..ad88f6703 100644 --- a/PKX/f4-RibbMedal.Designer.cs +++ b/PKX/f4-RibbMedal.Designer.cs @@ -236,6 +236,13 @@ private void InitializeComponent() this.Hoenn1b_5 = new System.Windows.Forms.CheckBox(); this.Hoenn1b_6 = new System.Windows.Forms.CheckBox(); this.Hoenn1b_7 = new System.Windows.Forms.CheckBox(); + this.CHK_D5 = new System.Windows.Forms.CheckBox(); + this.CHK_D4 = new System.Windows.Forms.CheckBox(); + this.L_Distro = new System.Windows.Forms.Label(); + this.CHK_D3 = new System.Windows.Forms.CheckBox(); + this.CHK_D0 = new System.Windows.Forms.CheckBox(); + this.CHK_D1 = new System.Windows.Forms.CheckBox(); + this.CHK_D2 = new System.Windows.Forms.CheckBox(); this.Tab_Medals.SuspendLayout(); this.GB_Medals1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); @@ -337,6 +344,13 @@ private void InitializeComponent() // // Tab_Medals // + this.Tab_Medals.Controls.Add(this.CHK_D5); + this.Tab_Medals.Controls.Add(this.CHK_D4); + this.Tab_Medals.Controls.Add(this.L_Distro); + this.Tab_Medals.Controls.Add(this.CHK_D3); + this.Tab_Medals.Controls.Add(this.CHK_D0); + this.Tab_Medals.Controls.Add(this.CHK_D1); + this.Tab_Medals.Controls.Add(this.CHK_D2); this.Tab_Medals.Controls.Add(this.CHK_Secret); this.Tab_Medals.Controls.Add(this.GB_Medals1); this.Tab_Medals.Controls.Add(this.GB_Medals2); @@ -351,7 +365,7 @@ private void InitializeComponent() // CHK_Secret // this.CHK_Secret.AutoSize = true; - this.CHK_Secret.Location = new System.Drawing.Point(295, 17); + this.CHK_Secret.Location = new System.Drawing.Point(244, 32); this.CHK_Secret.Name = "CHK_Secret"; this.CHK_Secret.Size = new System.Drawing.Size(140, 17); this.CHK_Secret.TabIndex = 19; @@ -2595,6 +2609,75 @@ private void InitializeComponent() this.Hoenn1b_7.Text = "Smart Master"; this.Hoenn1b_7.UseVisualStyleBackColor = true; // + // CHK_D5 + // + this.CHK_D5.AutoSize = true; + this.CHK_D5.Location = new System.Drawing.Point(447, 16); + this.CHK_D5.Name = "CHK_D5"; + this.CHK_D5.Size = new System.Drawing.Size(32, 17); + this.CHK_D5.TabIndex = 44; + this.CHK_D5.Text = "5"; + this.CHK_D5.UseVisualStyleBackColor = true; + // + // CHK_D4 + // + this.CHK_D4.AutoSize = true; + this.CHK_D4.Location = new System.Drawing.Point(415, 16); + this.CHK_D4.Name = "CHK_D4"; + this.CHK_D4.Size = new System.Drawing.Size(32, 17); + this.CHK_D4.TabIndex = 43; + this.CHK_D4.Text = "4"; + this.CHK_D4.UseVisualStyleBackColor = true; + // + // L_Distro + // + this.L_Distro.AutoSize = true; + this.L_Distro.Location = new System.Drawing.Point(318, 3); + this.L_Distro.Name = "L_Distro"; + this.L_Distro.Size = new System.Drawing.Size(62, 13); + this.L_Distro.TabIndex = 38; + this.L_Distro.Text = "Distribution:"; + // + // CHK_D3 + // + this.CHK_D3.AutoSize = true; + this.CHK_D3.Location = new System.Drawing.Point(382, 16); + this.CHK_D3.Name = "CHK_D3"; + this.CHK_D3.Size = new System.Drawing.Size(32, 17); + this.CHK_D3.TabIndex = 42; + this.CHK_D3.Text = "3"; + this.CHK_D3.UseVisualStyleBackColor = true; + // + // CHK_D0 + // + this.CHK_D0.AutoSize = true; + this.CHK_D0.Location = new System.Drawing.Point(382, 2); + this.CHK_D0.Name = "CHK_D0"; + this.CHK_D0.Size = new System.Drawing.Size(32, 17); + this.CHK_D0.TabIndex = 39; + this.CHK_D0.Text = "0"; + this.CHK_D0.UseVisualStyleBackColor = true; + // + // CHK_D1 + // + this.CHK_D1.AutoSize = true; + this.CHK_D1.Location = new System.Drawing.Point(415, 2); + this.CHK_D1.Name = "CHK_D1"; + this.CHK_D1.Size = new System.Drawing.Size(32, 17); + this.CHK_D1.TabIndex = 40; + this.CHK_D1.Text = "1"; + this.CHK_D1.UseVisualStyleBackColor = true; + // + // CHK_D2 + // + this.CHK_D2.AutoSize = true; + this.CHK_D2.Location = new System.Drawing.Point(447, 2); + this.CHK_D2.Name = "CHK_D2"; + this.CHK_D2.Size = new System.Drawing.Size(32, 17); + this.CHK_D2.TabIndex = 41; + this.CHK_D2.Text = "2"; + this.CHK_D2.UseVisualStyleBackColor = true; + // // RibbMedal // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2889,5 +2972,12 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox ORAS_1; private System.Windows.Forms.CheckBox ORAS_0; private System.Windows.Forms.CheckBox Extra1_7; + private System.Windows.Forms.CheckBox CHK_D5; + private System.Windows.Forms.CheckBox CHK_D4; + private System.Windows.Forms.Label L_Distro; + private System.Windows.Forms.CheckBox CHK_D3; + private System.Windows.Forms.CheckBox CHK_D0; + private System.Windows.Forms.CheckBox CHK_D1; + private System.Windows.Forms.CheckBox CHK_D2; } } \ No newline at end of file diff --git a/PKX/f4-RibbMedal.cs b/PKX/f4-RibbMedal.cs index 644edd154..9f6466541 100644 --- a/PKX/f4-RibbMedal.cs +++ b/PKX/f4-RibbMedal.cs @@ -15,6 +15,7 @@ namespace PKHeX public partial class RibbMedal : Form { Form1 m_parent; + CheckBox[] distro; public RibbMedal(Form1 frm1) { InitializeComponent(); @@ -28,7 +29,7 @@ public RibbMedal(Form1 frm1) comboBox1.Items.Add(Form1.trainingbags[i]); comboBox1.SelectedIndex = m_parent.buff[0x17]; numericUpDown1.Value = m_parent.buff[0x16]; - + distro = new CheckBox[] { CHK_D0, CHK_D1, CHK_D2, CHK_D3, CHK_D4, CHK_D5 }; getRibbons(); } private void getRibbons() @@ -173,6 +174,15 @@ private void getRibbons() TB_PastContest.Text = m_parent.buff[0x38].ToString(); TB_PastBattle.Text = m_parent.buff[0x39].ToString(); + + rv = m_parent.buff[0x3A]; + updateRibbon(CHK_D0, rv, 0); + updateRibbon(CHK_D1, rv, 1); + updateRibbon(CHK_D2, rv, 2); + updateRibbon(CHK_D3, rv, 3); + updateRibbon(CHK_D4, rv, 4); + updateRibbon(CHK_D5, rv, 5); + CHK_Secret.Checked = Convert.ToBoolean(m_parent.buff[0x72]); } // Populate Ribbons prompted private void setRibbons() @@ -278,6 +288,16 @@ private void setRibbons() m_parent.buff[0x38] = (byte)Util.ToUInt32(TB_PastContest.Text); m_parent.buff[0x39] = (byte)Util.ToUInt32(TB_PastBattle.Text); + + int dis = 0; + dis |= addRibbon(CHK_D0); + dis |= addRibbon(CHK_D1); + dis |= addRibbon(CHK_D2); + dis |= addRibbon(CHK_D3); + dis |= addRibbon(CHK_D4); + dis |= addRibbon(CHK_D5); + m_parent.buff[0x3A] = (byte)dis; + m_parent.buff[0x72] = (byte)Convert.ToByte(CHK_Secret.Checked); } // Saving Ribbons prompted private void updateRibbon(CheckBox chk, int rv, int sh) @@ -349,6 +369,7 @@ private void buttonFlag(bool b) CHK_Secret }; checkboxFlag(ck, b); + foreach (CheckBox chk in distro) chk.Checked = b; } } // Checkbox Flipping Logic (dependent on Tab) diff --git a/PKX/f4-RibbMedal.resx b/PKX/f4-RibbMedal.resx index 7be9ea5e0..2fdd2054b 100644 --- a/PKX/f4-RibbMedal.resx +++ b/PKX/f4-RibbMedal.resx @@ -120,6 +120,27 @@ True + + True + + + True + + + True + + + True + + + True + + + True + + + True + True