mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
add mouseover fallback when tooltips not available
This commit is contained in:
@@ -6,8 +6,7 @@ local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
local Extension = CleveRoids.RegisterExtension("GameTooltipMouseover")
|
||||
|
||||
local lastUnit, setByTooltip = nil, false
|
||||
|
||||
-- Tooltip-based mouseover (lowest priority fallback)
|
||||
function Extension.SetUnit(_, unit)
|
||||
if unit and unit ~= "" then
|
||||
CleveRoids.SetMouseoverFrom("tooltip", unit)
|
||||
@@ -18,11 +17,21 @@ function Extension.OnClose()
|
||||
CleveRoids.ClearMouseoverFrom("tooltip")
|
||||
end
|
||||
|
||||
-- Native UPDATE_MOUSEOVER_UNIT handler (priority 2)
|
||||
-- This works even when tooltips are hidden by other addons
|
||||
function Extension.UPDATE_MOUSEOVER_UNIT()
|
||||
if UnitExists("mouseover") then
|
||||
CleveRoids.SetMouseoverFrom("native", "mouseover")
|
||||
else
|
||||
CleveRoids.ClearMouseoverFrom("native")
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
Extension.HookMethod(_G["GameTooltip"], "SetUnit", "SetUnit")
|
||||
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnClose")
|
||||
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnClose")
|
||||
Extension.RegisterEvent("UPDATE_MOUSEOVER_UNIT", "UPDATE_MOUSEOVER_UNIT")
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
@@ -248,6 +248,7 @@ do
|
||||
local PRIORITY = {
|
||||
pfui = 3,
|
||||
blizz = 3,
|
||||
native = 2,
|
||||
tooltip = 1,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user