v1.0.2.3: Keypress flash indicator for hotbar slots

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-01-31 02:59:15 -05:00
parent 1011d126d8
commit 4365f78ef7
7 changed files with 52 additions and 10 deletions
+3 -3
View File
@@ -9,9 +9,9 @@
<PropertyGroup> <PropertyGroup>
<AssemblyName>HSUI</AssemblyName> <AssemblyName>HSUI</AssemblyName>
<AssemblyVersion>1.0.2.2</AssemblyVersion> <AssemblyVersion>1.0.2.3</AssemblyVersion>
<FileVersion>1.0.2.2</FileVersion> <FileVersion>1.0.2.3</FileVersion>
<InformationalVersion>1.0.2.2</InformationalVersion> <InformationalVersion>1.0.2.3</InformationalVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
+1 -1
View File
@@ -2,7 +2,7 @@
"Author": "Knack117", "Author": "Knack117",
"Name": "HSUI", "Name": "HSUI",
"InternalName": "HSUI", "InternalName": "HSUI",
"AssemblyVersion": "1.0.2.2", "AssemblyVersion": "1.0.2.3",
"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.", "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", "ApplicableVersion": "any",
"RepoUrl": "https://github.com/Knack117/HSUI", "RepoUrl": "https://github.com/Knack117/HSUI",
+25
View File
@@ -294,9 +294,34 @@ namespace HSUI.Helpers
if (ImGui.GetTime() >= suppressUntil) if (ImGui.GetTime() >= suppressUntil)
_suppressExecuteSlotByIdForDrop = (99, 99, 0); _suppressExecuteSlotByIdForDrop = (99, 99, 0);
// Record for keypress flash (hotbarId 0-9 = bars 1-10, slotId 0-11)
LastExecutedBar = (int)hotbarId + 1;
LastExecutedSlot = (int)slotId;
LastExecutedTime = ImGui.GetTime();
return _executeSlotByIdHook != null ? _executeSlotByIdHook.Original(module, hotbarId, slotId) : (byte)0; return _executeSlotByIdHook != null ? _executeSlotByIdHook.Original(module, hotbarId, slotId) : (byte)0;
} }
/// <summary>Bar 1-10, Slot 0-11. Set when ExecuteSlotById is invoked (keybind or click).</summary>
public static int LastExecutedBar { get; private set; } = -1;
public static int LastExecutedSlot { get; private set; } = -1;
public static double LastExecutedTime { get; private set; }
/// <summary>True if this slot was executed within the given duration (seconds).</summary>
public static bool WasSlotJustExecuted(int hotbarIndex, int slotIndex, double durationSec = 0.2)
{
if (LastExecutedBar != hotbarIndex || LastExecutedSlot != slotIndex) return false;
return (ImGui.GetTime() - LastExecutedTime) <= durationSec;
}
/// <summary>0=just pressed, 1=fully faded. For smooth flash decay.</summary>
public static float GetKeypressFlashAlpha(int hotbarIndex, int slotIndex, double durationSec = 0.2)
{
if (!WasSlotJustExecuted(hotbarIndex, slotIndex, durationSec)) return 0f;
double elapsed = ImGui.GetTime() - LastExecutedTime;
return (float)(1.0 - (elapsed / durationSec));
}
private bool IsActionValid(ulong actionID, IGameObject? target) private bool IsActionValid(ulong actionID, IGameObject? target)
{ {
if (target == null || actionID == 0 || _sheet == null) if (target == null || actionID == 0 || _sheet == null)
@@ -195,6 +195,16 @@ namespace HSUI.Interface.GeneralElements
DrawHelper.DrawOutlinedText(cdText, textPos, 0xFFFFFFFF, 0xFF000000, drawList, 1); DrawHelper.DrawOutlinedText(cdText, textPos, 0xFFFFFFFF, 0xFF000000, drawList, 1);
} }
} }
if (Config.ShowKeypressFlash)
{
float flashAlpha = InputsHelper.GetKeypressFlashAlpha(Config.HotbarIndex, i, 0.2);
if (flashAlpha > 0.001f)
{
byte a = (byte)(flashAlpha * 0.5f * 255);
drawList.AddRectFilled(pos, pos + size, (uint)(a << 24 | 0xFFFFFF));
}
}
} }
if (Config.ShowSlotNumbers && !slot.IsEmpty) if (Config.ShowSlotNumbers && !slot.IsEmpty)
+5 -1
View File
@@ -67,11 +67,15 @@ namespace HSUI.Interface.GeneralElements
[Order(29)] [Order(29)]
public bool ShowComboHighlight = true; public bool ShowComboHighlight = true;
[Checkbox("Show Keypress Flash")]
[Order(30)]
public bool ShowKeypressFlash = true;
[NestedConfig("Combo Highlight", 31)] [NestedConfig("Combo Highlight", 31)]
public ComboHighlightConfig ComboHighlightConfig = new(); public ComboHighlightConfig ComboHighlightConfig = new();
[Checkbox("Debug Drag & Drop")] [Checkbox("Debug Drag & Drop")]
[Order(30)] [Order(32)]
public bool DebugDragDrop = false; public bool DebugDragDrop = false;
[NestedConfig("Visibility", 70)] [NestedConfig("Visibility", 70)]
+3
View File
@@ -1,3 +1,6 @@
# 1.0.2.3
- **Hotbars**: Keypress flash indicator — slots flash when you press their keybind (or click). Toggle in Hotbars → per-hotbar "Show Keypress Flash".
# 1.0.2.2 # 1.0.2.2
- **Critical fix**: ColorUtils.GetColorByScale was throwing (corrupted config or divide-by-zero), causing Party Frames to crash the draw loop and preventing Hotbars and later elements from rendering. Added null checks, divide-by-zero guard, and try-catch fallback. - **Critical fix**: ColorUtils.GetColorByScale was throwing (corrupted config or divide-by-zero), causing Party Frames to crash the draw loop and preventing Hotbars and later elements from rendering. Added null checks, divide-by-zero guard, and try-catch fallback.
+5 -5
View File
@@ -4,9 +4,9 @@
"Name": "HSUI", "Name": "HSUI",
"Punchline": "A modern HUD replacement built for customization.", "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.", "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": "Fix: ColorUtils crash that prevented hotbars from showing. Null/divide-by-zero guards in GetColorByScale.", "Changelog": "Hotbars: Keypress flash indicator when pressing slot keybinds. Toggle per hotbar.",
"InternalName": "HSUI", "InternalName": "HSUI",
"AssemblyVersion": "1.0.2.2", "AssemblyVersion": "1.0.2.3",
"RepoUrl": "https://github.com/Knack117/HSUI", "RepoUrl": "https://github.com/Knack117/HSUI",
"ApplicableVersion": "any", "ApplicableVersion": "any",
"Tags": ["UI", "HUD", "Unit Frames", "Nameplates", "Party Frames", "Hotbars"], "Tags": ["UI", "HUD", "Unit Frames", "Nameplates", "Party Frames", "Hotbars"],
@@ -14,10 +14,10 @@
"DalamudApiLevel": 14, "DalamudApiLevel": 14,
"IconUrl": "https://raw.githubusercontent.com/Knack117/HSUI/main/Media/Images/icon.png", "IconUrl": "https://raw.githubusercontent.com/Knack117/HSUI/main/Media/Images/icon.png",
"ImageUrls": [], "ImageUrls": [],
"DownloadLinkInstall": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.2/latest.zip", "DownloadLinkInstall": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.3/latest.zip",
"IsHide": false, "IsHide": false,
"IsTestingExclusive": false, "IsTestingExclusive": false,
"DownloadLinkTesting": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.2/latest.zip", "DownloadLinkTesting": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.3/latest.zip",
"DownloadLinkUpdate": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.2/latest.zip" "DownloadLinkUpdate": "https://github.com/Knack117/HSUI/releases/download/v1.0.2.3/latest.zip"
} }
] ]