Skip to content

Commit

Permalink
use OnTooltipShow property of LDB
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbuds authored and Rottenbeer committed May 23, 2021
1 parent 39130d3 commit fc1e464
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions ItemRack/ItemRack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1731,8 +1731,7 @@ function ItemRack.InitBroker()
text = "ItemRack",
icon = texture,
OnClick = ItemRack.MinimapOnClick,
OnEnter = ItemRack.MinimapOnEnter,
OnLeave = ItemRack.MinimapOnLeave
OnTooltipShow = ItemRack.MinimapOnEnter,
})
ItemRackSettings.minimap = ItemRackSettings.minimap or { hide = false }
LDBIcon:Register("ItemRack", ItemRack.Broker, ItemRackSettings.minimap)
Expand Down Expand Up @@ -1771,16 +1770,14 @@ function ItemRack.MinimapOnClick(self,button)
end
end

function ItemRack.MinimapOnEnter(self)
if ItemRackSettings.MinimapTooltip=="ON" then
ItemRack.OnTooltip(self,"ItemRack","Left click: Select a set\nRight click: Open options\nAlt left click: Show hidden sets\nAlt right click: Toggle events\nShift click: Unequip this set")
end
end

function ItemRack.MinimapOnLeave(self)
if ItemRackSettings.MinimapTooltip=="ON" then
GameTooltip:Hide()
end
function ItemRack.MinimapOnEnter(tooltip)
if ItemRackSettings.MinimapTooltip~="ON" then return end
tooltip:AddLine("ItemRack")
tooltip:AddLine("Left click: Select a set",.8,.8,.8,1)
tooltip:AddLine("Right click: Open options",.8,.8,.8,1)
tooltip:AddLine("Alt left click: Show hidden sets",.8,.8,.8,1)
tooltip:AddLine("Alt right click: Toggle events",.8,.8,.8,1)
tooltip:AddLine("Shift click: Unequip this set",.8,.8,.8,1)
end

--[[ Non-LoD options support ]]
Expand Down

0 comments on commit fc1e464

Please sign in to comment.