mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
installer: also fade overlay
This commit is contained in:
parent
ec122c85d5
commit
fa111c3a70
1 changed files with 9 additions and 1 deletions
|
|
@ -1811,6 +1811,8 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
var iconSize = ImGuiHelpers.ScaledVector2(64, 64);
|
var iconSize = ImGuiHelpers.ScaledVector2(64, 64);
|
||||||
var cursorBeforeImage = ImGui.GetCursorPos();
|
var cursorBeforeImage = ImGui.GetCursorPos();
|
||||||
var rectOffset = ImGui.GetWindowContentRegionMin() + ImGui.GetWindowPos();
|
var rectOffset = ImGui.GetWindowContentRegionMin() + ImGui.GetWindowPos();
|
||||||
|
|
||||||
|
var overlayAlpha = 1.0f;
|
||||||
if (ImGui.IsRectVisible(rectOffset + cursorBeforeImage, rectOffset + cursorBeforeImage + iconSize))
|
if (ImGui.IsRectVisible(rectOffset + cursorBeforeImage, rectOffset + cursorBeforeImage + iconSize))
|
||||||
{
|
{
|
||||||
var iconTex = this.imageCache.DefaultIcon;
|
var iconTex = this.imageCache.DefaultIcon;
|
||||||
|
|
@ -1829,7 +1831,10 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
var secondsSinceLoad = (float)DateTime.Now.Subtract(loadedSince.Value).TotalSeconds;
|
var secondsSinceLoad = (float)DateTime.Now.Subtract(loadedSince.Value).TotalSeconds;
|
||||||
var fadeTo = pluginDisabled || installableOutdated ? 0.4f : 1f;
|
var fadeTo = pluginDisabled || installableOutdated ? 0.4f : 1f;
|
||||||
iconAlpha = Math.Clamp(EaseOutCubic(Math.Min(secondsSinceLoad, fadeTime) / fadeTime) * fadeTo, 0, 1);
|
|
||||||
|
float Interp(float to) => Math.Clamp(EaseOutCubic(Math.Min(secondsSinceLoad, fadeTime) / fadeTime) * to, 0, 1);
|
||||||
|
iconAlpha = Interp(fadeTo);
|
||||||
|
overlayAlpha = Interp(1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.PushStyleVar(ImGuiStyleVar.Alpha, iconAlpha);
|
ImGui.PushStyleVar(ImGuiStyleVar.Alpha, iconAlpha);
|
||||||
|
|
@ -1842,6 +1847,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
var isLoaded = plugin is { IsLoaded: true };
|
var isLoaded = plugin is { IsLoaded: true };
|
||||||
|
|
||||||
|
ImGui.PushStyleVar(ImGuiStyleVar.Alpha, overlayAlpha);
|
||||||
if (updateAvailable)
|
if (updateAvailable)
|
||||||
ImGui.Image(this.imageCache.UpdateIcon.ImGuiHandle, iconSize);
|
ImGui.Image(this.imageCache.UpdateIcon.ImGuiHandle, iconSize);
|
||||||
else if ((trouble && !pluginDisabled) || isOrphan)
|
else if ((trouble && !pluginDisabled) || isOrphan)
|
||||||
|
|
@ -1860,6 +1866,8 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
ImGui.Image(this.imageCache.InstalledIcon.ImGuiHandle, iconSize);
|
ImGui.Image(this.imageCache.InstalledIcon.ImGuiHandle, iconSize);
|
||||||
else
|
else
|
||||||
ImGui.Dummy(iconSize);
|
ImGui.Dummy(iconSize);
|
||||||
|
ImGui.PopStyleVar();
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|
||||||
ImGuiHelpers.ScaledDummy(5);
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue