From 40b3887bd00dc79ebd7c024a1b620ce3f51d1344 Mon Sep 17 00:00:00 2001 From: pokecal Date: Fri, 3 Mar 2017 03:36:02 +0900 Subject: [PATCH 1/3] add Vivillon FormValue This value also once set when newgame start, depend on 3DS location settings. --- PKHeX/Saves/SAV7.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PKHeX/Saves/SAV7.cs b/PKHeX/Saves/SAV7.cs index bbead9aff..4a7b734a2 100644 --- a/PKHeX/Saves/SAV7.cs +++ b/PKHeX/Saves/SAV7.cs @@ -495,6 +495,11 @@ public uint BP BitConverter.GetBytes(value).CopyTo(Data, Misc + 0x11C); } } + public int Vivillon + { + get { return Data[Misc + 0x130] & 0x1F; } + set { Data[Misc + 0x130] = (byte)((Data[Misc + 0x130] & ~0x1F) | (value & 0x1F)); } + } public uint UsedFestaCoins { get { return BitConverter.ToUInt32(Data, 0x69C98); } From 6ede0b3bcee2cefd2cd057e50c2539641f5f8b56 Mon Sep 17 00:00:00 2001 From: pokecal Date: Fri, 3 Mar 2017 03:52:11 +0900 Subject: [PATCH 2/3] add Vivillon Form I first tried to put the control in same position as Gen6, but there is no space. --- .../Gen7/SAV_Trainer7.Designer.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.Designer.cs index 47b20539f..a33ce2b56 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.Designer.cs @@ -176,6 +176,8 @@ private void InitializeComponent() this.B_Fashion = new System.Windows.Forms.Button(); this.TB_PlazaName = new System.Windows.Forms.TextBox(); this.L_PlazaName = new System.Windows.Forms.Label(); + this.L_Vivillon = new System.Windows.Forms.Label(); + this.CB_Vivillon = new System.Windows.Forms.ComboBox(); this.TC_Editor.SuspendLayout(); this.Tab_Overview.SuspendLayout(); this.GB_Stats.SuspendLayout(); @@ -815,6 +817,8 @@ private void InitializeComponent() // // Tab_Overview // + this.Tab_Overview.Controls.Add(this.CB_Vivillon); + this.Tab_Overview.Controls.Add(this.L_Vivillon); this.Tab_Overview.Controls.Add(this.B_GenTID); this.Tab_Overview.Controls.Add(this.L_G7TID); this.Tab_Overview.Controls.Add(this.MT_G7TID); @@ -1791,6 +1795,24 @@ private void InitializeComponent() this.L_PlazaName.Text = "Festival Plaza Name:"; this.L_PlazaName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // L_Vivillon + // + this.L_Vivillon.Location = new System.Drawing.Point(-1, 101); + this.L_Vivillon.Name = "L_Vivillon"; + this.L_Vivillon.Size = new System.Drawing.Size(80, 12); + this.L_Vivillon.TabIndex = 64; + this.L_Vivillon.Text = "Vivillon:"; + this.L_Vivillon.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // CB_Vivillon + // + this.CB_Vivillon.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_Vivillon.FormattingEnabled = true; + this.CB_Vivillon.Location = new System.Drawing.Point(85, 98); + this.CB_Vivillon.Name = "CB_Vivillon"; + this.CB_Vivillon.Size = new System.Drawing.Size(93, 20); + this.CB_Vivillon.TabIndex = 65; + // // SAV_Trainer7 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1996,5 +2018,7 @@ private void InitializeComponent() private System.Windows.Forms.MaskedTextBox MT_G7TID; private System.Windows.Forms.TextBox TB_PlazaName; private System.Windows.Forms.Label L_PlazaName; + private System.Windows.Forms.Label L_Vivillon; + private System.Windows.Forms.ComboBox CB_Vivillon; } } From 77dd8d18298b2a413a4d07ac9e90517a34acbbe3 Mon Sep 17 00:00:00 2001 From: pokecal Date: Fri, 3 Mar 2017 04:22:18 +0900 Subject: [PATCH 3/3] add Vivillon FormValue This code will not change the value, even if the value is illegal. --- .../Subforms/Save Editors/Gen7/SAV_Trainer7.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs index 0512355a2..69a8d56aa 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs @@ -97,6 +97,11 @@ private void getComboBoxes() CB_SkinColor.Items.Add($"{Main.gendersymbols[0]} - {c}"); // M CB_SkinColor.Items.Add($"{Main.gendersymbols[1]} - {c}"); // F } + + L_Vivillon.Text = GameInfo.Strings.specieslist[666] + ":"; + CB_Vivillon.DisplayMember = "Text"; + CB_Vivillon.ValueMember = "Value"; + CB_Vivillon.DataSource = PKX.getFormList(666, GameInfo.Strings.types, GameInfo.Strings.forms, Main.gendersymbols).ToList(); } private void getTextBoxes() { @@ -183,6 +188,8 @@ private void getTextBoxes() CB_SkinColor.SelectedIndex = SAV.DressUpSkinColor; TB_PlazaName.Text = SAV.FestivalPlazaName; + + CB_Vivillon.SelectedIndex = (SAV.Vivillon < CB_Vivillon.Items.Count) ? SAV.Vivillon : -1; } private void save() { @@ -265,6 +272,9 @@ private void save() SAV.DressUpSkinColor = CB_SkinColor.SelectedIndex; SAV.FestivalPlazaName = TB_PlazaName.Text; + + // Vivillon + if (CB_Vivillon.SelectedIndex >= 0) SAV.Vivillon = CB_Vivillon.SelectedIndex; } private void clickOT(object sender, MouseEventArgs e)