diff --git a/HSUI.csproj b/HSUI.csproj index 9f67e5e..f8f10f7 100644 --- a/HSUI.csproj +++ b/HSUI.csproj @@ -9,9 +9,9 @@ HSUI - 1.0.8.5 - 1.0.8.5 - 1.0.8.5 + 1.0.8.6 + 1.0.8.6 + 1.0.8.6 diff --git a/HSUI.json b/HSUI.json index 57c5989..3339765 100644 --- a/HSUI.json +++ b/HSUI.json @@ -2,7 +2,7 @@ "Author": "Knack117", "Name": "HSUI", "InternalName": "HSUI", - "AssemblyVersion": "1.0.8.5", + "AssemblyVersion": "1.0.8.6", "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/Interface/GeneralElements/ActionBarsHud.cs b/Interface/GeneralElements/ActionBarsHud.cs index 8c09a35..5e877b0 100644 --- a/Interface/GeneralElements/ActionBarsHud.cs +++ b/Interface/GeneralElements/ActionBarsHud.cs @@ -1196,21 +1196,63 @@ namespace HSUI.Interface.GeneralElements LuminaAction? actionRow = null; var actionSheet = Plugin.DataManager.GetExcelSheet(); - var actionRowOpt = actionSheet?.GetRow(slot.ActionId); - if (actionRowOpt.HasValue) + if (actionSheet != null) { - actionRow = actionRowOpt.Value; - } - else if (slot.SlotType == RaptureHotbarModule.HotbarSlotType.CraftAction) - { - // Crafting actions: hotbar may store CraftAction sheet row ID (1-based). Action sheet uses 100000+ range (100001 = Basic Synthesis). - const uint CraftActionToActionOffset = 100000; - uint mappedId = slot.ActionId + CraftActionToActionOffset; - var mappedRow = actionSheet?.GetRow(mappedId); - if (mappedRow.HasValue) + if (actionSheet.TryGetRow(slot.ActionId, out var actionRowOpt)) { - actionIdForLookup = mappedId; - actionRow = mappedRow.Value; + actionRow = actionRowOpt; + } + else if (slot.SlotType == RaptureHotbarModule.HotbarSlotType.CraftAction) + { + // Crafting actions: hotbar may store CraftAction sheet row ID (1-based). Action sheet uses 100000+ range (100001 = Basic Synthesis). + const uint CraftActionToActionOffset = 100000; + uint mappedId = slot.ActionId + CraftActionToActionOffset; + if (actionSheet.TryGetRow(mappedId, out var mappedRow)) + { + actionIdForLookup = mappedId; + actionRow = mappedRow; + } + } + } + + // CraftAction fallback: when Action sheet lookup failed, try CraftAction sheet directly (hotbar stores CraftAction row ID). + if (!actionRow.HasValue && slot.SlotType == RaptureHotbarModule.HotbarSlotType.CraftAction) + { + var craftSheet = Plugin.DataManager.GetExcelSheet(); + if (craftSheet != null && craftSheet.TryGetRow(slot.ActionId, out var craftRow)) + { + try + { + var nameSe = craftRow.Name; + string name = nameSe.ToString(); + if (string.IsNullOrWhiteSpace(name)) + name = nameSe.ToDalamudString().ToString(); + if (!string.IsNullOrWhiteSpace(name)) + { + // CraftAction sheet has its own Description column with the full text + string desc = ""; + try + { + var descSe = craftRow.Description; + var descRaw = descSe.ToDalamudString().ToString(); + if (!string.IsNullOrEmpty(descRaw)) + { + try + { + var evaluated = Plugin.SeStringEvaluator.Evaluate(descSe.AsSpan()); + desc = evaluated.ExtractText(); + if (string.IsNullOrEmpty(desc)) desc = descRaw; + } + catch { desc = descRaw; } + if (!string.IsNullOrEmpty(desc)) + desc = EncryptedStringsHelper.GetString(desc); + } + } + catch { /* ignore */ } + return (name, desc); + } + } + catch { /* ignore */ } } } @@ -1219,28 +1261,57 @@ namespace HSUI.Interface.GeneralElements { string name = row.Value.Name.ToString(); string desc = ""; - var descRow = Plugin.DataManager.GetExcelSheet()?.GetRow(actionIdForLookup); string descRaw = ""; - if (descRow.HasValue) + // For CraftAction, use CraftAction.Description; ActionTransient returns the name instead of the full description + if (slot.SlotType == RaptureHotbarModule.HotbarSlotType.CraftAction) { - try + var craftSheet = Plugin.DataManager.GetExcelSheet(); + if (craftSheet != null && craftSheet.TryGetRow(actionIdForLookup, out var craftRow)) { - var descSeStr = descRow.Value.Description; - descRaw = descRow.Value.Description.ToDalamudString().ToString(); try { - var evaluated = Plugin.SeStringEvaluator.Evaluate(descSeStr.AsSpan()); - desc = evaluated.ExtractText(); - if (string.IsNullOrEmpty(desc)) desc = descRaw; + var descSe = craftRow.Description; + var craftDescRaw = descSe.ToDalamudString().ToString(); + if (!string.IsNullOrEmpty(craftDescRaw)) + { + try + { + var evaluated = Plugin.SeStringEvaluator.Evaluate(descSe.AsSpan()); + desc = evaluated.ExtractText(); + if (string.IsNullOrEmpty(desc)) desc = craftDescRaw; + } + catch { desc = craftDescRaw; } + if (!string.IsNullOrEmpty(desc)) + desc = EncryptedStringsHelper.GetString(desc); + } } - catch - { - desc = descRaw; - } - if (!string.IsNullOrEmpty(desc)) - desc = EncryptedStringsHelper.GetString(desc); + catch { /* ignore */ } + } + } + else + { + var descSheet = Plugin.DataManager.GetExcelSheet(); + if (descSheet != null && descSheet.TryGetRow(actionIdForLookup, out var descRow)) + { + try + { + var descSeStr = descRow.Description; + descRaw = descRow.Description.ToDalamudString().ToString(); + try + { + var evaluated = Plugin.SeStringEvaluator.Evaluate(descSeStr.AsSpan()); + desc = evaluated.ExtractText(); + if (string.IsNullOrEmpty(desc)) desc = descRaw; + } + catch + { + desc = descRaw; + } + if (!string.IsNullOrEmpty(desc)) + desc = EncryptedStringsHelper.GetString(desc); + } + catch { /* ignore */ } } - catch { /* ignore */ } } bool isCombatAction = IsCombatAction(slot.SlotType, row.Value); int? potencyValue = isCombatAction ? TryGetPotencyValue(row.Value) : null; diff --git a/changelog.md b/changelog.md index 1337723..9b88239 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +# 1.0.8.6 +- **Hotbars**: Fixed crafting action tooltips showing the action name instead of the full description — use CraftAction.Description directly instead of ActionTransient, which returns the name for crafting actions. + # 1.0.8.5 - **Hotbars**: Fixed other HSUI elements disappearing when hovering over hotbar icons — overlay is now a child of the main HUD window instead of a separate window.