comparison classes/MultiCastButton.lua @ 162:fc08372f0c7a

- Fixed icon behavior with buttonfacade - Fixed bad usage of IsAttackAction() API (and various others) by trimming event list
author Flick <flickerstreak@gmail.com>
date Fri, 21 Aug 2009 23:50:17 +0000
parents d0a41fc7b0d7
children ab5c37989986
comparison
equal deleted inserted replaced
161:d0a41fc7b0d7 162:fc08372f0c7a
236 local FLYOUT_DOWN_BUTTON_TCOORDS = { 99/128, 127/128, 65/256, 83/256 } 236 local FLYOUT_DOWN_BUTTON_TCOORDS = { 99/128, 127/128, 65/256, 83/256 }
237 local FLYOUT_DOWN_BUTTON_HL_TCOORDS = { 72/128, 92/128, 69/256, 79/256 } 237 local FLYOUT_DOWN_BUTTON_HL_TCOORDS = { 72/128, 92/128, 69/256, 79/256 }
238 local EMPTY_SLOT_TCOORDS = { 66/128, 96/128, 3/256, 33/256 } 238 local EMPTY_SLOT_TCOORDS = { 66/128, 96/128, 3/256, 33/256 }
239 239
240 local eventList = { 240 local eventList = {
241 -- TODO
242 "PLAYER_REGEN_ENABLED",
243 "PLAYER_ENTERING_WORLD",
244 "ACTIONBAR_PAGE_CHANGED",
245 "ACTIONBAR_SLOT_CHANGED", 241 "ACTIONBAR_SLOT_CHANGED",
246 "UPDATE_BINDINGS",
247 "ACTIONBAR_UPDATE_STATE", 242 "ACTIONBAR_UPDATE_STATE",
248 "ACTIONBAR_UPDATE_USABLE", 243 "ACTIONBAR_UPDATE_USABLE",
249 "ACTIONBAR_UPDATE_COOLDOWN", 244 "ACTIONBAR_UPDATE_COOLDOWN",
250 "UPDATE_INVENTORY_ALERTS", 245 "UPDATE_BINDINGS",
251 "PLAYER_TARGET_CHANGED",
252 "TRADE_SKILL_SHOW",
253 "TRADE_SKILL_CLOSE",
254 "PLAYER_ENTER_COMBAT",
255 "PLAYER_LEAVE_COMBAT",
256 "START_AUTOREPEAT_SPELL",
257 "STOP_AUTOREPEAT_SPELL",
258 "UNIT_ENTERED_VEHICLE",
259 "UNIT_EXITED_VEHICLE",
260 "COMPANION_UPDATE",
261 "UPDATE_MULTI_CAST_ACTIONBAR", 246 "UPDATE_MULTI_CAST_ACTIONBAR",
262 } 247 }
263 248
264 -- 249 --
265 -- MultiCast Button class 250 -- MultiCast Button class
323 -- event registration 308 -- event registration
324 f:EnableMouse(true) 309 f:EnableMouse(true)
325 f:RegisterForClicks("AnyUp") 310 f:RegisterForClicks("AnyUp")
326 for _, evt in pairs(eventList) do 311 for _, evt in pairs(eventList) do
327 f:RegisterEvent(evt) 312 f:RegisterEvent(evt)
313 end
314
315 -- Set up a proxy for the icon texture for use with ButtonFacade
316 self.frames.icon.SetTexCoordRaw = self.frames.icon.SetTexCoord
317 self.frames.icon.SetTexCoord = function( tx, ... )
318 if self:GetIconTexture() == TOTEM_TEXTURE then
319 tx:SetTexCoordRaw(unpack(EMPTY_SLOT_TCOORDS))
320 else
321 tx:SetTexCoordRaw(...)
322 end
328 end 323 end
329 324
330 -- attach to skinner 325 -- attach to skinner
331 bar:SkinButton(self) 326 bar:SkinButton(self)
332 327