mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
fix mousueover for many ui addons and add many more to support them
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("Blizzard")
|
||||
|
||||
@@ -17,14 +16,14 @@ function Extension.RegisterMouseoverForFrame(frame, unit)
|
||||
local onleave = frame:GetScript("OnLeave")
|
||||
|
||||
frame:SetScript("OnEnter", function()
|
||||
CleveRoids.mouseoverUnit = unit
|
||||
CleveRoids.SetMouseoverFrom("blizz", unit)
|
||||
if onenter then
|
||||
onenter()
|
||||
end
|
||||
end)
|
||||
|
||||
frame:SetScript("OnLeave", function()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("blizz")
|
||||
if onleave then
|
||||
onleave()
|
||||
end
|
||||
@@ -75,3 +74,5 @@ do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("CT_RaidAssist")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
@@ -41,11 +40,11 @@ function Extension.OnEnter()
|
||||
end
|
||||
end
|
||||
end
|
||||
CleveRoids.mouseoverUnit = "raid"..id
|
||||
CleveRoids.SetMouseoverFrom("ctra", "raid"..id)
|
||||
end
|
||||
|
||||
function Extension.OnLeave()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("ctra")
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
@@ -59,4 +58,4 @@ function Extension.OnLoad()
|
||||
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("CT_UnitFrames")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
@@ -15,12 +14,12 @@ function Extension.SetHook(widget)
|
||||
|
||||
widget:SetScript("OnEnter", function()
|
||||
hookedOnEnter()
|
||||
CleveRoids.mouseoverUnit = "targettarget"
|
||||
CleveRoids.SetMouseoverFrom("ctuf", "targettarget")
|
||||
end)
|
||||
|
||||
widget:SetScript("OnLeave", function()
|
||||
hookedOnLeave()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("ctuf")
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -36,4 +35,4 @@ function Extension.OnLoad()
|
||||
Extension.SetHook(CT_AssistFrame_Drag)
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
@@ -4,25 +4,24 @@
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("DiscordUnitFrames")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
|
||||
function Extension.OnEnterFrame()
|
||||
CleveRoids.mouseoverUnit = this.unit
|
||||
CleveRoids.SetMouseoverFrom("duf", this.unit)
|
||||
end
|
||||
|
||||
function Extension.OnLeaveFrame()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("duf")
|
||||
end
|
||||
|
||||
function Extension.OnEnterElement()
|
||||
CleveRoids.mouseoverUnit = this:GetParent().unit
|
||||
CleveRoids.SetMouseoverFrom("duf", this:GetParent().unit)
|
||||
end
|
||||
|
||||
function Extension.OnLeaveElement()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("duf")
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
@@ -38,4 +37,4 @@ function Extension.OnLoad()
|
||||
Extension.Hook("DUF_Element_OnLeave", "OnLeaveElement")
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
--[[
|
||||
Author: SuperCleveRoidMacros
|
||||
License: MIT License
|
||||
|
||||
Dragonflight3 mouseover support.
|
||||
Attempts to hook into Dragonflight3's unit frames.
|
||||
The addon uses DF3 namespace and requires SuperWoW 1.5+ and UnitXP SP3.
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("Dragonflight3")
|
||||
Extension.RegisterEvent("PLAYER_ENTERING_WORLD", "DelayedInit")
|
||||
|
||||
local hookedFrames = {}
|
||||
|
||||
function Extension.HookFrame(frame, unit)
|
||||
if not frame or hookedFrames[frame] then return end
|
||||
|
||||
local onEnter = frame:GetScript("OnEnter")
|
||||
local onLeave = frame:GetScript("OnLeave")
|
||||
|
||||
frame:SetScript("OnEnter", function()
|
||||
local u = unit or this.unit
|
||||
if u then
|
||||
CleveRoids.SetMouseoverFrom("df3", u)
|
||||
end
|
||||
if onEnter then onEnter() end
|
||||
end)
|
||||
|
||||
frame:SetScript("OnLeave", function()
|
||||
CleveRoids.ClearMouseoverFrom("df3")
|
||||
if onLeave then onLeave() end
|
||||
end)
|
||||
|
||||
hookedFrames[frame] = true
|
||||
end
|
||||
|
||||
function Extension.HookAllFrames()
|
||||
-- Dragonflight3 uses DF3 or Dragonflight3 namespace
|
||||
local DF = DF3 or Dragonflight3
|
||||
if not DF then return end
|
||||
|
||||
-- Try to find unit frames
|
||||
local units = { "player", "target", "pet", "targettarget", "focus", "focustarget" }
|
||||
|
||||
for _, unit in ipairs(units) do
|
||||
-- Try common frame naming patterns
|
||||
local frame = DF[unit] or DF["UnitFrame_" .. unit] or _G["DF3_" .. unit] or _G["DF3UnitFrame" .. unit]
|
||||
if frame then
|
||||
Extension.HookFrame(frame, unit)
|
||||
end
|
||||
end
|
||||
|
||||
-- Try party frames
|
||||
for i = 1, 4 do
|
||||
local frame = DF["party" .. i] or _G["DF3_party" .. i] or _G["DF3PartyFrame" .. i]
|
||||
if frame then
|
||||
Extension.HookFrame(frame, "party" .. i)
|
||||
end
|
||||
end
|
||||
|
||||
-- Try raid frames
|
||||
for i = 1, 40 do
|
||||
local frame = DF["raid" .. i] or _G["DF3_raid" .. i] or _G["DF3RaidFrame" .. i]
|
||||
if frame then
|
||||
Extension.HookFrame(frame, "raid" .. i)
|
||||
end
|
||||
end
|
||||
|
||||
-- If DF has a frames table, iterate through it
|
||||
if DF.frames then
|
||||
for unit, frame in pairs(DF.frames) do
|
||||
Extension.HookFrame(frame, unit)
|
||||
end
|
||||
end
|
||||
|
||||
-- If DF has a UnitFrames table
|
||||
if DF.UnitFrames then
|
||||
for unit, frame in pairs(DF.UnitFrames) do
|
||||
Extension.HookFrame(frame, unit)
|
||||
end
|
||||
end
|
||||
|
||||
-- Try mods directory structure (Dragonflight3 uses /mods/)
|
||||
if DF.mods then
|
||||
for modName, mod in pairs(DF.mods) do
|
||||
if mod.frames then
|
||||
for unit, frame in pairs(mod.frames) do
|
||||
Extension.HookFrame(frame, unit)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.DelayedInit()
|
||||
local DF = DF3 or Dragonflight3
|
||||
if not DF then
|
||||
return
|
||||
end
|
||||
|
||||
Extension.HookAllFrames()
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
@@ -0,0 +1,95 @@
|
||||
--[[
|
||||
Author: SuperCleveRoidMacros
|
||||
License: MIT License
|
||||
|
||||
DragonflightReloaded mouseover support.
|
||||
Attempts to hook into DragonflightReloaded's unit frames.
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("DragonflightReloaded")
|
||||
Extension.RegisterEvent("PLAYER_ENTERING_WORLD", "DelayedInit")
|
||||
|
||||
local hookedFrames = {}
|
||||
|
||||
function Extension.HookFrame(frame, unit)
|
||||
if not frame or hookedFrames[frame] then return end
|
||||
|
||||
local onEnter = frame:GetScript("OnEnter")
|
||||
local onLeave = frame:GetScript("OnLeave")
|
||||
|
||||
frame:SetScript("OnEnter", function()
|
||||
local u = unit or this.unit
|
||||
if u then
|
||||
CleveRoids.SetMouseoverFrom("dfr", u)
|
||||
end
|
||||
if onEnter then onEnter() end
|
||||
end)
|
||||
|
||||
frame:SetScript("OnLeave", function()
|
||||
CleveRoids.ClearMouseoverFrom("dfr")
|
||||
if onLeave then onLeave() end
|
||||
end)
|
||||
|
||||
hookedFrames[frame] = true
|
||||
end
|
||||
|
||||
function Extension.HookAllFrames()
|
||||
-- DragonflightReloaded uses DFR namespace
|
||||
if not DFR then return end
|
||||
|
||||
-- Try to find unit frames in DFR namespace
|
||||
local units = { "player", "target", "pet", "targettarget", "focus", "focustarget" }
|
||||
|
||||
for _, unit in ipairs(units) do
|
||||
-- Try common frame naming patterns
|
||||
local frame = DFR[unit] or DFR["UnitFrame_" .. unit] or _G["DFR_" .. unit] or _G["DFRUnitFrame" .. unit]
|
||||
if frame then
|
||||
Extension.HookFrame(frame, unit)
|
||||
end
|
||||
end
|
||||
|
||||
-- Try party frames
|
||||
for i = 1, 4 do
|
||||
local frame = DFR["party" .. i] or _G["DFR_party" .. i] or _G["DFRPartyFrame" .. i]
|
||||
if frame then
|
||||
Extension.HookFrame(frame, "party" .. i)
|
||||
end
|
||||
end
|
||||
|
||||
-- Try raid frames
|
||||
for i = 1, 40 do
|
||||
local frame = DFR["raid" .. i] or _G["DFR_raid" .. i] or _G["DFRRaidFrame" .. i]
|
||||
if frame then
|
||||
Extension.HookFrame(frame, "raid" .. i)
|
||||
end
|
||||
end
|
||||
|
||||
-- If DFR has a frames table, iterate through it
|
||||
if DFR.frames then
|
||||
for unit, frame in pairs(DFR.frames) do
|
||||
Extension.HookFrame(frame, unit)
|
||||
end
|
||||
end
|
||||
|
||||
-- If DFR has a UnitFrames table
|
||||
if DFR.UnitFrames then
|
||||
for unit, frame in pairs(DFR.UnitFrames) do
|
||||
Extension.HookFrame(frame, unit)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.DelayedInit()
|
||||
if not DFR then
|
||||
return
|
||||
end
|
||||
|
||||
Extension.HookAllFrames()
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
@@ -4,7 +4,6 @@
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("FocusFrame")
|
||||
|
||||
@@ -13,14 +12,14 @@ function Extension.RegisterMouseoverForFrame(frame)
|
||||
local onleave = frame:GetScript("OnLeave")
|
||||
|
||||
frame:SetScript("OnEnter", function()
|
||||
CleveRoids.mouseoverUnit = "focus"
|
||||
CleveRoids.SetMouseoverFrom("focus", "focus")
|
||||
if onenter then
|
||||
onenter()
|
||||
end
|
||||
end)
|
||||
|
||||
frame:SetScript("OnLeave", function()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("focus")
|
||||
if onleave then
|
||||
onleave()
|
||||
end
|
||||
@@ -39,4 +38,4 @@ function Extension.OnLoad()
|
||||
Extension.RegisterMouseoverForFrame(FocusFrameManaBar)
|
||||
Extension.RegisterMouseoverForFrame(FocusFrameTextureFrame)
|
||||
Extension.RegisterMouseoverForFrame(FocusFrame)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,17 +6,16 @@ local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
|
||||
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("Grid")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
|
||||
function Extension.OnEnter(unit)
|
||||
CleveRoids.mouseoverUnit = unit
|
||||
CleveRoids.SetMouseoverFrom("grid", unit)
|
||||
end
|
||||
|
||||
function Extension.OnLeave()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("grid")
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
@@ -111,4 +110,4 @@ function CleveRoids:GrdCreateFrames()
|
||||
ClickCastFrames[self.frame] = true
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
--[[
|
||||
Author: SuperCleveRoidMacros
|
||||
License: MIT License
|
||||
|
||||
LunaUnitFrames mouseover support.
|
||||
LunaUnitFrames already has SuperWoW integration, but we hook to ensure
|
||||
our priority system works correctly with other addons.
|
||||
|
||||
Frame names: LUFUnit<unitName> for single units, LUFHeader<groupType> for groups
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("LunaUnitFrames")
|
||||
Extension.RegisterEvent("PLAYER_ENTERING_WORLD", "DelayedInit")
|
||||
|
||||
-- Track which frames we've hooked
|
||||
local hookedFrames = {}
|
||||
|
||||
function Extension.HookFrame(frame)
|
||||
if not frame or hookedFrames[frame] then return end
|
||||
|
||||
local onEnter = frame:GetScript("OnEnter")
|
||||
local onLeave = frame:GetScript("OnLeave")
|
||||
|
||||
frame:SetScript("OnEnter", function()
|
||||
if this.unit then
|
||||
CleveRoids.SetMouseoverFrom("luna", this.unit)
|
||||
end
|
||||
if onEnter then onEnter() end
|
||||
end)
|
||||
|
||||
frame:SetScript("OnLeave", function()
|
||||
CleveRoids.ClearMouseoverFrom("luna")
|
||||
if onLeave then onLeave() end
|
||||
end)
|
||||
|
||||
hookedFrames[frame] = true
|
||||
end
|
||||
|
||||
function Extension.HookAllFrames()
|
||||
-- Hook single unit frames
|
||||
local singleUnits = { "player", "target", "pet", "pettarget", "targettarget", "targettargettarget", "focus", "focustarget" }
|
||||
for _, unit in ipairs(singleUnits) do
|
||||
local frame = _G["LUFUnit" .. unit]
|
||||
if frame then
|
||||
Extension.HookFrame(frame)
|
||||
end
|
||||
end
|
||||
|
||||
-- Hook party frames (LUFHeaderparty children)
|
||||
local partyHeader = _G["LUFHeaderparty"]
|
||||
if partyHeader then
|
||||
for i = 1, 4 do
|
||||
local frame = _G["LUFHeaderparty" .. i] or (partyHeader["unit" .. i])
|
||||
if frame then
|
||||
Extension.HookFrame(frame)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Hook party target frames
|
||||
local partyTargetHeader = _G["LUFHeaderpartytarget"]
|
||||
if partyTargetHeader then
|
||||
for i = 1, 4 do
|
||||
local frame = _G["LUFHeaderpartytarget" .. i]
|
||||
if frame then
|
||||
Extension.HookFrame(frame)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Hook party pet frames
|
||||
local partyPetHeader = _G["LUFHeaderpartypet"]
|
||||
if partyPetHeader then
|
||||
for i = 1, 4 do
|
||||
local frame = _G["LUFHeaderpartypet" .. i]
|
||||
if frame then
|
||||
Extension.HookFrame(frame)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Hook raid frames (LUFHeaderraid1 through LUFHeaderraid9)
|
||||
for raidGroup = 1, 9 do
|
||||
local raidHeader = _G["LUFHeaderraid" .. raidGroup]
|
||||
if raidHeader then
|
||||
for i = 1, 40 do
|
||||
local frame = _G["LUFHeaderraid" .. raidGroup .. "UnitButton" .. i]
|
||||
if frame then
|
||||
Extension.HookFrame(frame)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.DelayedInit()
|
||||
-- Check if LunaUF is loaded
|
||||
if not LunaUF then
|
||||
return
|
||||
end
|
||||
|
||||
-- Initial hook attempt
|
||||
Extension.HookAllFrames()
|
||||
|
||||
-- Re-hook when units are loaded/reloaded
|
||||
if LunaUF.Units and LunaUF.Units.InitializeFrame then
|
||||
local origInit = LunaUF.Units.InitializeFrame
|
||||
LunaUF.Units.InitializeFrame = function(self, ...)
|
||||
local result = origInit(self, ...)
|
||||
-- Delay slightly to let frame be fully created
|
||||
Extension.HookAllFrames()
|
||||
return result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
-- Nothing needed here, we use DelayedInit
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
@@ -6,17 +6,16 @@ local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
|
||||
local CreateFrames = nil
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("NotGrid")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
|
||||
function Extension.OnEnter()
|
||||
CleveRoids.mouseoverUnit = this.unit
|
||||
CleveRoids.SetMouseoverFrom("ngrid", this.unit)
|
||||
end
|
||||
|
||||
function Extension.OnLeave()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("ngrid")
|
||||
end
|
||||
|
||||
function CleveRoids:NotGrid_CreateFrames()
|
||||
|
||||
@@ -6,17 +6,16 @@ local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
|
||||
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("PerfectRaid")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
|
||||
function Extension.OnEnter(unit)
|
||||
CleveRoids.mouseoverUnit = unit
|
||||
CleveRoids.SetMouseoverFrom("praid", unit)
|
||||
end
|
||||
|
||||
function Extension.OnLeave()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("praid")
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
@@ -134,4 +133,4 @@ function CleveRoids.PerfectRaidCreateFrame(self, num)
|
||||
--]]
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--[[
|
||||
Author: SuperCleveRoidMacros
|
||||
License: MIT License
|
||||
|
||||
X-Perl UnitFrames mouseover support.
|
||||
Hooks into X-Perl's tooltip functions to track mouseover unit.
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("XPerl")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
|
||||
-- X-Perl uses XPerl_PlayerTip(unitid) for OnEnter and XPerl_PlayerTipHide() for OnLeave
|
||||
-- We hook these functions to track mouseover
|
||||
|
||||
function Extension.OnEnter(unitid)
|
||||
if unitid and unitid ~= "" then
|
||||
CleveRoids.SetMouseoverFrom("xperl", unitid)
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.OnLeave()
|
||||
CleveRoids.ClearMouseoverFrom("xperl")
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
-- Check if X-Perl is loaded by looking for its global functions
|
||||
if not XPerl_PlayerTip then
|
||||
return
|
||||
end
|
||||
|
||||
-- Hook the tooltip show function
|
||||
Extension.Hook("XPerl_PlayerTip", "OnEnter")
|
||||
|
||||
-- Hook the tooltip hide function
|
||||
Extension.Hook("XPerl_PlayerTipHide", "OnLeave")
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
@@ -2,17 +2,16 @@ local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
|
||||
CleveRoids.Hooks = CleveRoids.Hooks or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("ag_UnitFrames")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
|
||||
function Extension.OnEnter(unit)
|
||||
CleveRoids.mouseoverUnit = unit
|
||||
CleveRoids.SetMouseoverFrom("aguf", unit)
|
||||
end
|
||||
|
||||
function Extension.OnLeave()
|
||||
CleveRoids.mouseoverUnit = nil
|
||||
CleveRoids.ClearMouseoverFrom("aguf")
|
||||
end
|
||||
|
||||
-- Because AddOns are loaded in alphabetical order, this callback will never see the aUF loaded message, had to do a workaround...
|
||||
|
||||
@@ -4,13 +4,16 @@
|
||||
]]
|
||||
local _G = _G or getfenv(0)
|
||||
local CleveRoids = _G.CleveRoids or {}
|
||||
CleveRoids.mouseoverUnit = CleveRoids.mouseoverUnit or nil
|
||||
|
||||
local Extension = CleveRoids.RegisterExtension("sRaidFrames")
|
||||
Extension.RegisterEvent("ADDON_LOADED", "OnLoad")
|
||||
|
||||
function Extension:OnEnter(frame)
|
||||
CleveRoids.mouseoverUnit = frame.unit
|
||||
CleveRoids.SetMouseoverFrom("sraid", frame.unit)
|
||||
end
|
||||
|
||||
function Extension.OnLeave()
|
||||
CleveRoids.ClearMouseoverFrom("sraid")
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
@@ -19,6 +22,8 @@ function Extension.OnLoad()
|
||||
end
|
||||
|
||||
Extension.HookMethod(sRaidFrames, "UnitTooltip", "OnEnter")
|
||||
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnLeave")
|
||||
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnLeave")
|
||||
end
|
||||
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
_G["CleveRoids"] = CleveRoids
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Title: [Super]CleveRoidMacros
|
||||
## Notes: /cleveroid for settings
|
||||
## Version: 1.8
|
||||
## OptionalDeps: ClassicFocus, FocusFrame, pfUI, SuperMacro, Bongos_ActionBar, Cursive
|
||||
## OptionalDeps: ClassicFocus, FocusFrame, pfUI, SuperMacro, Bongos_ActionBar, Cursive, XPerl, LunaUnitFrames, DragonflightReloaded, -Dragonflight3
|
||||
## SavedVariables: CleveRoidMacros, CleveRoids_LearnedDurations, CleveRoids_AuraTextures, CleveRoids_ImmunityData, CleveRoids_ComboDurations, CleveRoids_SpellSchools
|
||||
Localization.lua
|
||||
Init.lua
|
||||
@@ -32,6 +32,10 @@ Extensions\Mouseover\PerfectRaid.lua
|
||||
Extensions\Mouseover\pfUI.lua
|
||||
Extensions\Mouseover\sRaidFrames.lua
|
||||
Extensions\Mouseover\ag_UnitFrames.lua
|
||||
Extensions\Mouseover\XPerl.lua
|
||||
Extensions\Mouseover\LunaUnitFrames.lua
|
||||
Extensions\Mouseover\DragonflightReloaded.lua
|
||||
Extensions\Mouseover\Dragonflight3.lua
|
||||
|
||||
Extensions\Tooltip\Generic.lua
|
||||
Extensions\CursiveCustomSpells.lua
|
||||
|
||||
+31
-1
@@ -245,18 +245,48 @@ do
|
||||
|
||||
CleveRoids.__mo = CleveRoids.__mo or { sources = {}, current = nil }
|
||||
|
||||
-- Priority levels for mouseover sources (higher = takes precedence)
|
||||
-- All unit frame addons get priority 3, native event gets 2, tooltip fallback gets 1
|
||||
local PRIORITY = {
|
||||
-- Unit frame addons (priority 3)
|
||||
pfui = 3,
|
||||
blizz = 3,
|
||||
aguf = 3, -- ag_UnitFrames
|
||||
ctra = 3, -- CT_RaidAssist
|
||||
ctuf = 3, -- CT_UnitFrames
|
||||
duf = 3, -- DiscordUnitFrames
|
||||
focus = 3, -- FocusFrame
|
||||
grid = 3, -- Grid
|
||||
ngrid = 3, -- NotGrid
|
||||
praid = 3, -- PerfectRaid
|
||||
sraid = 3, -- sRaidFrames
|
||||
xperl = 3, -- X-Perl UnitFrames
|
||||
luna = 3, -- LunaUnitFrames
|
||||
dfr = 3, -- DragonflightReloaded
|
||||
df3 = 3, -- Dragonflight3
|
||||
-- Fallbacks (lower priority)
|
||||
native = 2,
|
||||
tooltip = 1,
|
||||
}
|
||||
|
||||
-- Get priority for a source, handling prefixed keys like "pfui:player"
|
||||
local function getPriority(source)
|
||||
if PRIORITY[source] then
|
||||
return PRIORITY[source]
|
||||
end
|
||||
-- Check for prefixed sources (e.g., "pfui:player" -> "pfui")
|
||||
local prefix = string.match(source, "^(%w+):")
|
||||
if prefix and PRIORITY[prefix] then
|
||||
return PRIORITY[prefix]
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
local function getBest()
|
||||
local bestSource, bestUnit, bestP = nil, nil, -1
|
||||
for source, unit in CleveRoids.__mo.sources do
|
||||
if unit and unit ~= "" then
|
||||
local p = PRIORITY[source] or 0
|
||||
local p = getPriority(source)
|
||||
if p > bestP then
|
||||
bestP, bestSource, bestUnit = p, source, unit
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user