mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 12:44:16 +01:00
Revert "Respect fadein/out for Window.DrawConditions() and Window.IsOpen"
This reverts commit c33a5346b1.
This commit is contained in:
parent
c33a5346b1
commit
421d8cee3b
1 changed files with 23 additions and 71 deletions
|
|
@ -41,10 +41,6 @@ public abstract class Window
|
||||||
|
|
||||||
private bool internalLastIsOpen = false;
|
private bool internalLastIsOpen = false;
|
||||||
private bool internalIsOpen = false;
|
private bool internalIsOpen = false;
|
||||||
private bool internalWantsToClose = false;
|
|
||||||
private bool internalLastDrawConditions = true;
|
|
||||||
private bool internalDrawConditions = true;
|
|
||||||
|
|
||||||
private bool internalIsPinned = false;
|
private bool internalIsPinned = false;
|
||||||
private bool internalIsClickthrough = false;
|
private bool internalIsClickthrough = false;
|
||||||
private bool didPushInternalAlpha = false;
|
private bool didPushInternalAlpha = false;
|
||||||
|
|
@ -233,18 +229,7 @@ public abstract class Window
|
||||||
public bool IsOpen
|
public bool IsOpen
|
||||||
{
|
{
|
||||||
get => this.internalIsOpen;
|
get => this.internalIsOpen;
|
||||||
set
|
set => this.internalIsOpen = value;
|
||||||
{
|
|
||||||
if (!value && this.internalIsOpen)
|
|
||||||
{
|
|
||||||
this.internalWantsToClose = true;
|
|
||||||
}
|
|
||||||
else if (value && !this.internalIsOpen)
|
|
||||||
{
|
|
||||||
this.internalWantsToClose = false;
|
|
||||||
this.internalIsOpen = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool CanShowCloseButton => this.ShowCloseButton && !this.internalIsClickthrough;
|
private bool CanShowCloseButton => this.ShowCloseButton && !this.internalIsClickthrough;
|
||||||
|
|
@ -375,7 +360,22 @@ public abstract class Window
|
||||||
UIGlobals.PlaySoundEffect(this.OnCloseSfxId);
|
UIGlobals.PlaySoundEffect(this.OnCloseSfxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawFadeOut();
|
if (this.fadeOutTexture != null)
|
||||||
|
{
|
||||||
|
this.fadeOutTimer -= ImGui.GetIO().DeltaTime;
|
||||||
|
if (this.fadeOutTimer <= 0f)
|
||||||
|
{
|
||||||
|
this.fadeOutTexture.Dispose();
|
||||||
|
this.fadeOutTexture = null;
|
||||||
|
this.OnSafeToRemove();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.DrawFakeFadeOutWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fadeInTimer = doFades ? 0f : FadeInOutTime;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -384,15 +384,8 @@ public abstract class Window
|
||||||
this.fadeInTimer = FadeInOutTime;
|
this.fadeInTimer = FadeInOutTime;
|
||||||
|
|
||||||
this.Update();
|
this.Update();
|
||||||
this.internalDrawConditions = this.DrawConditions();
|
if (!this.DrawConditions())
|
||||||
if (this.internalDrawConditions == this.internalLastDrawConditions && !this.internalDrawConditions)
|
|
||||||
{
|
|
||||||
DrawFadeOut();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (this.internalDrawConditions)
|
|
||||||
this.internalLastDrawConditions = this.internalDrawConditions;
|
|
||||||
|
|
||||||
var hasNamespace = !string.IsNullOrEmpty(this.Namespace);
|
var hasNamespace = !string.IsNullOrEmpty(this.Namespace);
|
||||||
|
|
||||||
|
|
@ -614,21 +607,12 @@ public abstract class Window
|
||||||
this.pushedFadeInAlpha = false;
|
this.pushedFadeInAlpha = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.internalDrawConditions != this.internalLastDrawConditions && !this.internalDrawConditions)
|
if (!this.internalIsOpen && this.fadeOutTexture == null && doFades)
|
||||||
{
|
{
|
||||||
this.internalLastDrawConditions = this.internalDrawConditions;
|
this.fadeOutTexture = Service<TextureManager>.Get().CreateDrawListTexture(
|
||||||
SetupFadeOut();
|
"WindowFadeOutTexture");
|
||||||
}
|
this.fadeOutTexture.ResizeAndDrawWindow(this.WindowName, Vector2.One);
|
||||||
|
this.fadeOutTimer = FadeInOutTime;
|
||||||
if (this.internalWantsToClose)
|
|
||||||
{
|
|
||||||
this.internalIsOpen = false;
|
|
||||||
this.internalWantsToClose = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.internalIsOpen)
|
|
||||||
{
|
|
||||||
SetupFadeOut();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printWindow)
|
if (printWindow)
|
||||||
|
|
@ -648,38 +632,6 @@ public abstract class Window
|
||||||
|
|
||||||
if (hasNamespace)
|
if (hasNamespace)
|
||||||
ImGui.PopID();
|
ImGui.PopID();
|
||||||
return;
|
|
||||||
|
|
||||||
void SetupFadeOut()
|
|
||||||
{
|
|
||||||
if (this.fadeOutTexture == null && doFades)
|
|
||||||
{
|
|
||||||
this.fadeOutTexture = Service<TextureManager>.Get().CreateDrawListTexture(
|
|
||||||
"WindowFadeOutTexture");
|
|
||||||
this.fadeOutTexture.ResizeAndDrawWindow(this.WindowName, Vector2.One);
|
|
||||||
this.fadeOutTimer = FadeInOutTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DrawFadeOut()
|
|
||||||
{
|
|
||||||
if (this.fadeOutTexture != null)
|
|
||||||
{
|
|
||||||
this.fadeOutTimer -= ImGui.GetIO().DeltaTime;
|
|
||||||
if (this.fadeOutTimer <= 0f)
|
|
||||||
{
|
|
||||||
this.fadeOutTexture.Dispose();
|
|
||||||
this.fadeOutTexture = null;
|
|
||||||
this.OnSafeToRemove();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.DrawFakeFadeOutWindow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fadeInTimer = doFades ? 0f : FadeInOutTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private unsafe void ApplyConditionals()
|
private unsafe void ApplyConditionals()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue