From 2822f730f5dab0c3c09298d2098e5c33a157a10e Mon Sep 17 00:00:00 2001 From: Knack117 Date: Sat, 28 Feb 2026 18:16:44 -0500 Subject: [PATCH] v1.0.8.20: Fixed hotbar cooldowns showing through dialogue box when Show HUD during dialogue enabled Made-with: Cursor --- HSUI.csproj | 6 +-- HSUI.json | 2 +- Helpers/ClipRectsHelper.cs | 51 ++++++++++++++++++++++ Interface/GeneralElements/ActionBarsHud.cs | 21 +++++---- Interface/GeneralElements/CrossBarHud.cs | 21 +++++---- changelog.md | 3 ++ pluginmaster.json | 2 +- 7 files changed, 85 insertions(+), 21 deletions(-) diff --git a/HSUI.csproj b/HSUI.csproj index 78e2f54..4efd1d1 100644 --- a/HSUI.csproj +++ b/HSUI.csproj @@ -9,9 +9,9 @@ HSUI - 1.0.8.19 - 1.0.8.19 - 1.0.8.19 + 1.0.8.20 + 1.0.8.20 + 1.0.8.20 diff --git a/HSUI.json b/HSUI.json index 921dc72..8249bbe 100644 --- a/HSUI.json +++ b/HSUI.json @@ -2,7 +2,7 @@ "Author": "Knack117", "Name": "HSUI", "InternalName": "HSUI", - "AssemblyVersion": "1.0.8.19", + "AssemblyVersion": "1.0.8.20", "Description": "HSUI provides a highly configurable HUD replacement for FFXIV, recreated from DelvUI using KamiToolKit, FFXIVClientStructs, and Dalamud. Features unit frames, castbars, job gauges, nameplates, party frames, status effects, enemy list, configurable hotbars with drag-and-drop, and profiles.", "ApplicableVersion": "any", "RepoUrl": "https://github.com/Knack117/HSUI", diff --git a/Helpers/ClipRectsHelper.cs b/Helpers/ClipRectsHelper.cs index 1a012ba..b323d2a 100644 --- a/Helpers/ClipRectsHelper.cs +++ b/Helpers/ClipRectsHelper.cs @@ -1,3 +1,4 @@ +using Dalamud.Game.ClientState.Conditions; using HSUI.Config; using HSUI.Interface.GeneralElements; using FFXIVClientStructs.FFXIV.Client.UI; @@ -335,6 +336,56 @@ namespace HSUI.Helpers return null; } + /// + /// Returns true when the given area overlaps a game addon (e.g. dialogue box) and should not be drawn on top of it. + /// Used by hotbars when "Show HUD during dialogue" is on, to avoid cooldown overlays bleeding through dialogue. + /// Uses full clip rects when Window Clipping is enabled, otherwise a minimal dialogue-addon check. + /// + public bool SlotOverlapsGameAddon(Vector2 pos, Vector2 size) + { + // When Window Clipping is enabled, use full clip rects (all game addons) + ClipRect? clipRect = GetClipRectForArea(pos, size); + if (clipRect.HasValue) { return true; } + + // When "Show HUD during dialogue" is on and we're in dialogue, check dialogue addons + // (works even when full Window Clipping is disabled) + var hudOptions = ConfigurationManager.Instance?.GetConfigObject(); + if (hudOptions?.ShowHudDuringDialogue != true) { return false; } + if (!Plugin.Condition[ConditionFlag.OccupiedInQuestEvent] && !Plugin.Condition[ConditionFlag.OccupiedInEvent]) + { return false; } + + return GetClipRectForDialogueAddon(pos, size).HasValue; + } + + private static readonly string[] _dialogueAddonNames = { "Talk", "SelectString", "SelectIconString", "Journal" }; + + private unsafe ClipRect? GetClipRectForDialogueAddon(Vector2 pos, Vector2 size) + { + ClipRect area = new ClipRect(pos, pos + size); + + foreach (string addonName in _dialogueAddonNames) + { + try + { + var addon = (AtkUnitBase*)Plugin.GameGui.GetAddonByName(addonName, 1).Address; + if (addon == null || addon->RootNode == null || !addon->IsVisible) { continue; } + + float margin = 5 * addon->Scale; + Vector2 addonPos = new Vector2(addon->X + addon->RootNode->X * addon->Scale + margin, + addon->Y + addon->RootNode->Y * addon->Scale + margin); + Vector2 addonSize = new Vector2( + addon->RootNode->Width * addon->Scale - margin * 2, + addon->RootNode->Height * addon->Scale - margin * 2); + ClipRect addonRect = new ClipRect(addonPos, addonPos + addonSize); + + if (addonRect.IntersectsWith(area)) { return addonRect; } + } + catch { } + } + + return null; + } + public static ClipRect[] GetInvertedClipRects(ClipRect clipRect) { float maxX = ImGui.GetMainViewport().Size.X; diff --git a/Interface/GeneralElements/ActionBarsHud.cs b/Interface/GeneralElements/ActionBarsHud.cs index e5983dd..bab5519 100644 --- a/Interface/GeneralElements/ActionBarsHud.cs +++ b/Interface/GeneralElements/ActionBarsHud.cs @@ -177,15 +177,20 @@ namespace HSUI.Interface.GeneralElements if (showCd && slot.CooldownPercent > 0 && _pendingSlotIconIndex != i) { - float total = 100f; - float elapsed = total - slot.CooldownPercent; - DrawHelper.DrawIconCooldown(pos, size, elapsed, total, drawList); - if (showCdNumbers && slot.CooldownSecondsLeft > 0) + // Skip cooldown overlay when slot overlaps game UI (e.g. dialogue box) + // to avoid hotbar cooldowns showing through during "Show HUD during dialogue" + if (!ClipRectsHelper.Instance.SlotOverlapsGameAddon(pos, size)) { - string cdText = slot.CooldownSecondsLeft.ToString(); - Vector2 textSize = ImGui.CalcTextSize(cdText); - Vector2 textPos = pos + (size - textSize) * 0.5f; - DrawHelper.DrawOutlinedText(cdText, textPos, 0xFFFFFFFF, 0xFF000000, drawList, 1); + float total = 100f; + float elapsed = total - slot.CooldownPercent; + DrawHelper.DrawIconCooldown(pos, size, elapsed, total, drawList); + if (showCdNumbers && slot.CooldownSecondsLeft > 0) + { + string cdText = slot.CooldownSecondsLeft.ToString(); + Vector2 textSize = ImGui.CalcTextSize(cdText); + Vector2 textPos = pos + (size - textSize) * 0.5f; + DrawHelper.DrawOutlinedText(cdText, textPos, 0xFFFFFFFF, 0xFF000000, drawList, 1); + } } } diff --git a/Interface/GeneralElements/CrossBarHud.cs b/Interface/GeneralElements/CrossBarHud.cs index f27b327..37a50f0 100644 --- a/Interface/GeneralElements/CrossBarHud.cs +++ b/Interface/GeneralElements/CrossBarHud.cs @@ -317,15 +317,20 @@ namespace HSUI.Interface.GeneralElements if (showCd && slot.CooldownPercent > 0 && _pendingSlotIconIndex != i) { - float total = 100f; - float elapsed = total - slot.CooldownPercent; - DrawHelper.DrawIconCooldown(pos, size, elapsed, total, drawList); - if (showCdNumbers && slot.CooldownSecondsLeft > 0) + // Skip cooldown overlay when slot overlaps game UI (e.g. dialogue box) + // to avoid hotbar cooldowns showing through during "Show HUD during dialogue" + if (!ClipRectsHelper.Instance.SlotOverlapsGameAddon(pos, size)) { - string cdText = slot.CooldownSecondsLeft.ToString(); - Vector2 textSize = ImGui.CalcTextSize(cdText); - Vector2 textPos = pos + (size - textSize) * 0.5f; - DrawHelper.DrawOutlinedText(cdText, textPos, 0xFFFFFFFF, 0xFF000000, drawList, 1); + float total = 100f; + float elapsed = total - slot.CooldownPercent; + DrawHelper.DrawIconCooldown(pos, size, elapsed, total, drawList); + if (showCdNumbers && slot.CooldownSecondsLeft > 0) + { + string cdText = slot.CooldownSecondsLeft.ToString(); + Vector2 textSize = ImGui.CalcTextSize(cdText); + Vector2 textPos = pos + (size - textSize) * 0.5f; + DrawHelper.DrawOutlinedText(cdText, textPos, 0xFFFFFFFF, 0xFF000000, drawList, 1); + } } } diff --git a/changelog.md b/changelog.md index 2db066f..d31c145 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +# 1.0.8.20 +- **Hotbars**: Fixed cooldown overlays showing through game UI (e.g. dialogue box) when "Show HUD during dialogue and interaction" is enabled. Hotbar cooldown timers and numbers are now skipped for slots that overlap dialogue, select, or journal addons. + # 1.0.8.19 - **Hotbars**: Visibility settings moved from Visibility → Hotbars to each Hotbar 1–10 menu. The Visibility → Hotbars tab has been removed. diff --git a/pluginmaster.json b/pluginmaster.json index 8f199b9..5f63ff2 100644 --- a/pluginmaster.json +++ b/pluginmaster.json @@ -1 +1 @@ -[{"Author":"Knack117","Name":"HSUI","Punchline":"A modern HUD replacement built for customization.","Description":"HSUI provides a highly configurable HUD replacement for FFXIV, recreated from DelvUI using KamiToolKit, FFXIVClientStructs, and Dalamud. Features unit frames, castbars, job gauges, nameplates, party frames, status effects, enemy list, configurable hotbars with drag-and-drop, and profiles.","Changelog":"1.0.8.19: Hotbar visibility moved to per-hotbar menus; removed Visibility → Hotbars tab. 1.0.8.18: Visibility \"Hide unless hovered\" option. 1.0.8.17: Controller hotbars (cross layout, separate storage, sync with game). 1.0.8.16: Show HUD during dialogue and interaction. 1.0.8.15: Tooltips game-style formatting. 1.0.8.14: Mouse GCD Indicator. 1.0.8.13: Item tooltips now show. 1.0.8.12: Item/HQ icons now draw on hotbar. 1.0.8.11: Hotbar tooltip crash fix. 1.0.8.10: Hotbar crash fix when dragging inventory items. 1.0.8.9: Gearset persists on slot. 1.0.8.8: Gearset drag-drop fix. 1.0.8.7: Fixed Gearset icon clearing. 1.0.8.6: Crafting action tooltips full description. 1.0.8.4: Alliance Frames 1 and 2 fix; Hide in duty no longer hides alliance frames. 1.0.8.3: Fix left-click staying broken after disable. 1.0.8.2: Charge icons stay lit until all charges spent.","InternalName":"HSUI","AssemblyVersion":"1.0.8.19","RepoUrl":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI","ApplicableVersion":"any","Tags":["UI","HUD","Unit Frames","Nameplates","Party Frames","Hotbars"],"CategoryTags":["UI"],"DalamudApiLevel":14,"IconUrl":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/raw/branch/main/Media/Images/icon.png","ImageUrls":[],"DownloadLinkInstall":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.19/latest.zip","IsHide":false,"IsTestingExclusive":false,"DownloadLinkTesting":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.19/latest.zip","DownloadLinkUpdate":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.19/latest.zip","LastUpdate":"1772292053"}] +[{"Author":"Knack117","Name":"HSUI","Punchline":"A modern HUD replacement built for customization.","Description":"HSUI provides a highly configurable HUD replacement for FFXIV, recreated from DelvUI using KamiToolKit, FFXIVClientStructs, and Dalamud. Features unit frames, castbars, job gauges, nameplates, party frames, status effects, enemy list, configurable hotbars with drag-and-drop, and profiles.","Changelog":"1.0.8.20: Fixed cooldown overlays showing through game UI (dialogue box) when Show HUD during dialogue enabled. 1.0.8.19: Hotbar visibility moved to per-hotbar menus; removed Visibility Hotbars tab. 1.0.8.18: Visibility \"Hide unless hovered\" option. 1.0.8.17: Controller hotbars (cross layout, separate storage, sync with game). 1.0.8.16: Show HUD during dialogue and interaction. 1.0.8.15: Tooltips game-style formatting. 1.0.8.14: Mouse GCD Indicator. 1.0.8.13: Item tooltips now show. 1.0.8.12: Item/HQ icons now draw on hotbar. 1.0.8.11: Hotbar tooltip crash fix. 1.0.8.10: Hotbar crash fix when dragging inventory items. 1.0.8.9: Gearset persists on slot. 1.0.8.8: Gearset drag-drop fix. 1.0.8.7: Fixed Gearset icon clearing. 1.0.8.6: Crafting action tooltips full description. 1.0.8.4: Alliance Frames 1 and 2 fix; Hide in duty no longer hides alliance frames. 1.0.8.3: Fix left-click staying broken after disable. 1.0.8.2: Charge icons stay lit until all charges spent.","InternalName":"HSUI","AssemblyVersion":"1.0.8.20","RepoUrl":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI","ApplicableVersion":"any","Tags":["UI","HUD","Unit Frames","Nameplates","Party Frames","Hotbars"],"CategoryTags":["UI"],"DalamudApiLevel":14,"IconUrl":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/raw/branch/main/Media/Images/icon.png","ImageUrls":[],"DownloadLinkInstall":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.20/latest.zip","IsHide":false,"IsTestingExclusive":false,"DownloadLinkTesting":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.20/latest.zip","DownloadLinkUpdate":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.20/latest.zip","LastUpdate":"1772378453"}]