-
Notifications
You must be signed in to change notification settings - Fork 7
/
Hidebuttons.lua
73 lines (61 loc) · 1.91 KB
/
Hidebuttons.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
local myname, Squeenix = ...
----------------------
-- Locals --
----------------------
local tekcheck = LibStub("tekKonfig-Checkbox")
local GAP = 8
local frames = {
GameTimeFrame = "calendar",
MinimapZoneTextButton = "zone text",
MiniMapWorldMapButton = "world map",
MiniMapVoiceChatFrame = "voice chat",
MiniMapTracking = "tracking",
TimeManagerClockButton = "clock",
}
Squeenix.hidesetupframes = {
GarrisonLandingPageMinimapButton = "garrison",
GuildInstanceDifficulty = "guild dungeon mode",
MiniMapChallengeMode = "challenge mode",
MiniMapInstanceDifficulty = "dungeon mode",
}
for i,v in pairs(frames) do Squeenix.hidesetupframes[i] = v end
------------------------------
-- Initialization --
------------------------------
local mailshow, diffshow = MiniMapMailFrame.Show, MiniMapInstanceDifficulty.Show
local garryparent = GarrisonLandingPageMinimapButton:GetParent()
local garryhider = CreateFrame("Frame", nil, garryparent)
garryhider:Hide()
function Squeenix:HideButtons()
if self.db.hideMinimapZoom then
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
else
MinimapZoomIn:Show()
MinimapZoomOut:Show()
end
if self.db.hideMiniMapMailFrame then
MiniMapMailFrame.Show = MiniMapMailFrame.Hide
MiniMapMailFrame:Hide()
else
MiniMapMailFrame.Show = mailshow
if HasNewMail() then MiniMapMailFrame:Show() end
end
if self.db.hideMiniMapInstanceDifficulty then
MiniMapInstanceDifficulty.Show = MiniMapInstanceDifficulty.Hide
MiniMapInstanceDifficulty:Hide()
else
MiniMapInstanceDifficulty.Show = diffshow
MiniMapInstanceDifficulty_OnEvent(MiniMapInstanceDifficulty)
end
if self.db.hideGarrisonLandingPageMinimapButton then
GarrisonLandingPageMinimapButton:SetParent(garryhider)
else
GarrisonLandingPageMinimapButton:SetParent(garryparent)
end
for name in pairs(frames) do
if _G[name] then
if self.db["hide"..name] then _G[name]:Hide() else _G[name]:Show() end
end
end
end