forked from enderneko/Cell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHideBlizzard.lua
91 lines (75 loc) · 2.33 KB
/
HideBlizzard.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
local _, Cell = ...
local F = Cell.funcs
-- stolen from elvui
local hiddenParent = CreateFrame("Frame", nil, _G.UIParent)
hiddenParent:SetAllPoints()
hiddenParent:Hide()
local function HideFrame(frame)
if not frame then return end
frame:UnregisterAllEvents()
frame:Hide()
frame:SetParent(hiddenParent)
local health = frame.healthBar or frame.healthbar
if health then
health:UnregisterAllEvents()
end
local power = frame.manabar
if power then
power:UnregisterAllEvents()
end
local spell = frame.castBar or frame.spellbar
if spell then
spell:UnregisterAllEvents()
end
local altpowerbar = frame.powerBarAlt
if altpowerbar then
altpowerbar:UnregisterAllEvents()
end
local buffFrame = frame.BuffFrame
if buffFrame then
buffFrame:UnregisterAllEvents()
end
local petFrame = frame.PetFrame
if petFrame then
petFrame:UnregisterAllEvents()
end
end
function F:HideBlizzardParty()
_G.UIParent:UnregisterEvent("GROUP_ROSTER_UPDATE")
if _G.CompactPartyFrame then
_G.CompactPartyFrame:UnregisterAllEvents()
end
if _G.PartyFrame then
_G.PartyFrame:UnregisterAllEvents()
_G.PartyFrame:SetScript('OnShow', nil)
for frame in _G.PartyFrame.PartyMemberFramePool:EnumerateActive() do
HideFrame(frame)
end
HideFrame(_G.PartyFrame)
else
for i = 1, 4 do
HideFrame(_G["PartyMemberFrame"..i])
HideFrame(_G["CompactPartyMemberFrame"..i])
end
HideFrame(_G.PartyMemberBackground)
end
end
function F:HideBlizzardRaid()
_G.UIParent:UnregisterEvent("GROUP_ROSTER_UPDATE")
if _G.CompactRaidFrameContainer then
_G.CompactRaidFrameContainer:UnregisterAllEvents()
hooksecurefunc(_G.CompactRaidFrameContainer, "Show", _G.CompactRaidFrameContainer.Hide)
hooksecurefunc(_G.CompactRaidFrameContainer, "SetShown", function(frame, shown)
if shown then
frame:Hide()
end
end)
end
if CompactRaidFrameManager_SetSetting then
CompactRaidFrameManager_SetSetting("IsShown", "0")
end
if _G.CompactRaidFrameManager then
_G.CompactRaidFrameManager:UnregisterAllEvents()
_G.CompactRaidFrameManager:SetParent(hiddenParent)
end
end