forked from brittyazel/Neuron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNeuron-DisableBlizzardUI.lua
More file actions
129 lines (97 loc) · 3.57 KB
/
Copy pathNeuron-DisableBlizzardUI.lua
File metadata and controls
129 lines (97 loc) · 3.57 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
--Neuron, a World of Warcraft® user interface addon.
--This file is part of Neuron.
--
--Neuron is free software: you can redistribute it and/or modify
--it under the terms of the GNU General Public License as published by
--the Free Software Foundation, either version 3 of the License, or
--(at your option) any later version.
--
--Neuron is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU General Public License for more details.
--
--You should have received a copy of the GNU General Public License
--along with Foobar. If not, see <https://www.gnu.org/licenses/>.
--
--Copyright for portions of Neuron are held by Connor Chenoweth,
--a.k.a Maul, 2014 as part of his original project, Ion. All other
--copyrights for Neuron are held by Britt Yazel, 2017-2018.
local hiddenFrame = CreateFrame('Frame', nil, UIParent, 'SecureFrameTemplate');
Neuron.hiddenFrame = hiddenFrame
hiddenFrame:Hide()
local function disableFrame(frame, unregisterEvents)
if not frame then
Neuron:Print('Unknown Frame', frame:GetName())
return
end
frame:SetParent(hiddenFrame)
if unregisterEvents then
frame:UnregisterAllEvents()
end
end
local function disableFrameSlidingAnimation(frame)
if not frame then
Neuron:Print('Unknown Frame', frame:GetName())
return
end
local animation = (frame.slideOut:GetAnimations())
animation:SetOffset(0, 0)
end
function Neuron:HideBlizzardUI()
---the idea for this code is inspired from Dominos. Thanks Tuller!
disableFrame(MainMenuBar, true)
-- disable override bar transition animations
disableFrameSlidingAnimation(MainMenuBar)
disableFrameSlidingAnimation(OverrideActionBar)
disableFrame(MultiBarBottomLeft, true)
disableFrame(MultiBarBottomRight, true)
disableFrame(MultiBarLeft, true)
disableFrame(MultiBarRight, true)
disableFrame(MainMenuBarArtFrame, true)
disableFrame(StanceBarFrame, true)
disableFrame(PossessBarFrame, true)
disableFrame(PetActionBarFrame, true)
disableFrame(MultiCastActionBarFrame, true)
disableFrame(ExtraActionBarFrame, true)
disableFrame(ZoneAbilityFrame, true)
disableFrame(MainMenuBarVehicleLeaveButton, true)
disableFrame(MicroButtonAndBagsBar, true)
disableFrame(MainMenuBarPerformanceBar)
StatusTrackingBarManager:UnregisterAllEvents()
ActionBarController:UnregisterAllEvents()
StatusTrackingBarManager:UnregisterAllEvents()
--this is the equivalent of dropping a sledgehammer on the taint issue. It protects from taint and saves CPU cycles though so....
if (not Neuron:IsHooked('ActionButton_OnEvent')) then
Neuron:RawHook('ActionButton_OnEvent', function() end, true)
end
if (not Neuron:IsHooked('ActionButton_Update')) then
Neuron:RawHook('ActionButton_Update', function() end, true)
end
if (not Neuron:IsHooked('MultiActionBar_Update')) then
Neuron:RawHook('MultiActionBar_Update', function() end, true)
end
if (not Neuron:IsHooked('OverrideActionBar_UpdateSkin')) then
Neuron:RawHook('OverrideActionBar_UpdateSkin', function() end, true)
end
if (not Neuron:IsHooked('ActionButton_HideGrid')) then
Neuron:RawHook('ActionButton_HideGrid', function() end, true)
end
if (not Neuron:IsHooked('ActionButton_ShowGrid')) then
Neuron:RawHook('ActionButton_ShowGrid', function() end, true)
end
end
function Neuron:ToggleBlizzUI()
local DB = Neuron.db.profile
if (InCombatLockdown()) then
return
end
if (DB.blizzbar == true) then
DB.blizzbar = false
Neuron:HideBlizzardUI()
StaticPopup_Show("ReloadUI")
else
DB.blizzbar = true
StaticPopup_Show("ReloadUI")
end
end