mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add per-window opt-out for fades
This commit is contained in:
parent
9afece8679
commit
271c258e40
1 changed files with 13 additions and 6 deletions
|
|
@ -143,6 +143,12 @@ public abstract class Window
|
|||
/// </summary>
|
||||
public uint OnCloseSfxId { get; set; } = 24u;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this window should not fade in and out, regardless of the users'
|
||||
/// preference.
|
||||
/// </summary>
|
||||
public bool DisableFadeInFadeOut { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of this window.
|
||||
/// </summary>
|
||||
|
|
@ -331,7 +337,7 @@ public abstract class Window
|
|||
internal void DrawInternal(WindowDrawFlags internalDrawFlags, WindowSystemPersistence? persistence)
|
||||
{
|
||||
this.PreOpenCheck();
|
||||
var isReducedMotion = internalDrawFlags.HasFlag(WindowDrawFlags.IsReducedMotion);
|
||||
var doFades = !internalDrawFlags.HasFlag(WindowDrawFlags.IsReducedMotion) && !this.DisableFadeInFadeOut;
|
||||
|
||||
if (!this.IsOpen)
|
||||
{
|
||||
|
|
@ -360,7 +366,7 @@ public abstract class Window
|
|||
}
|
||||
}
|
||||
|
||||
this.fadeInTimer = !isReducedMotion ? 0f : FadeInOutTime;
|
||||
this.fadeInTimer = doFades ? 0f : FadeInOutTime;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -592,7 +598,7 @@ public abstract class Window
|
|||
this.pushedFadeInAlpha = false;
|
||||
}
|
||||
|
||||
if (!this.internalIsOpen && this.fadeOutTexture == null && !isReducedMotion)
|
||||
if (!this.internalIsOpen && this.fadeOutTexture == null && doFades)
|
||||
{
|
||||
this.fadeOutTexture = Service<TextureManager>.Get().CreateDrawListTexture(
|
||||
"WindowFadeOutTexture");
|
||||
|
|
@ -818,9 +824,10 @@ public abstract class Window
|
|||
style.Push(ImGuiStyleVar.WindowBorderSize, 0);
|
||||
style.Push(ImGuiStyleVar.FrameBorderSize, 0);
|
||||
|
||||
var fakeFlags = ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoNav | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoMouseInputs |
|
||||
ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoBackground;
|
||||
if (ImGui.Begin(this.WindowName, fakeFlags))
|
||||
const ImGuiWindowFlags flags = ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoNav | ImGuiWindowFlags.NoCollapse |
|
||||
ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoMouseInputs |
|
||||
ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoBackground;
|
||||
if (ImGui.Begin(this.WindowName, flags))
|
||||
{
|
||||
var dl = ImGui.GetWindowDrawList();
|
||||
dl.AddImage(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue