Update sprite on gmax field change

This commit is contained in:
Kurt
2020-10-25 13:47:42 -07:00
parent 2bb399c8e7
commit 9e380fdcde
3 changed files with 8 additions and 1 deletions

View File

@@ -371,7 +371,7 @@ private static string ReloadGender(string text, IReadOnlyList<string> genders)
private static void ReloadGender(Label l, IReadOnlyList<string> genders) => l.Text = ReloadGender(l.Text, genders);
private void UpdateSprite()
internal void UpdateSprite()
{
if (FieldsLoaded && !forceValidation)
UpdatePreviewSprite?.Invoke(this, EventArgs.Empty);

View File

@@ -1198,6 +1198,7 @@ private void InitializeComponent()
this.CHK_Gigantamax.TabIndex = 44;
this.CHK_Gigantamax.Text = "Gigantamax";
this.CHK_Gigantamax.UseVisualStyleBackColor = true;
this.CHK_Gigantamax.CheckedChanged += new System.EventHandler(this.CHK_Gigantamax_CheckedChanged);
//
// StatEditor
//

View File

@@ -534,5 +534,11 @@ public void InitializeDataSources()
CB_HPType.DataSource = Util.GetCBList(GameInfo.Strings.types.Skip(1).Take(16).ToArray());
ChangingFields = false;
}
private void CHK_Gigantamax_CheckedChanged(object sender, EventArgs e)
{
if (!ChangingFields)
((PKMEditor) MainEditor).UpdateSprite();
}
}
}