Use local variable to track pushed style state

This commit is contained in:
MidoriKami 2025-12-01 14:19:12 -08:00
parent 2e24696731
commit 14e97a1a37

View file

@ -57,7 +57,6 @@ public abstract class Window
private bool hasError = false; private bool hasError = false;
private Exception? lastError; private Exception? lastError;
private bool isErrorStylePushed;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="Window"/> class. /// Initializes a new instance of the <see cref="Window"/> class.
@ -426,6 +425,7 @@ public abstract class Window
UIGlobals.PlaySoundEffect(this.OnOpenSfxId); UIGlobals.PlaySoundEffect(this.OnOpenSfxId);
} }
var isErrorStylePushed = false;
if (!this.hasError) if (!this.hasError)
{ {
this.PreDraw(); this.PreDraw();
@ -434,7 +434,7 @@ public abstract class Window
else else
{ {
Style.StyleModelV1.DalamudStandard.Push(); Style.StyleModelV1.DalamudStandard.Push();
this.isErrorStylePushed = true; isErrorStylePushed = true;
} }
if (this.ForceMainWindow) if (this.ForceMainWindow)
@ -697,7 +697,7 @@ public abstract class Window
} }
else else
{ {
if (this.isErrorStylePushed) if (isErrorStylePushed)
{ {
Style.StyleModelV1.DalamudStandard.Pop(); Style.StyleModelV1.DalamudStandard.Pop();
} }