From 7fdbc81c22fbede8e6311aaf976ec78f7c0d8432 Mon Sep 17 00:00:00 2001 From: JonKazama-Hellion Date: Fri, 1 May 2026 21:22:55 +0200 Subject: [PATCH] Add window opacity slider to the Hellion theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit True per-window focus-aware transparency would require touching ChatLogWindow and SettingsWindow individually (both upstream code, both prone to cherry-pick churn). Instead expose a single opacity slider that mixes a configured alpha into the WindowBg color in PushGlobal — applies to every Hellion-rendered pane uniformly, the game shines through, and form fields / dialogs / popups stay opaque on top so input remains readable. Default 92%, range clamped to 0.5–1.0 in the UI and 0x55–0xFF in the alpha conversion so users can't accidentally make the panes disappear entirely. Slider sits inside the Appearance section right under the master Hellion-theme checkbox and is greyed out when the theme is disabled. --- ChatTwo/Configuration.cs | 5 +++++ ChatTwo/Plugin.cs | 4 +++- ChatTwo/Resources/HellionStrings.Designer.cs | 2 ++ ChatTwo/Resources/HellionStrings.de.resx | 6 ++++++ ChatTwo/Resources/HellionStrings.resx | 6 ++++++ ChatTwo/Ui/HellionStyle.cs | 12 ++++++++++-- ChatTwo/Ui/SettingsTabs/Privacy.cs | 9 +++++++++ 7 files changed, 41 insertions(+), 3 deletions(-) diff --git a/ChatTwo/Configuration.cs b/ChatTwo/Configuration.cs index 5cbf40e..aabfaeb 100755 --- a/ChatTwo/Configuration.cs +++ b/ChatTwo/Configuration.cs @@ -71,6 +71,10 @@ public class Configuration : IPluginConfiguration // can flip this off in the Privacy tab. public bool HellionThemeEnabled = true; + // Window background opacity, 0.5–1.0. Lower values make the plugin + // panes more glass-like so the game shines through. Default ~92%. + public float HellionThemeWindowOpacity = 0.92f; + public int GetRetentionDays(ChatType type) { if (RetentionPerChannelDays.TryGetValue(type, out var userOverride)) @@ -250,6 +254,7 @@ public class Configuration : IPluginConfiguration FirstRunCompleted = other.FirstRunCompleted; HellionThemeEnabled = other.HellionThemeEnabled; + HellionThemeWindowOpacity = other.HellionThemeWindowOpacity; } } diff --git a/ChatTwo/Plugin.cs b/ChatTwo/Plugin.cs index 702f281..040d2b8 100755 --- a/ChatTwo/Plugin.cs +++ b/ChatTwo/Plugin.cs @@ -389,7 +389,9 @@ public sealed class Plugin : IDalamudPlugin // (chat log, settings, viewers, wizard, file dialog) renders with // the same palette. Skipping the push leaves the upstream Dalamud // look untouched for users who flipped the toggle off. - using IDisposable? _style = Config.HellionThemeEnabled ? HellionStyle.PushGlobal() : null; + using IDisposable? _style = Config.HellionThemeEnabled + ? HellionStyle.PushGlobal(Config.HellionThemeWindowOpacity) + : null; ChatLogWindow.BeginFrame(); diff --git a/ChatTwo/Resources/HellionStrings.Designer.cs b/ChatTwo/Resources/HellionStrings.Designer.cs index 13fcd83..b073de7 100644 --- a/ChatTwo/Resources/HellionStrings.Designer.cs +++ b/ChatTwo/Resources/HellionStrings.Designer.cs @@ -134,4 +134,6 @@ internal class HellionStrings internal static string Theme_Heading => Get(nameof(Theme_Heading)); internal static string Theme_Enabled_Name => Get(nameof(Theme_Enabled_Name)); internal static string Theme_Enabled_Description => Get(nameof(Theme_Enabled_Description)); + internal static string Theme_WindowOpacity_Label => Get(nameof(Theme_WindowOpacity_Label)); + internal static string Theme_WindowOpacity_Help => Get(nameof(Theme_WindowOpacity_Help)); } diff --git a/ChatTwo/Resources/HellionStrings.de.resx b/ChatTwo/Resources/HellionStrings.de.resx index ffec8b9..735846d 100644 --- a/ChatTwo/Resources/HellionStrings.de.resx +++ b/ChatTwo/Resources/HellionStrings.de.resx @@ -273,4 +273,10 @@ Industrielle HUD-Palette mit cyan-blauen Aktionsfarben, schiefer-violetten Tabs und Bernstein-Akzenten für aktive Zustände, global angewendet auf Chat-Fenster, Einstellungen, Viewer und Wizard. Deaktivieren, um das Standard-Dalamud-Erscheinungsbild zu nutzen. + + Fenster-Deckkraft + + + Wie deckend die Plugin-Fenster sind. Niedrigere Werte lassen das Spiel durchscheinen, Form-Felder und Dialoge bleiben oben drauf deckend und gut lesbar. + diff --git a/ChatTwo/Resources/HellionStrings.resx b/ChatTwo/Resources/HellionStrings.resx index 8fced43..1e2547a 100644 --- a/ChatTwo/Resources/HellionStrings.resx +++ b/ChatTwo/Resources/HellionStrings.resx @@ -273,4 +273,10 @@ Industrial HUD palette with cyan-teal action accents, slate-violet tabs and amber active highlights, applied globally to chat log, settings, viewers and the wizard. Disable to fall back to the default Dalamud look. + + Window opacity + + + How opaque the plugin panes are. Lower values let the game shine through; form fields and dialogs stay opaque on top so they remain readable. + diff --git a/ChatTwo/Ui/HellionStyle.cs b/ChatTwo/Ui/HellionStyle.cs index b71025c..669e34b 100644 --- a/ChatTwo/Ui/HellionStyle.cs +++ b/ChatTwo/Ui/HellionStyle.cs @@ -109,10 +109,18 @@ internal static class HellionStyle /// Plugin.Draw. Covers every ImGui surface the plugin renders so the /// Hellion look is consistent across upstream and Hellion tabs. /// - internal static IDisposable PushGlobal() + /// Window background alpha (0.5–1.0). Lower + /// values let the game shine through the plugin panes. + internal static IDisposable PushGlobal(float windowOpacity = 1.0f) { var stack = new StackHandle(); + // Mix the configured opacity into the window background color. + // Other surface layers (ChildBg, FrameBg, popups) stay opaque so + // form fields and dialogs remain easy to read on top. + var alphaByte = (uint)Math.Clamp((int)(windowOpacity * 255f), 0x55, 0xFF); + var windowBgWithAlpha = (WindowBgRgba & 0xFFFFFF00u) | alphaByte; + // Layout — geometric edges, modest rounding, single-pixel borders. stack.PushStyleVar(ImGuiStyleVar.WindowRounding, 4f); stack.PushStyleVar(ImGuiStyleVar.ChildRounding, 3f); @@ -125,7 +133,7 @@ internal static class HellionStyle stack.PushStyleVar(ImGuiStyleVar.FrameBorderSize, 1f); // Surfaces. - stack.PushColor(ImGuiCol.WindowBg, WindowBgRgba); + stack.PushColor(ImGuiCol.WindowBg, windowBgWithAlpha); stack.PushColor(ImGuiCol.ChildBg, ChildBgRgba); stack.PushColor(ImGuiCol.PopupBg, PopupBgRgba); stack.PushColor(ImGuiCol.Border, BorderRgba); diff --git a/ChatTwo/Ui/SettingsTabs/Privacy.cs b/ChatTwo/Ui/SettingsTabs/Privacy.cs index 17242ae..8f5058a 100644 --- a/ChatTwo/Ui/SettingsTabs/Privacy.cs +++ b/ChatTwo/Ui/SettingsTabs/Privacy.cs @@ -77,6 +77,15 @@ internal sealed class Privacy : ISettingsTab ref Mutable.HellionThemeEnabled, HellionStrings.Theme_Enabled_Name, HellionStrings.Theme_Enabled_Description); + + using (ImRaii.Disabled(!Mutable.HellionThemeEnabled)) + { + ImGui.Spacing(); + var opacity = Mutable.HellionThemeWindowOpacity; + if (ImGui.SliderFloat($"{HellionStrings.Theme_WindowOpacity_Label}##theme-opacity", ref opacity, 0.5f, 1.0f, "%.2f")) + Mutable.HellionThemeWindowOpacity = Math.Clamp(opacity, 0.5f, 1.0f); + ImGuiUtil.HelpText(HellionStrings.Theme_WindowOpacity_Help); + } } ImGui.Spacing();