From 969f733c2ccf10532fa835290f9d431aff625ca3 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 10 May 2024 19:26:48 -0500 Subject: [PATCH] Fix pkmeditor auto-set Nickname flag Event was stolen via impossible-chars change, so just revert & call that method so only 1 method is hooked to the event. --- PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs | 2 +- PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs index 989d870e0..9efe2b033 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs @@ -633,7 +633,7 @@ private void InitializeComponent() TB_Nickname.Name = "TB_Nickname"; TB_Nickname.Size = new System.Drawing.Size(144, 23); TB_Nickname.TabIndex = 5; - TB_Nickname.TextChanged += RefreshFontWarningButton; + TB_Nickname.TextChanged += UpdateIsNicknamed; TB_Nickname.MouseDown += UpdateNicknameClick; // // BTN_NicknameWarn diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs index f1fac39e2..81d5b9c1b 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.cs @@ -1319,12 +1319,13 @@ private void UpdateIsNicknamed(object sender, EventArgs e) if (!FieldsLoaded) return; + RefreshFontWarningButton(); Entity.Nickname = TB_Nickname.Text; if (CHK_NicknamedFlag.Checked) return; var species = (ushort)WinFormsUtil.GetIndex(CB_Species); - if (species < 1 || species > Entity.MaxSpeciesID) + if (species is 0 || species > Entity.MaxSpeciesID) return; if (CHK_IsEgg.Checked)