diff --git a/HSUI.csproj b/HSUI.csproj index fac4b99..1113d53 100644 --- a/HSUI.csproj +++ b/HSUI.csproj @@ -9,9 +9,9 @@ HSUI - 1.0.8.23 - 1.0.8.23 - 1.0.8.23 + 1.0.8.24 + 1.0.8.24 + 1.0.8.24 diff --git a/HSUI.json b/HSUI.json index 780088a..c35465f 100644 --- a/HSUI.json +++ b/HSUI.json @@ -2,7 +2,7 @@ "Author": "Knack117", "Name": "HSUI", "InternalName": "HSUI", - "AssemblyVersion": "1.0.8.23", + "AssemblyVersion": "1.0.8.24", "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/ContextMenuVisibilityHelper.cs b/Helpers/ContextMenuVisibilityHelper.cs new file mode 100644 index 0000000..c638e69 --- /dev/null +++ b/Helpers/ContextMenuVisibilityHelper.cs @@ -0,0 +1,25 @@ +using HSUI.Interface; + +namespace HSUI.Helpers +{ + /// + /// Tracks which HUD element currently has its context menu open, so visibility can be ignored for that element + /// while the menu is open (e.g. "hide unless hovered" would otherwise hide the element when the mouse moves to the menu). + /// + public static class ContextMenuVisibilityHelper + { + private static HudElement? _elementWithContextMenuOpen; + + /// Call when opening a context menu for this element. + public static void SetContextMenuOpen(HudElement? element) + { + _elementWithContextMenuOpen = element; + } + + /// True if the given element currently has its context menu open. + public static bool IsContextMenuOpenFor(HudElement element) + { + return _elementWithContextMenuOpen != null && _elementWithContextMenuOpen == element; + } + } +} diff --git a/Helpers/DutyListScenarioHelper.cs b/Helpers/DutyListScenarioHelper.cs index bef9634..cca6046 100644 --- a/Helpers/DutyListScenarioHelper.cs +++ b/Helpers/DutyListScenarioHelper.cs @@ -198,7 +198,7 @@ namespace HSUI.Helpers return false; } - /// Read objective text from the game's ToDoList string array (same data the default Duty List UI uses). Layout: titles at 0..QuestCount-1, details at QuestCount..2*QuestCount-1. + /// Read objective text from the game's ToDoList string array (same data the default Duty List UI uses). Layout: titles at 0..QuestCount-1, details at QuestCount..2*QuestCount-1. Pairs by quest name to avoid wrong objectives when array order differs from NormalQuests order. private static unsafe void TryFillObjectivesFromToDoListStringArray(List result) { if (result.Count == 0) return; @@ -229,20 +229,21 @@ namespace HSUI.Helpers var entry = result[i]; if (!string.IsNullOrWhiteSpace(entry.ObjectiveText)) continue; + // Prefer matching by quest name: game's string array order can differ from NormalQuests order (e.g. display order), so index-based pairing can assign wrong objectives to the top entries. string obj = ""; - if (i < questCount) - obj = ReadSlot(questCount + i).Trim(); - if (string.IsNullOrWhiteSpace(obj)) + int titleIdx = -1; + for (int j = 0; j < questCount; j++) { - int titleIdx = -1; - for (int j = 0; j < questCount; j++) - { - if (string.Equals(ReadSlot(j).Trim(), entry.QuestName, StringComparison.OrdinalIgnoreCase)) - { titleIdx = j; break; } - } - if (titleIdx >= 0) - obj = ReadSlot(questCount + titleIdx).Trim(); + if (string.Equals(ReadSlot(j).Trim(), entry.QuestName, StringComparison.OrdinalIgnoreCase)) + { titleIdx = j; break; } } + if (titleIdx >= 0) + obj = ReadSlot(questCount + titleIdx).Trim(); + + // Fallback: use index when name match failed (e.g. trimmed name difference or empty slot) + if (string.IsNullOrWhiteSpace(obj) && i < questCount) + obj = ReadSlot(questCount + i).Trim(); + if (string.IsNullOrWhiteSpace(obj)) continue; result[i] = entry with { ObjectiveText = obj }; } diff --git a/Interface/GeneralElements/MainMenuHud.cs b/Interface/GeneralElements/MainMenuHud.cs index d2b0632..e14bcc8 100644 --- a/Interface/GeneralElements/MainMenuHud.cs +++ b/Interface/GeneralElements/MainMenuHud.cs @@ -124,6 +124,7 @@ namespace HSUI.Interface.GeneralElements if (subEntries != null && subEntries.Count > 0) { _contextMenuEntries = subEntries; + Helpers.ContextMenuVisibilityHelper.SetContextMenuOpen(this); ImGui.OpenPopup("HSUI_MainMenu_Context"); ImGui.SetNextWindowPos(ImGui.GetMousePos()); } @@ -182,6 +183,7 @@ namespace HSUI.Interface.GeneralElements else { _contextMenuEntries = null; + Helpers.ContextMenuVisibilityHelper.SetContextMenuOpen(null); } }, true); }); diff --git a/Interface/HudHelper.cs b/Interface/HudHelper.cs index 6115476..b88a456 100644 --- a/Interface/HudHelper.cs +++ b/Interface/HudHelper.cs @@ -126,6 +126,10 @@ namespace HSUI.Interface public bool IsElementHidden(HudElement element) { + // When this element's context menu is open, ignore visibility so the element stays visible + if (ContextMenuVisibilityHelper.IsContextMenuOpenFor(element)) + return false; + IHudElementWithVisibilityConfig? e = element as IHudElementWithVisibilityConfig; if (e == null || e.VisibilityConfig == null) { return false; } diff --git a/changelog.md b/changelog.md index 240fd15..cb6a49c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# 1.0.8.24 +- **Visibility**: When a context menu is open for an element (e.g. Main Menu bar), visibility settings are ignored for that element so it stays visible while the menu is open. +- **Duty List & Scenario Guide**: Fixed wrong objectives for the top entries — objectives are now matched by quest name to the game's string array instead of by index, so each quest shows the correct objective text. + # 1.0.8.23 - **Main Menu**: New customizable main menu bar replacing the game's bar. Correct icons (Duty, Logs, Travel, Social) and context menus; Logs/Travel identified by submenu names. Background drawn only behind icons (no extra side padding). Crash fix when executing from context menu (RunOnFrameworkThread). - **Duty List & Scenario Guide**: Background transparent by default; optional skip draw when fully transparent. diff --git a/pluginmaster.json b/pluginmaster.json index 5d7a257..8842cdc 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.23: Main Menu bar; Duty List & Scenario Guide transparent background. 1.0.8.22: Duty List hide-unless-hovered fix; tooltips job gauge costs. 1.0.8.21: Duty List in-duty info. 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.23","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.23/latest.zip","IsHide":false,"IsTestingExclusive":false,"DownloadLinkTesting":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.23/latest.zip","DownloadLinkUpdate":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.23/latest.zip","LastUpdate":"1772500800"}] +[{"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.24: Context menu keeps element visible; Duty List objectives fixed (match by quest name). 1.0.8.23: Main Menu bar; Duty List & Scenario Guide transparent background. 1.0.8.22: Duty List hide-unless-hovered fix; tooltips job gauge costs. 1.0.8.21: Duty List in-duty info. 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.24","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.24/latest.zip","IsHide":false,"IsTestingExclusive":false,"DownloadLinkTesting":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.24/latest.zip","DownloadLinkUpdate":"http://brassnet.ddns.net:33983/KnackAtNite/HSUI/releases/download/v1.0.8.24/latest.zip","LastUpdate":"1772673600"}]