-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
HideBlizzardClassic.lua
159 lines (130 loc) · 5.23 KB
/
HideBlizzardClassic.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
--[[
Copyright (c) 2009-2022, Hendrik "Nevcairiel" Leppkes < h.leppkes at gmail dot com >
All rights reserved.
]]
local _, Bartender4 = ...
-- WoW 10.0 uses new code
if select(4, GetBuildInfo()) >= 100000 then
return
end
local WoWClassic = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)
local function hideActionBarFrame(frame, clearEvents, reanchor, noAnchorChanges)
if frame then
if clearEvents then
frame:UnregisterAllEvents()
end
frame:Hide()
frame:SetParent(Bartender4.UIHider)
-- setup faux anchors so the frame position data returns valid
if reanchor and not noAnchorChanges then
local left, right, top, bottom = frame:GetLeft(), frame:GetRight(), frame:GetTop(), frame:GetBottom()
frame:ClearAllPoints()
if left and right and top and bottom then
frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", left, top)
frame:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMLEFT", right, bottom)
else
frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", 10, 10)
frame:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMLEFT", 20, 20)
end
elseif not noAnchorChanges then
frame:ClearAllPoints()
end
end
end
function Bartender4:HideBlizzard()
-- Hidden parent frame
local UIHider = CreateFrame("Frame")
UIHider:Hide()
self.UIHider = UIHider
MultiBarBottomLeft:SetParent(UIHider)
MultiBarBottomRight:SetParent(UIHider)
MultiBarLeft:SetParent(UIHider)
MultiBarRight:SetParent(UIHider)
-- Hide MultiBar Buttons, but keep the bars alive
for i=1,12 do
_G["ActionButton" .. i]:Hide()
_G["ActionButton" .. i]:UnregisterAllEvents()
_G["ActionButton" .. i]:SetAttribute("statehidden", true)
_G["MultiBarBottomLeftButton" .. i]:Hide()
_G["MultiBarBottomLeftButton" .. i]:UnregisterAllEvents()
_G["MultiBarBottomLeftButton" .. i]:SetAttribute("statehidden", true)
_G["MultiBarBottomRightButton" .. i]:Hide()
_G["MultiBarBottomRightButton" .. i]:UnregisterAllEvents()
_G["MultiBarBottomRightButton" .. i]:SetAttribute("statehidden", true)
_G["MultiBarRightButton" .. i]:Hide()
_G["MultiBarRightButton" .. i]:UnregisterAllEvents()
_G["MultiBarRightButton" .. i]:SetAttribute("statehidden", true)
_G["MultiBarLeftButton" .. i]:Hide()
_G["MultiBarLeftButton" .. i]:UnregisterAllEvents()
_G["MultiBarLeftButton" .. i]:SetAttribute("statehidden", true)
end
UIPARENT_MANAGED_FRAME_POSITIONS["MainMenuBar"] = nil
UIPARENT_MANAGED_FRAME_POSITIONS["StanceBarFrame"] = nil
UIPARENT_MANAGED_FRAME_POSITIONS["PossessBarFrame"] = nil
UIPARENT_MANAGED_FRAME_POSITIONS["MultiCastActionBarFrame"] = nil
UIPARENT_MANAGED_FRAME_POSITIONS["PETACTIONBAR_YPOS"] = nil
UIPARENT_MANAGED_FRAME_POSITIONS["ExtraAbilityContainer"] = nil
--MainMenuBar:UnregisterAllEvents()
--MainMenuBar:SetParent(UIHider)
--MainMenuBar:Hide()
MainMenuBar:EnableMouse(false)
MainMenuBar:UnregisterEvent("DISPLAY_SIZE_CHANGED")
MainMenuBar:UnregisterEvent("UI_SCALE_CHANGED")
local animations = {MainMenuBar.slideOut:GetAnimations()}
animations[1]:SetOffset(0,0)
if OverrideActionBar then -- classic doesn't have this
animations = {OverrideActionBar.slideOut:GetAnimations()}
animations[1]:SetOffset(0,0)
-- when blizzard vehicle is turned off, we need to manually fix the state since the OverrideActionBar animation wont run
hooksecurefunc("BeginActionBarTransition", function(bar, animIn)
if bar == OverrideActionBar and not self.db.profile.blizzardVehicle then
OverrideActionBar.slideOut:Stop()
MainMenuBar:Show()
end
end)
end
hideActionBarFrame(MainMenuBarArtFrame, false, true)
hideActionBarFrame(MainMenuBarArtFrameBackground)
hideActionBarFrame(MicroButtonAndBagsBar, false, false, true)
if KeyRingButton then
hideActionBarFrame(KeyRingButton, false, false)
end
if StatusTrackingBarManager then
StatusTrackingBarManager:Hide()
--StatusTrackingBarManager:SetParent(UIHider)
end
hideActionBarFrame(StanceBarFrame, true, true)
hideActionBarFrame(PossessBarFrame, false, true)
hideActionBarFrame(MultiCastActionBarFrame, false, true)
hideActionBarFrame(PetActionBarFrame, true, true)
ShowPetActionBar = function() end
--BonusActionBarFrame:UnregisterAllEvents()
--BonusActionBarFrame:Hide()
--BonusActionBarFrame:SetParent(UIHider)
if not WoWClassic then
if PlayerTalentFrame then
PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
else
hooksecurefunc("TalentFrame_LoadUI", function() PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") end)
end
end
hideActionBarFrame(MainMenuBarPerformanceBarFrame, false, false, true)
hideActionBarFrame(MainMenuExpBar, false, false, true)
hideActionBarFrame(ReputationWatchBar, false, false, true)
hideActionBarFrame(MainMenuBarMaxLevelBar, false, false, true)
if C_AddOns.IsAddOnLoaded("Blizzard_NewPlayerExperience") then
self:NPE_LoadUI()
elseif NPE_LoadUI ~= nil then
self:SecureHook("NPE_LoadUI")
end
end
function Bartender4:NPE_LoadUI()
if not (Tutorials and Tutorials.AddSpellToActionBar) then return end
-- Action Bar drag tutorials
Tutorials.AddSpellToActionBar:Disable()
Tutorials.AddClassSpellToActionBar:Disable()
-- these tutorials rely on finding valid action bar buttons, and error otherwise
Tutorials.Intro_CombatTactics:Disable()
-- enable spell pushing because the drag tutorial is turned off
Tutorials.AutoPushSpellWatcher:Complete()
end