mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
fix xperl issues
This commit is contained in:
@@ -14,9 +14,6 @@ Extension.RegisterEvent("PLAYER_ENTERING_WORLD", "DelayedInit")
|
||||
|
||||
local hookedFrames = {}
|
||||
|
||||
-- Re-entrancy guard to prevent stack overflow
|
||||
local isProcessing = false
|
||||
|
||||
function Extension.HookFrame(frame, unit)
|
||||
if not frame or hookedFrames[frame] then return end
|
||||
|
||||
@@ -24,23 +21,15 @@ function Extension.HookFrame(frame, unit)
|
||||
local onLeave = frame:GetScript("OnLeave")
|
||||
|
||||
frame:SetScript("OnEnter", function()
|
||||
if not isProcessing then
|
||||
local u = unit or this.unit
|
||||
if u then
|
||||
isProcessing = true
|
||||
CleveRoids.SetMouseoverFrom("df3", u)
|
||||
isProcessing = false
|
||||
end
|
||||
local u = unit or this.unit
|
||||
if u then
|
||||
CleveRoids.SetMouseoverFrom("df3", u)
|
||||
end
|
||||
if onEnter then onEnter() end
|
||||
end)
|
||||
|
||||
frame:SetScript("OnLeave", function()
|
||||
if not isProcessing then
|
||||
isProcessing = true
|
||||
CleveRoids.ClearMouseoverFrom("df3")
|
||||
isProcessing = false
|
||||
end
|
||||
CleveRoids.ClearMouseoverFrom("df3")
|
||||
if onLeave then onLeave() end
|
||||
end)
|
||||
|
||||
|
||||
@@ -13,9 +13,6 @@ Extension.RegisterEvent("PLAYER_ENTERING_WORLD", "DelayedInit")
|
||||
|
||||
local hookedFrames = {}
|
||||
|
||||
-- Re-entrancy guard to prevent stack overflow
|
||||
local isProcessing = false
|
||||
|
||||
function Extension.HookFrame(frame, unit)
|
||||
if not frame or hookedFrames[frame] then return end
|
||||
|
||||
@@ -23,23 +20,15 @@ function Extension.HookFrame(frame, unit)
|
||||
local onLeave = frame:GetScript("OnLeave")
|
||||
|
||||
frame:SetScript("OnEnter", function()
|
||||
if not isProcessing then
|
||||
local u = unit or this.unit
|
||||
if u then
|
||||
isProcessing = true
|
||||
CleveRoids.SetMouseoverFrom("dfr", u)
|
||||
isProcessing = false
|
||||
end
|
||||
local u = unit or this.unit
|
||||
if u then
|
||||
CleveRoids.SetMouseoverFrom("dfr", u)
|
||||
end
|
||||
if onEnter then onEnter() end
|
||||
end)
|
||||
|
||||
frame:SetScript("OnLeave", function()
|
||||
if not isProcessing then
|
||||
isProcessing = true
|
||||
CleveRoids.ClearMouseoverFrom("dfr")
|
||||
isProcessing = false
|
||||
end
|
||||
CleveRoids.ClearMouseoverFrom("dfr")
|
||||
if onLeave then onLeave() end
|
||||
end)
|
||||
|
||||
|
||||
@@ -17,9 +17,6 @@ Extension.RegisterEvent("PLAYER_ENTERING_WORLD", "DelayedInit")
|
||||
-- Track which frames we've hooked
|
||||
local hookedFrames = {}
|
||||
|
||||
-- Re-entrancy guard to prevent stack overflow
|
||||
local isProcessing = false
|
||||
|
||||
function Extension.HookFrame(frame)
|
||||
if not frame or hookedFrames[frame] then return end
|
||||
|
||||
@@ -27,20 +24,14 @@ function Extension.HookFrame(frame)
|
||||
local onLeave = frame:GetScript("OnLeave")
|
||||
|
||||
frame:SetScript("OnEnter", function()
|
||||
if not isProcessing and this.unit then
|
||||
isProcessing = true
|
||||
if this.unit then
|
||||
CleveRoids.SetMouseoverFrom("luna", this.unit)
|
||||
isProcessing = false
|
||||
end
|
||||
if onEnter then onEnter() end
|
||||
end)
|
||||
|
||||
frame:SetScript("OnLeave", function()
|
||||
if not isProcessing then
|
||||
isProcessing = true
|
||||
CleveRoids.ClearMouseoverFrom("luna")
|
||||
isProcessing = false
|
||||
end
|
||||
CleveRoids.ClearMouseoverFrom("luna")
|
||||
if onLeave then onLeave() end
|
||||
end)
|
||||
|
||||
|
||||
@@ -11,26 +11,18 @@ local CleveRoids = _G.CleveRoids or {}
|
||||
local Extension = CleveRoids.RegisterExtension("XPerl")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
|
||||
-- Re-entrancy guard to prevent stack overflow
|
||||
local isProcessing = false
|
||||
|
||||
-- X-Perl uses XPerl_PlayerTip(unitid) for OnEnter and XPerl_PlayerTipHide() for OnLeave
|
||||
-- We hook these functions to track mouseover
|
||||
-- Note: Re-entrancy is handled in Utility.lua's SetMouseoverFrom/ClearMouseoverFrom
|
||||
|
||||
function Extension.OnEnter(unitid)
|
||||
if isProcessing then return end
|
||||
if unitid and unitid ~= "" then
|
||||
isProcessing = true
|
||||
CleveRoids.SetMouseoverFrom("xperl", unitid)
|
||||
isProcessing = false
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.OnLeave()
|
||||
if isProcessing then return end
|
||||
isProcessing = true
|
||||
CleveRoids.ClearMouseoverFrom("xperl")
|
||||
isProcessing = false
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
|
||||
+9
-2
@@ -296,6 +296,9 @@ do
|
||||
return bestSource, bestUnit
|
||||
end
|
||||
|
||||
-- Re-entrancy guard to prevent stack overflow from UI update cascades
|
||||
local isUpdatingMouseover = false
|
||||
|
||||
local function apply(unit)
|
||||
if CleveRoids.hasSuperwow and _G.SetMouseoverUnit then
|
||||
_G.SetMouseoverUnit(unit)
|
||||
@@ -306,17 +309,19 @@ do
|
||||
end
|
||||
|
||||
function CleveRoids.SetMouseoverFrom(source, unit)
|
||||
if not source then return end
|
||||
if not source or isUpdatingMouseover then return end
|
||||
CleveRoids.__mo.sources[source] = unit
|
||||
local _, bestUnit = getBest()
|
||||
if bestUnit ~= CleveRoids.__mo.current then
|
||||
CleveRoids.__mo.current = bestUnit
|
||||
isUpdatingMouseover = true
|
||||
apply(bestUnit)
|
||||
isUpdatingMouseover = false
|
||||
end
|
||||
end
|
||||
|
||||
function CleveRoids.ClearMouseoverFrom(source, unitIfMatch)
|
||||
if not source then return end
|
||||
if not source or isUpdatingMouseover then return end
|
||||
if unitIfMatch and CleveRoids.__mo.sources[source] ~= unitIfMatch then
|
||||
return
|
||||
end
|
||||
@@ -324,7 +329,9 @@ do
|
||||
local _, bestUnit = getBest()
|
||||
if bestUnit ~= CleveRoids.__mo.current then
|
||||
CleveRoids.__mo.current = bestUnit
|
||||
isUpdatingMouseover = true
|
||||
apply(bestUnit)
|
||||
isUpdatingMouseover = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user