@@ -24,90 +24,87 @@ local UIHider = CreateFrame("Frame")
2424UIHider :Hide ()
2525
2626
27- local function disableFrame (frame , leaveEvents )
27+ local function disableBarFrame (frame )
2828 if frame then
29- if not leaveEvents then
30- frame :UnregisterAllEvents ()
31- end
32-
29+ frame :UnregisterAllEvents ()
3330 frame :SetParent (UIHider )
3431 frame :Hide ()
3532 end
3633end
3734
35+ local function disableButtonFrame (frame )
36+ if frame then
37+ frame :UnregisterAllEvents ()
38+ frame :SetAttribute (" statehidden" , true )
39+ frame :Hide ()
40+ end
41+ end
42+
3843local function disableFrameSlidingAnimation (frame )
3944 if frame then
4045 local animation = {frame .slideOut :GetAnimations ()}
4146 animation [1 ]:SetOffset (0 ,0 )
4247 end
4348end
4449
45- --- Some of this code logic is adapted from Bartender4 and Dominos and credit should go to those authors.
46- --- The Bartender4 and Dominos logic was slimmed down and modified to fit Neuron.
47- --- Thanks guys! Beer's on us.
4850function Neuron :HideBlizzardUI ()
51+ ---- ------------------------
52+ ---- - Disable Buttons ------
53+ ---- ------------------------
4954 -- Hide and disable the individual buttons on most of our bars
5055 for i = 1 ,12 do
51- _G [" ActionButton" .. i ]:Hide ()
52- _G [" ActionButton" .. i ]:UnregisterAllEvents ()
53- _G [" ActionButton" .. i ]:SetAttribute (" statehidden" , true )
54-
55- _G [" MultiBarBottomLeftButton" .. i ]:Hide ()
56- _G [" MultiBarBottomLeftButton" .. i ]:UnregisterAllEvents ()
57- _G [" MultiBarBottomLeftButton" .. i ]:SetAttribute (" statehidden" , true )
58-
59- _G [" MultiBarBottomRightButton" .. i ]:Hide ()
60- _G [" MultiBarBottomRightButton" .. i ]:UnregisterAllEvents ()
61- _G [" MultiBarBottomRightButton" .. i ]:SetAttribute (" statehidden" , true )
62-
63- _G [" MultiBarRightButton" .. i ]:Hide ()
64- _G [" MultiBarRightButton" .. i ]:UnregisterAllEvents ()
65- _G [" MultiBarRightButton" .. i ]:SetAttribute (" statehidden" , true )
66-
67- _G [" MultiBarLeftButton" .. i ]:Hide ()
68- _G [" MultiBarLeftButton" .. i ]:UnregisterAllEvents ()
69- _G [" MultiBarLeftButton" .. i ]:SetAttribute (" statehidden" , true )
56+ disableButtonFrame (_G [" ActionButton" .. i ])
57+ disableButtonFrame (_G [" MultiBarBottomLeftButton" .. i ])
58+ disableButtonFrame (_G [" MultiBarBottomRightButton" .. i ])
59+ disableButtonFrame (_G [" MultiBarRightButton" .. i ])
60+ disableButtonFrame (_G [" MultiBarLeftButton" .. i ])
7061 end
7162
72- if OverrideActionBar then
73- for i = 1 ,6 do
74- _G [" OverrideActionBarButton" .. i ]:Hide ()
75- _G [" OverrideActionBarButton" .. i ]:UnregisterAllEvents ()
76- _G [" OverrideActionBarButton" .. i ]:SetAttribute (" statehidden" , true )
77- end
63+ for i = 1 ,6 do
64+ disableButtonFrame (_G [" OverrideActionBarButton" .. i ])
7865 end
7966
67+ disableButtonFrame (_G [" ExtraActionButton1" ])
68+
69+ ---- ------------------------
70+ ---- --- Disable Bars -------
71+ ---- ------------------------
8072 -- disable main blizzard bar and graphics
81- disableFrame (MainMenuBar )
82- disableFrame (MainMenuBarArtFrame )
83- disableFrame (MainMenuBarArtFrameBackground )
73+ disableBarFrame (MainMenuBar )
74+ disableBarFrame (MainMenuBarArtFrame )
75+ disableBarFrame (MainMenuBarArtFrameBackground )
76+ disableFrameSlidingAnimation (MainMenuBar )
8477
8578 -- disable bottom bonus bars
86- disableFrame (MultiBarBottomLeft )
87- disableFrame (MultiBarBottomRight )
79+ disableBarFrame (MultiBarBottomLeft )
80+ disableBarFrame (MultiBarBottomRight )
8881
89- -- disable right- side bonus bars
90- disableFrame (MultiBarLeft )
91- disableFrame (MultiBarRight )
82+ -- disable side bonus bars
83+ disableBarFrame (MultiBarLeft )
84+ disableBarFrame (MultiBarRight )
9285
9386 -- disable all other action bars
94- disableFrame (MicroButtonAndBagsBar )
95- disableFrame (StanceBarFrame )
96- disableFrame (PossessBarFrame )
97- disableFrame (MultiCastActionBarFrame )
98- disableFrame (PetActionBarFrame )
99- disableFrame (ZoneAbilityFrame )
100- disableFrame (ExtraActionBarFrame )
101- disableFrame (MainMenuBarVehicleLeaveButton )
87+ disableBarFrame (MicroButtonAndBagsBar )
88+ disableBarFrame (StanceBarFrame )
89+ disableBarFrame (PossessBarFrame )
90+ disableBarFrame (MultiCastActionBarFrame )
91+ disableBarFrame (PetActionBarFrame )
92+ disableBarFrame (ZoneAbilityFrame )
93+ disableBarFrame (ExtraActionBarFrame )
94+ disableBarFrame (MainMenuBarVehicleLeaveButton )
10295
10396 -- disable status bars
104- disableFrame (MainMenuExpBar )
105- disableFrame (ReputationWatchBar )
106- disableFrame (MainMenuBarMaxLevelBar )
97+ disableBarFrame (MainMenuExpBar )
98+ disableBarFrame (ReputationWatchBar )
99+ disableBarFrame (MainMenuBarMaxLevelBar )
107100
108- disableFrameSlidingAnimation (MainMenuBar )
101+ -- disable override action bars
102+ disableBarFrame (OverrideActionBar )
109103 disableFrameSlidingAnimation (OverrideActionBar )
110104
105+ ---- ------------------------
106+ ---- --- Disable Misc -------
107+ ---- ------------------------
111108 -- disable the ActionBarController to avoid potential for taint
112109 ActionBarController :UnregisterAllEvents ()
113110
@@ -117,6 +114,9 @@ function Neuron:HideBlizzardUI()
117114 StatusTrackingBarManager :UnregisterAllEvents ()
118115 end
119116
117+ ---- ------------------------
118+ ---- - Disable Tutorial -----
119+ ---- ------------------------
120120 -- it's important we shut down the tutorial or we will get a ton of errors
121121 -- this cleanly shuts down the tutorial and returns visibility to all UI elements hidden
122122 if Tutorials then -- the Tutorials table is only available during the tutorial scenario, ignore if otherwise
@@ -185,18 +185,14 @@ function Neuron:Overrides()
185185 end
186186
187187 if disableDefaultCast then
188- CastingBarFrame :UnregisterAllEvents ()
189- CastingBarFrame :SetParent (Neuron .hiddenFrame )
188+ disableBarFrame (CastingBarFrame )
190189 end
191190
192191 if disableDefaultMirror then
193192 UIParent :UnregisterEvent (" MIRROR_TIMER_START" )
194- MirrorTimer1 :UnregisterAllEvents ()
195- MirrorTimer1 :SetParent (Neuron .hiddenFrame )
196- MirrorTimer2 :UnregisterAllEvents ()
197- MirrorTimer2 :SetParent (Neuron .hiddenFrame )
198- MirrorTimer3 :UnregisterAllEvents ()
199- MirrorTimer3 :SetParent (Neuron .hiddenFrame )
193+ disableBarFrame (MirrorTimer1 )
194+ disableBarFrame (MirrorTimer2 )
195+ disableBarFrame (MirrorTimer3 )
200196 end
201197
202198end
0 commit comments