Mercurial > wow > reaction
diff modules/ReAction_Action/ReAction_Action.lua @ 53:7e09c02ae620
Pet Action support
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Fri, 25 Apr 2008 20:35:55 +0000 |
parents | c9df7866ff31 |
children | 88283658fec4 |
line wrap: on
line diff
--- a/modules/ReAction_Action/ReAction_Action.lua Thu Apr 24 19:19:42 2008 +0000 +++ b/modules/ReAction_Action/ReAction_Action.lua Fri Apr 25 20:35:55 2008 +0000 @@ -1,5 +1,5 @@ --[[ - ReAction Action-button module. + ReAction Action button module. The button module implements standard action button functionality by wrapping Blizzard's ActionButton frame and associated functions. It also provides some button layout @@ -12,7 +12,6 @@ local L = ReAction.L local _G = _G local CreateFrame = CreateFrame -local print = ReAction.print -- module declaration local moduleID = "Action" @@ -40,11 +39,18 @@ end function module:OnEnable() - ReAction:RegisterDefaultBarConfig(L["Action Bar"], { type = "actionbar" }, true) + ReAction:RegisterBarType(L["Action Bar"], + { + type = moduleID, + defaultButtonSize = 36, + defaultBarRows = 1, + defaultBarCols = 12, + defaultBarSpacing = 3 + }, true) end function module:OnDisable() - ReAction:UnregisterDefaultBarConfig(L["Action Bar"]) + ReAction:UnregisterBarType(L["Action Bar"]) end function module:ApplyToBar(bar) @@ -52,7 +58,7 @@ end function module:RefreshBar(bar) - if bar.config.type == "actionbar" then + if bar.config.type == moduleID then if self.buttons[bar] == nil then self.buttons[bar] = { } end @@ -166,10 +172,11 @@ -- use-count of action IDs +local nActionIDs = 120 local ActionIDList = setmetatable( {}, { __index = function(self, idx) if idx == nil then - for i = 1, 120 do + for i = 1, nActionIDs do if rawget(self,i) == nil then rawset(self,i,1) return i