Aggressively hide formarg label on format change

This commit is contained in:
Kurt
2022-12-17 13:04:37 -08:00
parent 62204a81fc
commit ae2d13432b
2 changed files with 6 additions and 2 deletions

View File

@@ -198,8 +198,7 @@ private void LoadMisc2(PKM pk)
CHK_IsEgg.Checked = pk.IsEgg;
CB_HeldItem.SelectedValue = pk.HeldItem;
LoadClamp(CB_Form, pk.Form);
if (pk is IFormArgument f)
L_FormArgument.Visible = FA_Form.LoadArgument(f, pk.Species, pk.Form, pk.Format);
L_FormArgument.Visible = pk is IFormArgument f && FA_Form.LoadArgument(f, pk.Species, pk.Form, pk.Format);
ReloadToFriendshipTextBox(pk);

View File

@@ -983,7 +983,10 @@ private void UpdateForm(object sender, EventArgs e)
private void RefreshFormArguments()
{
if (Entity is not IFormArgument f)
{
L_FormArgument.Visible = false;
return;
}
if (FieldsLoaded)
FA_Form.SaveArgument(f);
@@ -1841,6 +1844,8 @@ private void ToggleInterface(PKM t)
L_AlphaMastered.Visible = CB_AlphaMastered.Visible = t is PA8;
FLP_ObedienceLevel.Visible = t is IObedienceLevel;
Contest.ToggleInterface(Entity, Entity.Context);
if (t is not IFormArgument)
L_FormArgument.Visible = false;
ToggleInterface(Entity.Format);
}