From 243f94f02bd06cf2ab8178a95e0370545c22e2ed Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 18 Nov 2017 12:22:54 -0800 Subject: [PATCH] Add map coordinate writeback check same as sav7; apparently some areas in gen6 are also truncation prone --- .../Save Editors/Gen6/SAV_Trainer.Designer.cs | 26 +++++++++++-------- .../Subforms/Save Editors/Gen6/SAV_Trainer.cs | 8 +++++- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.Designer.cs index 48ddf7b21..c3baab983 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.Designer.cs @@ -200,11 +200,11 @@ private void InitializeComponent() this.L_X = new System.Windows.Forms.Label(); this.CHK_Badge6 = new System.Windows.Forms.CheckBox(); this.Tab_Multiplayer = new System.Windows.Forms.TabPage(); + this.CHK_MegaUnlocked = new System.Windows.Forms.CheckBox(); this.Tab_Maison = new System.Windows.Forms.TabPage(); this.Tab_Appearance = new System.Windows.Forms.TabPage(); this.L_TRNick = new System.Windows.Forms.Label(); this.TB_TRNick = new System.Windows.Forms.TextBox(); - this.CHK_MegaUnlocked = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.PB_Badge8)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PB_Badge6)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PB_Badge4)).BeginInit(); @@ -1983,6 +1983,7 @@ private void InitializeComponent() this.NUD_Z.Name = "NUD_Z"; this.NUD_Z.Size = new System.Drawing.Size(50, 20); this.NUD_Z.TabIndex = 53; + this.NUD_Z.ValueChanged += new System.EventHandler(this.ChangeMapValue); // // NUD_M // @@ -1995,6 +1996,7 @@ private void InitializeComponent() this.NUD_M.Name = "NUD_M"; this.NUD_M.Size = new System.Drawing.Size(50, 20); this.NUD_M.TabIndex = 52; + this.NUD_M.ValueChanged += new System.EventHandler(this.ChangeMapValue); // // NUD_Y // @@ -2008,6 +2010,7 @@ private void InitializeComponent() this.NUD_Y.Name = "NUD_Y"; this.NUD_Y.Size = new System.Drawing.Size(50, 20); this.NUD_Y.TabIndex = 51; + this.NUD_Y.ValueChanged += new System.EventHandler(this.ChangeMapValue); // // NUD_X // @@ -2021,6 +2024,7 @@ private void InitializeComponent() this.NUD_X.Name = "NUD_X"; this.NUD_X.Size = new System.Drawing.Size(50, 20); this.NUD_X.TabIndex = 50; + this.NUD_X.ValueChanged += new System.EventHandler(this.ChangeMapValue); // // L_Y // @@ -2085,6 +2089,16 @@ private void InitializeComponent() this.Tab_Multiplayer.Text = "Multiplayer"; this.Tab_Multiplayer.UseVisualStyleBackColor = true; // + // CHK_MegaUnlocked + // + this.CHK_MegaUnlocked.AutoSize = true; + this.CHK_MegaUnlocked.Location = new System.Drawing.Point(123, 216); + this.CHK_MegaUnlocked.Name = "CHK_MegaUnlocked"; + this.CHK_MegaUnlocked.Size = new System.Drawing.Size(149, 17); + this.CHK_MegaUnlocked.TabIndex = 76; + this.CHK_MegaUnlocked.Text = "Mega Evolution Unlocked"; + this.CHK_MegaUnlocked.UseVisualStyleBackColor = true; + // // Tab_Maison // this.Tab_Maison.Controls.Add(this.GB_MaisonCurrent); @@ -2169,16 +2183,6 @@ private void InitializeComponent() this.TB_TRNick.Text = "WWWWWWWWWWWW"; this.TB_TRNick.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // - // CHK_MegaUnlocked - // - this.CHK_MegaUnlocked.AutoSize = true; - this.CHK_MegaUnlocked.Location = new System.Drawing.Point(123, 216); - this.CHK_MegaUnlocked.Name = "CHK_MegaUnlocked"; - this.CHK_MegaUnlocked.Size = new System.Drawing.Size(149, 17); - this.CHK_MegaUnlocked.TabIndex = 76; - this.CHK_MegaUnlocked.Text = "Mega Evolution Unlocked"; - this.CHK_MegaUnlocked.UseVisualStyleBackColor = true; - // // SAV_Trainer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs index 27222c8c2..e2700f904 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs @@ -224,6 +224,7 @@ public SAV_Trainer(SaveFile sav) private readonly MaskedTextBox[] MaisonRecords; private readonly CheckBox[] cba; private readonly PictureBox[] pba; + private bool MapUpdated; private void GetComboBoxes() { @@ -506,7 +507,7 @@ private void Save() SAV.SetMaisonStat(i, ushort.Parse(MaisonRecords[i].Text)); // Copy Position - if (GB_Map.Enabled) + if (GB_Map.Enabled && MapUpdated) { SAV.M = (int)NUD_M.Value; SAV.X = (float)NUD_X.Value; @@ -671,6 +672,11 @@ private void ToggleBadge(object sender, EventArgs e) { cba[Array.IndexOf(pba, sender)].Checked ^= true; } + private void ChangeMapValue(object sender, EventArgs e) + { + if (!editing) + MapUpdated = true; + } private void CB_Multi_SelectedIndexChanged(object sender, EventArgs e) {