I'm having problems with the raid aswell.
Using stuff like...
lua Code:
for _, v in pairs({
CompactUnitFrame_UpdateVisible, CompactUnitFrame_UpdateAll,
}) do
v = function() return end
end
for _, v in pairs({
_G["CompactRaidFrameContainer"],
_G["CompactRaidFrameManagerContainerResizeFrame"],
}) do
v:UnregisterAllEvents()
v.Show = function() return end
v:Hide()
end
is just bad gives you a taint in combat right away if your raid gets changed infight.
The thing is...I like the CombatRaidFrameManger and I want to keep it.
Using this will make the manager fade in on mouseover.
lua Code:
--add fading to the raidframe manager (code by Alza)
local listener = CreateFrame("Frame")
listener.check = function(self, event, addon)
if(addon~="Blizzard_CompactRaidFrames") then return end
CompactRaidFrameManagerToggleButton:EnableMouse(false)
local man = CompactRaidFrameManager
man:SetAlpha(0)
man.container:SetParent(UIParent)
man:SetScript("OnMouseUp", CompactRaidFrameManager_Toggle)
man:SetScript("OnEnter", function(self)
if(self.collapsed) then
UIFrameFadeIn(man, .2, 0, 1)
end
end)
man:SetScript("OnLeave", function(self)
if(self.collapsed) then
UIFrameFadeOut(man, .2, 1, 0)
end
end)
self:UnregisterEvent(event)
self:SetScript("OnEvent", nil)
end
if(IsAddOnLoaded("Blizzard_CompactRaidFrames")) then
listener.check(listener, "ADDON_LOADED", "Blizzard_CompactRaidFrames")
else
listener:RegisterEvent("ADDON_LOADED")
listener:SetScript("OnEvent", listener.check)
end
Currently the best idea I'm having is to resize the CompactRaidFrame to a tiny little thing and to hide it once we get out of combat.
Basically Hide it by default. Secure hook the Show and if that is called we try to hide it and if we are in combat we just add register the REGEN_ENABLED event and disable the frame once we get out of combat again.
That is the only secure method I can think of.
I'm currently testing this
lua Code:
--check the default raid and make it fade
local checkRaid = CreateFrame("Frame")
local killRaid = function(self)
self:Hide()
self:UnregisterAllEvents()
end
local hideRaid = function(self)
if not InCombatLockdown() then
killRaid(self)
print("crfc show got called, hide it again")--debug
else
print("crfc show got called but cannot hide raid atm, in combat")--debug
checkRaid:RegisterEvent("PLAYER_REGEN_ENABLED")
end
end
checkRaid:RegisterEvent("PLAYER_LOGIN")
checkRaid:SetScript("OnEvent", function(self,event,...)
local crfc = _G["CompactRaidFrameContainer"]
if event == "PLAYER_LOGIN" then
if crfc then
crfc:SetScale(0.0001)
crfc:SetAlpha(0)
killRaid(crfc)
hooksecurefunc(crfc, "Show", hideRaid)
end
end
if event == "PLAYER_REGEN_ENABLED" then
if crfc and crfc:IsShown() then
killRaid(crfc)
self:UnregisterEvent("PLAYER_REGEN_ENABLED") --kill the event again
print("ooc now, hide raid")--debug
end
end
end)
*Edit*
It worked on first try (check chat outputs):
Works in combat aswell. No taint. A big plus is the raid manager which I actually like.
Test:
Code:
/run print(_G["CompactRaidFrameContainer"]:IsShown())
Not sure if I can actually call self:Hide() in the hooksecurefunc while being in combat without tainting.