Enable viewport alpha

This commit is contained in:
Soreepeong 2025-08-11 00:44:02 +09:00
parent f613b177a2
commit 40e63f2d9a
2 changed files with 10 additions and 13 deletions

View file

@ -449,11 +449,8 @@ public abstract class Window
} }
// Not supported yet on non-main viewports // Not supported yet on non-main viewports
if ((this.internalIsPinned || this.internalIsClickthrough || this.internalAlpha.HasValue) && if (this.internalIsClickthrough && ImGui.GetWindowViewport().ID != ImGui.GetMainViewport().ID)
ImGui.GetWindowViewport().ID != ImGui.GetMainViewport().ID)
{ {
this.internalAlpha = null;
this.internalIsPinned = false;
this.internalIsClickthrough = false; this.internalIsClickthrough = false;
this.presetDirty = true; this.presetDirty = true;
} }
@ -482,11 +479,6 @@ public abstract class Window
if (ImGui.BeginPopup(additionsPopupName, ImGuiWindowFlags.NoMove)) if (ImGui.BeginPopup(additionsPopupName, ImGuiWindowFlags.NoMove))
{ {
var isAvailable = ImGuiHelpers.CheckIsWindowOnMainViewport();
if (!isAvailable)
ImGui.BeginDisabled();
if (this.internalIsClickthrough) if (this.internalIsClickthrough)
ImGui.BeginDisabled(); ImGui.BeginDisabled();
@ -506,6 +498,11 @@ public abstract class Window
if (this.internalIsClickthrough) if (this.internalIsClickthrough)
ImGui.EndDisabled(); ImGui.EndDisabled();
var isAvailable = ImGuiHelpers.CheckIsWindowOnMainViewport();
if (!isAvailable)
ImGui.BeginDisabled();
if (this.AllowClickthrough) if (this.AllowClickthrough)
{ {
if (ImGui.Checkbox( if (ImGui.Checkbox(
@ -519,6 +516,9 @@ public abstract class Window
Loc.Localize("WindowSystemContextActionClickthroughHint", "Clickthrough windows will not receive mouse input, move or resize. They are completely inert.")); Loc.Localize("WindowSystemContextActionClickthroughHint", "Clickthrough windows will not receive mouse input, move or resize. They are completely inert."));
} }
if (!isAvailable)
ImGui.EndDisabled();
var alpha = (this.internalAlpha ?? ImGui.GetStyle().Alpha) * 100f; var alpha = (this.internalAlpha ?? ImGui.GetStyle().Alpha) * 100f;
if (ImGui.SliderFloat(Loc.Localize("WindowSystemContextActionAlpha", "Opacity"), ref alpha, 20f, if (ImGui.SliderFloat(Loc.Localize("WindowSystemContextActionAlpha", "Opacity"), ref alpha, 20f,
100f)) 100f))
@ -547,9 +547,6 @@ public abstract class Window
"These features are only available if this window is inside the game window.")); "These features are only available if this window is inside the game window."));
} }
if (!isAvailable)
ImGui.EndDisabled();
if (ImGui.Button(Loc.Localize("WindowSystemContextActionPrintWindow", "Print window"))) if (ImGui.Button(Loc.Localize("WindowSystemContextActionPrintWindow", "Print window")))
printWindow = true; printWindow = true;

@ -1 +1 @@
Subproject commit 27c8565f631b004c3266373890e41ecc627f775b Subproject commit 68cce5e2185948612eb80d981d4001b9737c32cf