Skip to content

Commit

Permalink
Tooltips: Add Display on mouse back in #481
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Dec 13, 2022
1 parent 6c0b4ac commit 1753838
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Modules/Tooltips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function module:OnInitialize()
Anchor = {onMouse = false, Moved = false, AnchorPos = {}}
},
Background = 'Smoke',
onMouse = false,
VendorPrices = true,
Override = {},
ColorOverlay = true,
Expand Down Expand Up @@ -115,6 +116,14 @@ local TipCleared = function(self)
self.itemCleared = nil
end

local setPoint = function(self, parent)
if parent then
if (module.DB.onMouse) then
self:SetOwner(parent, 'ANCHOR_CURSOR')
end
end
end

local SetBorderColor = function(self, r, g, b, hasStatusBar)
self.SUITip.border:Show()
self.SUITip.border[1]:SetVertexColor(r, g, b, 1)
Expand Down Expand Up @@ -474,6 +483,7 @@ function module:OnEnable()

--Do Setup
ApplyTooltipSkins()
hooksecurefunc('GameTooltip_SetDefaultAnchor', setPoint)

GameTooltip:HookScript('OnTooltipCleared', TipCleared)
if TooltipDataProcessor then
Expand Down Expand Up @@ -533,6 +543,12 @@ function module:BuildOptions()
type = 'toggle',
order = 11,
desc = L['Apply the color to the texture or put it over the texture']
},
onMouse = {
name = L['Display on mouse?'],
type = 'toggle',
order = 12,
desc = L['TooltipOverrideDesc']
}
}
}
Expand Down

0 comments on commit 1753838

Please sign in to comment.