Mercurial > wow > reaction
comparison modules/ReAction_Action/ReAction_Action.lua @ 50:c3c64e2def50
Assorted cleanup for hide/show grid, action ID labels, draggable resizing, etc
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Tue, 22 Apr 2008 20:37:44 +0000 |
parents | dcf8116560a1 |
children | c9df7866ff31 |
comparison
equal
deleted
inserted
replaced
49:dcf8116560a1 | 50:c3c64e2def50 |
---|---|
128 if bar and self.buttons[bar] then | 128 if bar and self.buttons[bar] then |
129 for _, b in pairs(self.buttons[bar]) do | 129 for _, b in pairs(self.buttons[bar]) do |
130 if b then | 130 if b then |
131 if mode then | 131 if mode then |
132 ActionButton_ShowGrid(b.frame) | 132 ActionButton_ShowGrid(b.frame) |
133 if not b.actionIDLabel then | 133 self:showActionIDLabel(b) |
134 local label = b:GetFrame():CreateFontString(nil,"OVERLAY","GameFontNormalLarge") | |
135 label:SetAllPoints() | |
136 label:SetJustifyH("CENTER") | |
137 label:SetShadowColor(0,0,0,1) | |
138 label:SetShadowOffset(2,-2) | |
139 label:SetText(tostring(b:GetActionID())) | |
140 b.actionIDLabel = label | |
141 end | |
142 b.actionIDLabel:Show() | |
143 else | 134 else |
144 if b.actionIDLabel then | |
145 b.actionIDLabel:Hide() | |
146 end | |
147 ActionButton_HideGrid(b.frame) | 135 ActionButton_HideGrid(b.frame) |
136 self:hideActionIDLabel(b) | |
148 end | 137 end |
149 | |
150 end | 138 end |
151 end | 139 end |
152 end | 140 end |
153 end | 141 end |
154 end | 142 end |
143 | |
144 function module:showActionIDLabel(button) | |
145 if not button.actionIDLabel then | |
146 local label = button:GetFrame():CreateFontString(nil,"OVERLAY","GameFontNormalLarge") | |
147 label:SetAllPoints() | |
148 label:SetJustifyH("CENTER") | |
149 label:SetShadowColor(0,0,0,1) | |
150 label:SetShadowOffset(2,-2) | |
151 label:SetText(tostring(button:GetActionID())) | |
152 button.actionIDLabel = label | |
153 end | |
154 button.actionIDLabel:Show() | |
155 end | |
156 | |
157 function module:hideActionIDLabel(button) | |
158 if button.actionIDLabel then | |
159 button.actionIDLabel:Hide() | |
160 end | |
161 end | |
162 | |
163 | |
155 | 164 |
156 -- use-count of action IDs | 165 -- use-count of action IDs |
157 local ActionIDList = setmetatable( {}, { | 166 local ActionIDList = setmetatable( {}, { |
158 __index = function(self, idx) | 167 __index = function(self, idx) |
159 if idx == nil then | 168 if idx == nil then |
211 self:Refresh(bar,idx) | 220 self:Refresh(bar,idx) |
212 | 221 |
213 if not module.db.profile.hideEmptyButtons then | 222 if not module.db.profile.hideEmptyButtons then |
214 ActionButton_ShowGrid(self.frame) | 223 ActionButton_ShowGrid(self.frame) |
215 end | 224 end |
225 | |
226 if ReAction.configMode then | |
227 ActionButton_ShowGrid(self.frame) | |
228 module:showActionIDLabel(self) | |
229 end | |
216 end | 230 end |
217 | 231 |
218 function Button:Destroy() | 232 function Button:Destroy() |
219 local f = self.frame | 233 local f = self.frame |
220 f:UnregisterAllEvents() | 234 f:UnregisterAllEvents() |