Mercurial > wow > reaction
comparison modules/ReAction_HideBlizzard/ReAction_HideBlizzard.lua @ 30:0d95ce7a9ec2
- added Ace3 externs
- converted ReAction_ConfigUI to use blizzard interface addons panel via AceConfigDialog-3.0
- partially converted FuBar module to LibRock, deprecated it (going to remove it entirely later)
- cleaned up a couple other tidbits
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Wed, 02 Apr 2008 23:31:13 +0000 |
parents | 21bcaf8215ff |
children | 27dde2743f43 |
comparison
equal
deleted
inserted
replaced
29:9c89042bc328 | 30:0d95ce7a9ec2 |
---|---|
27 ) | 27 ) |
28 self.db.RegisterCallback(self,"OnProfileChanged") | 28 self.db.RegisterCallback(self,"OnProfileChanged") |
29 | 29 |
30 self.hiddenFrame = CreateFrame("Frame") | 30 self.hiddenFrame = CreateFrame("Frame") |
31 self.hiddenFrame:Hide() | 31 self.hiddenFrame:Hide() |
32 | |
33 -- disable the buttons to hide/show the blizzard multiaction bars | |
34 -- see UIOptionsFrame.lua and .xml | |
35 -- This is called every time the options panel is shown, after it is set up | |
36 local disabledOptionsButtons = { | |
37 _G["UIOptionsFrameCheckButton"..UIOptionsFrameCheckButtons["SHOW_MULTIBAR1_TEXT"].index], | |
38 _G["UIOptionsFrameCheckButton"..UIOptionsFrameCheckButtons["SHOW_MULTIBAR2_TEXT"].index], | |
39 _G["UIOptionsFrameCheckButton"..UIOptionsFrameCheckButtons["SHOW_MULTIBAR3_TEXT"].index], | |
40 _G["UIOptionsFrameCheckButton"..UIOptionsFrameCheckButtons["SHOW_MULTIBAR4_TEXT"].index], | |
41 _G["UIOptionsFrameCheckButton"..UIOptionsFrameCheckButtons["ALWAYS_SHOW_MULTIBARS_TEXT"].index], | |
42 } | |
43 hooksecurefunc("UIOptionsFrame_Load", | |
44 function() | |
45 if self.db.profile.hide then | |
46 for _, f in pairs(disabledOptionsButtons) do | |
47 f.disabled = true | |
48 OptionsFrame_DisableCheckBox(f) | |
49 end | |
50 end | |
51 end | |
52 ) | |
53 end | 32 end |
54 | 33 |
55 function module:OnEnable() | 34 function module:OnEnable() |
56 if self.db.profile.hide then | 35 if self.db.profile.hide then |
57 self:HideAll(true) | 36 self:HideAll(true) |
58 end | 37 end |
38 ReAction:RegisterOptions("global", self, { | |
39 hideBlizzard = { | |
40 type = "toggle", | |
41 handler = self, | |
42 name = L["Hide Blizzard Action Bars"], | |
43 desc = L["Hide the default main bar and extra action bars"], | |
44 get = "IsHidden", | |
45 set = function(info,value) self:SetHidden(value) end, | |
46 disabled = InCombatLockdown | |
47 } | |
48 }) | |
59 end | 49 end |
60 | 50 |
61 function module:OnDisable() | 51 function module:OnDisable() |
62 self:ShowAll(true) | 52 self:ShowAll(true) |
63 end | 53 end |
141 else | 131 else |
142 self:ShowAll() | 132 self:ShowAll() |
143 end | 133 end |
144 end | 134 end |
145 | 135 |
146 function module:GetGlobalOptions() | |
147 if self.globalOptions == nil then | |
148 self.globalOptions = { | |
149 hideBlizzard = { | |
150 type = "toggle", | |
151 handler = self, | |
152 name = L["Hide Default Action Bars"], | |
153 desc = L["Hide the default main bar and extra action bars"], | |
154 get = "IsHidden", | |
155 set = "SetHidden", | |
156 disabled = function() return InCombatLockdown() end | |
157 } | |
158 } | |
159 end | |
160 return self.globalOptions | |
161 end |