Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions HitPoints/engaged.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ engaged.DrawWindow = function()
windowFlags = bit.bor(windowFlags, ImGuiWindowFlags_NoMove);
end
if (imgui.Begin('HitPoints - Engaged', true, windowFlags)) then
imgui.SetWindowFontScale(engagedSettings.textScale);
local fontSize = imgui.GetFontSize();
imgui.PushFont(nil, fontSize * engagedSettings.textScale);
local winStartX, _ = imgui.GetWindowPos();
local playerTarget = AshitaCore:GetMemoryManager():GetTarget();
local targetIndex;
Expand Down Expand Up @@ -153,16 +154,18 @@ engaged.DrawWindow = function()

imgui.Separator();

-- Create a clickable area for the entire target entry (after all content is drawn)
local entryHeight = yDist + engagedSettings.bgPadding;
-- Use InvisibleButton positioned exactly over the background area
imgui.SetCursorScreenPos({winX + cornerOffset, winY + cornerOffset});
if imgui.InvisibleButton('TargetEntry'..k, {rectLength - cornerOffset, entryHeight}) then
-- Handle click - target this entity
local serverId = AshitaCore:GetMemoryManager():GetEntity():GetServerId(k);
local decimalId = tonumber(serverId);
if decimalId and decimalId > 0 then
AshitaCore:GetChatManager():QueueCommand(-1, '/target ' .. decimalId);
if not gShowConfig[1] then
-- Create a clickable area for the entire target entry (after all content is drawn)
local entryHeight = yDist + engagedSettings.bgPadding;
-- Use InvisibleButton positioned exactly over the background area
imgui.SetCursorScreenPos({winX + cornerOffset, winY + cornerOffset});
if imgui.InvisibleButton('TargetEntry'..k, {rectLength - cornerOffset, entryHeight}) then
-- Handle click - target this entity
local serverId = AshitaCore:GetMemoryManager():GetEntity():GetServerId(k);
local decimalId = tonumber(serverId);
if decimalId and decimalId > 0 then
AshitaCore:GetChatManager():QueueCommand(-1, '/target ' .. decimalId);
end
end
end

Expand All @@ -173,6 +176,7 @@ engaged.DrawWindow = function()
end
end
end
imgui.PopFont();
end
imgui.End();
end
Expand Down
4 changes: 3 additions & 1 deletion HitPoints/hitpoints.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

addon.name = 'HitPoints';
addon.author = 'Tirem';
addon.version = '2.1';
addon.version = '2.13';
addon.desc = 'Displays information bars about the target and engaged enemies.';
addon.link = 'https://github.com/tirem/hitpoints'

Expand Down Expand Up @@ -232,6 +232,8 @@ local function DrawConfig()
end
imgui.EndTabItem();
end

imgui.EndTabBar();
end
imgui.End();
end
Expand Down