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>
|
/// </summary>
|
||||||
public uint OnCloseSfxId { get; set; } = 24u;
|
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>
|
/// <summary>
|
||||||
/// Gets or sets the position of this window.
|
/// Gets or sets the position of this window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -331,7 +337,7 @@ public abstract class Window
|
||||||
internal void DrawInternal(WindowDrawFlags internalDrawFlags, WindowSystemPersistence? persistence)
|
internal void DrawInternal(WindowDrawFlags internalDrawFlags, WindowSystemPersistence? persistence)
|
||||||
{
|
{
|
||||||
this.PreOpenCheck();
|
this.PreOpenCheck();
|
||||||
var isReducedMotion = internalDrawFlags.HasFlag(WindowDrawFlags.IsReducedMotion);
|
var doFades = !internalDrawFlags.HasFlag(WindowDrawFlags.IsReducedMotion) && !this.DisableFadeInFadeOut;
|
||||||
|
|
||||||
if (!this.IsOpen)
|
if (!this.IsOpen)
|
||||||
{
|
{
|
||||||
|
|
@ -360,7 +366,7 @@ public abstract class Window
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fadeInTimer = !isReducedMotion ? 0f : FadeInOutTime;
|
this.fadeInTimer = doFades ? 0f : FadeInOutTime;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -592,7 +598,7 @@ public abstract class Window
|
||||||
this.pushedFadeInAlpha = false;
|
this.pushedFadeInAlpha = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.internalIsOpen && this.fadeOutTexture == null && !isReducedMotion)
|
if (!this.internalIsOpen && this.fadeOutTexture == null && doFades)
|
||||||
{
|
{
|
||||||
this.fadeOutTexture = Service<TextureManager>.Get().CreateDrawListTexture(
|
this.fadeOutTexture = Service<TextureManager>.Get().CreateDrawListTexture(
|
||||||
"WindowFadeOutTexture");
|
"WindowFadeOutTexture");
|
||||||
|
|
@ -818,9 +824,10 @@ public abstract class Window
|
||||||
style.Push(ImGuiStyleVar.WindowBorderSize, 0);
|
style.Push(ImGuiStyleVar.WindowBorderSize, 0);
|
||||||
style.Push(ImGuiStyleVar.FrameBorderSize, 0);
|
style.Push(ImGuiStyleVar.FrameBorderSize, 0);
|
||||||
|
|
||||||
var fakeFlags = ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoNav | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoMouseInputs |
|
const ImGuiWindowFlags flags = ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoNav | ImGuiWindowFlags.NoCollapse |
|
||||||
ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoBackground;
|
ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoMouseInputs |
|
||||||
if (ImGui.Begin(this.WindowName, fakeFlags))
|
ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoBackground;
|
||||||
|
if (ImGui.Begin(this.WindowName, flags))
|
||||||
{
|
{
|
||||||
var dl = ImGui.GetWindowDrawList();
|
var dl = ImGui.GetWindowDrawList();
|
||||||
dl.AddImage(
|
dl.AddImage(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue