Expose ClassicAPI native region mouseover

This commit is contained in:
Dusk-92
2026-09-03 20:52:57 +02:00
parent f03b3dc460
commit af0229b8a3
+11
View File
@@ -77,6 +77,9 @@ API.eventutils = type(_G.C_EventUtils) == "table"
API.timer = type(_G.C_Timer) == "table"
and type(_G.C_Timer.After) == "function"
API.regionmouseover = _G.UIParent
and type(_G.UIParent.IsMouseOver) == "function"
-- ClassicAPI v1.12.5 made nameplate lifecycle events reload-safe by clearing
-- and rebuilding their token/wrapper state around /reload. Older builds can
-- expose the same event names without those guarantees, so keep them on the
@@ -362,6 +365,14 @@ API.Defer = function(callback)
end
end
API.IsMouseOver = function(region, topOffset, bottomOffset, leftOffset, rightOffset)
if API.regionmouseover and region then
return region:IsMouseOver(topOffset, bottomOffset, leftOffset, rightOffset)
and true or false
end
return false
end
API.GetContainerNumFreeSlots = function(bag)
if API.inventory then
return _G.C_Container.GetContainerNumFreeSlots(bag)