Use ClassicAPI native tooltip identity paths

This commit is contained in:
Dusk-92
2026-09-03 17:39:04 +02:00
parent 0660e1acb5
commit 222e5fd1ed
2 changed files with 96 additions and 226 deletions
+20
View File
@@ -109,6 +109,13 @@ API.playerstate = type(_G.IsMounted) == "function"
and type(_G.CancelShapeshiftForm) == "function"
API.unitguid = type(_G.UnitGUID) == "function"
API.unittoken = type(_G.UnitTokenFromGUID) == "function"
API.tooltipunit = _G.GameTooltip
and type(_G.GameTooltip.GetUnitGUID) == "function"
-- OnTooltipSetUnit shipped in ClassicAPI v1.8.2. Tooltip Details uses this
-- native builder event directly instead of Vanilla OnShow/mouseover polling.
API.tooltipsetunit = API.classicapi_version >= 10802
and API.tooltipunit and API.unittoken
API.unitrange = type(_G.UnitInRange) == "function"
API.macrospell = type(_G.GetMacroSpell) == "function"
@@ -660,6 +667,19 @@ API.UnitGUID = function(unit)
end
end
API.UnitTokenFromGUID = function(guid)
if API.unittoken and guid then
return _G.UnitTokenFromGUID(guid)
end
end
API.GetTooltipUnitGUID = function(tooltip)
if API.tooltipunit and tooltip then
local _, guid = tooltip:GetUnitGUID()
return guid
end
end
-- Prefer ClassicAPI's reach-aware 40-yard UnitInRange. The wrapper handles
-- the player's own frame explicitly and preserves a Vanilla interaction check
-- only as a centralized compatibility fallback.