WoWInterface SVN zz_Actionbuttons

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 8 to Rev 9
    Reverse comparison

Rev 8 → Rev 9

trunk/zz_Actionbuttons/core.lua
5,35 → 5,54
local _G = _G
local xoffset, yoffset = 8,0
 
local function createBar(bid,id)
local f = CreateFrame("Frame", "zzABar"..bid, UIParent, "SecureHandlerStateTemplate",id)
local function createBar(bid)
local f = CreateFrame("Frame", "zzABar"..bid, UIParent, "SecureHandlerStateTemplate",bid)
f:SetWidth(1)
f:SetHeight(1)
f:SetPoint("CENTER")
f:SetAttribute('_onstate-page', [[
self:SetAttribute('actionpage', newstate)
control:ChildUpdate('actionpage', newstate)
]])
if(class == "WARRIOR") then
RegisterStateDriver(f, "page", "[bonusbar:1] 7;[bonusbar:2] 8;[bonusbar:3] 9;1")
elseif(class == "DRUID") then
RegisterStateDriver(f, "page", "[stance:1] 9;[stance:3,stealth] 8;[stance:3] 7;[stance:5] 10;1") -- 1 bear/ 3 cat/ 5 moonkin
elseif(class == "ROGUE") then
RegisterStateDriver(f, "page", "[stance:1] 7;[stance:3] 8; 1") -- 1 stealth/ 3 shadow dance
end
 
f:SetAttribute('actionpage', bid)
-- if(bid == 1) then
f:SetAttribute('_onstate-page', [[
print(newstate)
if(self:GetID() == 1) then
self:SetAttribute('actionpage', newstate)
control:ChildUpdate('actionpage', newstate)
else
control:ChildUpdate('actionpage', self:GetID())
end
 
]])
if(class == "WARRIOR") then
RegisterStateDriver(f, "page", "[bonusbar:1] 7;[bonusbar:2] 8;[bonusbar:3] 9;1")
elseif(class == "DRUID") then
RegisterStateDriver(f, "page", "[stance:1] 9;[stance:3,stealth] 8;[stance:3] 7;[stance:5] 10;1") -- 1 bear/ 3 cat/ 5 moonkin
elseif(class == "ROGUE") then
RegisterStateDriver(f, "page", "[stance:1] 7;[stance:3] 8; 1") -- 1 stealth/ 3 shadow dance
elseif(class == "PRIEST") then
RegisterStateDriver(f, "page", "[stance:1] 7; 1")
end
-- end
local lastbutton = f
local yoff =-yoffset - 40 * (bid-1)
for i = 1, 12 do
local b = CreateFrame("CheckButton", "$PARENTActionButton"..i, f, "ActionButtonTemplate ActionBarButtonCodeTemplate",i)
local offset = bid*12-12+i
local b = CreateFrame("CheckButton", "$PARENTActionButton"..offset, f, "ActionButtonTemplate ActionBarButtonCodeTemplate",i)
-- b:SetWidth(32)
-- b:SetHeight(32)
b:SetPoint("TOPLEFT", lastbutton, "TOPRIGHT", xoffset, yoffset)
b:SetPoint("TOPLEFT", lastbutton, "TOPRIGHT", xoffset, yoff)
yoff = 0
lastbutton = b
b:SetAttribute('action--base',i)
b:SetAttribute('showgrid', 1)
b:SetAttribute('_childupdate-actionpage', [[
self:SetAttribute('action', self:GetAttribute('action--base'))
]])
b:SetAttribute('action--base',offset)
if(bid == 1) then
b:SetAttribute('_childupdate-actionpage', [[
self:SetAttribute('action--base', self:GetAttribute('action--base'))
]])
else
b:SetAttribute('_childupdate-actionpage', [[
local offset = message * 12 -12 + self:GetID()
print(offset,GetBindingKey("MULTIBARBOTTOMLEFTACTIONBUTTON"..self:GetID()))
]])
end
b:SetAttribute('action', i)
end
end
43,7 → 62,9
end
 
addon['preloads'][#addon['preloads'] + 1] = function(self,event,...)
createBar(1,1)
for i = 1,6 do
createBar(i)
end
end
 
addon['startup'](addon, name, name, init, true, defaults)
\ No newline at end of file
trunk/zz_Actionbuttons/zz_Actionbuttons.toc
1,6 → 1,6
## Interface: 40300
## OptionalDeps: Ace3,zzCommon,Masque
## X-WoWI-ID:
## X-WoWI-ID: 21069
## SavedVariables: zz_ActionbuttonsDB
Common\common.xml
core.lua
\ No newline at end of file