Skip to content

Commit

Permalink
feat:
Browse files Browse the repository at this point in the history
clicking on the target's heath bar with an item on cursor will open a trade window.
  • Loading branch information
grimmier378 committed Apr 2, 2024
1 parent e5cca6c commit 87467a4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion init.lua
Expand Up @@ -554,8 +554,10 @@ function GUI_Target(open)
end
--Target Info
if (TARGET() ~= nil) then
ImGui.BeginGroup()
local targetName = TARGET.CleanName() or '?'
local tC = getConLevel(TARGET) or "WHITE"
if tC == 'red' then tC = 'pink' end
local tClass = TARGET.Class.ShortName() == 'UNKNOWN CLASS' and Icons.MD_HELP_OUTLINE or
TARGET.Class.ShortName()
local tLvl = TARGET.Level() or 0
Expand Down Expand Up @@ -589,7 +591,7 @@ function GUI_Target(open)
ImGui.TableSetColumnIndex(1)

ImGui.PushStyleColor(ImGuiCol.Text,COLOR.color(tC))
if tC == 'red' then
if tC == 'pink' then
ImGui.Text(' ' .. Icons.MD_WARNING)
else
ImGui.Text(' ' .. Icons.MD_LENS)
Expand Down Expand Up @@ -640,6 +642,12 @@ function GUI_Target(open)
else
ImGui.Text('')
end
ImGui.EndGroup()
if ImGui.IsItemHovered() and ImGui.IsMouseReleased(ImGuiMouseButton.Left) then
if mq.TLO.Cursor() then
mq.cmdf('/multiline ; /if (${Cursor.ID}) /click left target')
end
end
--Target Buffs
if tonumber(TARGET.BuffCount()) > 0 then
local windowWidth, windowHeight = ImGui.GetContentRegionAvail()
Expand All @@ -649,6 +657,7 @@ function GUI_Target(open)
ImGui.EndChild()
-- End the scrollable region
end

else
ImGui.Text('')
end
Expand Down

0 comments on commit 87467a4

Please sign in to comment.