-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleRaidFrames_Tooltips.lua
More file actions
executable file
·44 lines (36 loc) · 1.12 KB
/
SimpleRaidFrames_Tooltips.lua
File metadata and controls
executable file
·44 lines (36 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
local ADDON_NAME = ...
local M = _G[ADDON_NAME]
local isFrameInRaidContainer = M.IsFrameInRaidContainer
local function shouldHideTooltip(frame)
return M.DB
and M.DB.hideRaidFrameTooltips
and frame
and isFrameInRaidContainer
and isFrameInRaidContainer(frame)
end
local function hideRaidFrameTooltip(frame)
if not shouldHideTooltip(frame) or not GameTooltip then
return
end
frame.UpdateTooltip = nil
GameTooltip:Hide()
end
function M:RefreshRaidFrameTooltips()
if not (M.DB and M.DB.hideRaidFrameTooltips) or not GameTooltip or not GameTooltip.GetOwner then
return
end
local owner = GameTooltip:GetOwner()
if owner and shouldHideTooltip(owner) then
GameTooltip:Hide()
end
end
function M:EnsureRaidTooltipHooks()
if type(UnitFrame_UpdateTooltip) == "function" and not M._unitFrameUpdateTooltipHooked then
hooksecurefunc("UnitFrame_UpdateTooltip", hideRaidFrameTooltip)
M._unitFrameUpdateTooltipHooked = true
end
if type(UnitFrame_OnEnter) == "function" and not M._unitFrameOnEnterTooltipHooked then
hooksecurefunc("UnitFrame_OnEnter", hideRaidFrameTooltip)
M._unitFrameOnEnterTooltipHooked = true
end
end