7a3d474 - Add priest file to TOC
[wowui.git] / OmaAB / HideBlizzard.lua
1 -- HideBlizzardAB.lua
2 -- based on Bartender4
3 local function hide()
4     -- Hidden parent frame
5     local UIHider = CreateFrame("Frame");
6     UIHider:Hide();
7
8     local barHolder = CreateFrame("Frame", "OmaStatusBarHolder", UIParent);
9     barHolder:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, 17);
10     barHolder:SetWidth(800);
11     barHolder:SetHeight(20);
12     function barHolder:OnStatusBarsUpdated() end;
13     local xpbars = _G["StatusTrackingBarManager"];
14     xpbars:UnregisterAllEvents();
15     xpbars:Hide();
16     --xpbars:SetParent(barHolder);
17
18     UpdateMicroButtonsParent(barHolder);
19     MoveMicroButtons("TOP", UIParent, "TOP", -120, 0);
20     MainMenuBar:HookScript("OnShow", function()
21         UpdateMicroButtonsParent(barHolder);
22         MoveMicroButtons("TOP", UIParent, "TOP", -120, 0);
23     end);
24
25     local bags = CreateFrame("Frame", "OmaBags", UIParent);
26     bags:SetPoint("RIGHT", UIParent, "RIGHT", 0, -100);
27     bags:SetWidth(1);
28     bags:SetHeight(1);
29     bags:Hide(); -- Unhide if bag bar needed
30     MainMenuBarBackpackButton:SetParent(bags);
31     MainMenuBarBackpackButton:ClearAllPoints();
32     MainMenuBarBackpackButton:SetPoint("RIGHT");
33     CharacterBag0Slot:SetParent(bags);
34     CharacterBag1Slot:SetParent(bags);
35     CharacterBag2Slot:SetParent(bags);
36     CharacterBag3Slot:SetParent(bags);
37     MicroButtonAndBagsBar:Hide();
38
39     MultiBarBottomLeft:SetParent(UIHider);
40     MultiBarBottomRight:SetParent(UIHider);
41     MultiBarLeft:SetParent(UIHider);
42     MultiBarRight:SetParent(UIHider);
43     -- Hide MultiBar Buttons, but keep the bars alive
44     for i=1,12 do
45         _G["ActionButton" .. i]:Hide();
46         _G["ActionButton" .. i]:UnregisterAllEvents();
47         _G["ActionButton" .. i]:SetAttribute("statehidden", true);
48
49         _G["MultiBarBottomLeftButton" .. i]:Hide();
50         _G["MultiBarBottomLeftButton" .. i]:UnregisterAllEvents();
51         _G["MultiBarBottomLeftButton" .. i]:SetAttribute("statehidden", true);
52
53         _G["MultiBarBottomRightButton" .. i]:Hide();
54         _G["MultiBarBottomRightButton" .. i]:UnregisterAllEvents();
55         _G["MultiBarBottomRightButton" .. i]:SetAttribute("statehidden", true);
56
57         _G["MultiBarRightButton" .. i]:Hide();
58         _G["MultiBarRightButton" .. i]:UnregisterAllEvents();
59         _G["MultiBarRightButton" .. i]:SetAttribute("statehidden", true);
60
61         _G["MultiBarLeftButton" .. i]:Hide();
62         _G["MultiBarLeftButton" .. i]:UnregisterAllEvents();
63         _G["MultiBarLeftButton" .. i]:SetAttribute("statehidden", true);
64     end
65     UIPARENT_MANAGED_FRAME_POSITIONS["MainMenuBar"] = nil;
66     UIPARENT_MANAGED_FRAME_POSITIONS["StanceBarFrame"] = nil;
67     UIPARENT_MANAGED_FRAME_POSITIONS["PossessBarFrame"] = nil;
68     UIPARENT_MANAGED_FRAME_POSITIONS["PETACTIONBAR_YPOS"] = nil;
69
70     MainMenuBar:EnableMouse(false);
71     MainMenuBar:UnregisterEvent("DISPLAY_SIZE_CHANGED");
72     MainMenuBar:UnregisterEvent("UI_SCALE_CHANGED");
73     local animations = {MainMenuBar.slideOut:GetAnimations()};
74     animations[1]:SetOffset(0,0);
75     animations = {OverrideActionBar.slideOut:GetAnimations()};
76     animations[1]:SetOffset(0,0);
77
78     MainMenuBarArtFrame:Hide();
79     MainMenuBarArtFrame:SetParent(UIHider);
80
81     PossessBarFrame:Hide();
82     PossessBarFrame:SetParent(UIHider);
83
84     if PlayerTalentFrame then
85         PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED");
86     else
87         hooksecurefunc("TalentFrame_LoadUI", function()
88             PlayerTalentFrame:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED");
89         end);
90     end
91
92     ZoneAbilityFrame:ClearAllPoints();
93     ZoneAbilityFrame:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -450, 150);
94     ExtraActionBarFrame:ClearAllPoints();
95     ExtraActionBarFrame:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -450, 120);
96     --[[StanceBarFrame:UnregisterAllEvents()
97     StanceBarFrame:Hide()
98     StanceBarFrame:SetParent(UIHider)
99
100     --BonusActionBarFrame:UnregisterAllEvents()
101     --BonusActionBarFrame:Hide()
102     --BonusActionBarFrame:SetParent(UIHider)
103
104     PetActionBarFrame:UnregisterAllEvents()
105     PetActionBarFrame:Hide()
106     PetActionBarFrame:SetParent(UIHider)
107     --]]
108 end
109
110 hide();