WoWInterface SVN zz_Actionbuttons

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 14 to Rev 15
    Reverse comparison

Rev 14 → Rev 15

trunk/zz_Actionbuttons/core.lua
8,7 → 8,9
 
addon['MSQ'] = LibStub("Masque",true)
if(addon['MSQ']) then addon['MSQGroup'] = addon['MSQ']:Group(name,name) end
 
local function dragAble()
return db['dragAble']
end
local function hideBlizz()
local hide = {
MainMenuBar,
60,24 → 62,25
 
addon['fadeInOut'] = fadeInOut
addon['fadeInOutHeader'] = fadeInOutHeader
local function applySettings(bname, bh)
local function applySettings(bname)
db = addon['updateDB'](addon['db']['profile'])
local f = _G[bname]
if(not f) then return end
local spr = db['bars'][bname]['cols']
local y,row = 1,0
local lastbutton = f
local bh = f['sizeButton'] or 32
_G[bname]:SetAttribute('fadeIn', db['bars'][bname]['fadein'])
f:SetScale(db['bars'][bname]['scale'])
if(f['sbuttons']) then
for i = 1, #f['sbuttons'] do
local btn = f['sbuttons'][i]
bh = bh or btn:GetHeight()
bh = f['sizeButton'] or btn:GetHeight()
btn:SetParent(f)
btn:ClearAllPoints()
if(y == 1) then
 
btn:SetPoint("TOPLEFT", f, "TOPLEFT",0 , -row * bh + yoffset)
btn:SetPoint("TOPLEFT", f, "TOPLEFT",xoffset , -row * bh - yoffset)
else
btn:SetPoint("TOPLEFT", lastbutton, "TOPRIGHT",xoffset,0)
end
94,10 → 97,11
end
end
if(row < 1) then row = 1 end
f['maxslots'] = f['maxslots'] or 12
if(db['bars'][bname]['cols'] > f['maxslots']) then db['bars'][bname]['cols'] = f['maxslots'] end
bh = bh or 0
f:SetWidth(db['bars'][bname]['cols']*(lastbutton:GetWidth() + xoffset) -xoffset)
f:SetHeight(row * (bh + yoffset) - yoffset)
f:SetWidth(db['bars'][bname]['cols']*(lastbutton:GetWidth() + xoffset) + xoffset)
f:SetHeight(row * (bh + yoffset) + yoffset)
end
addon['applySettings'] = applySettings
local function getButton(parent, id, offset)
136,15 → 140,30
return btn
end
 
local function createBar(bid,mb)
local function createBar(bid,mb,bh)
mb = mb or 12
local yoff =-yoffset - 40 * (bid-1)
local f = CreateFrame("Frame", "zzABar"..bid, UIParent, "SecureHandlerStateTemplate SecureHandlerEnterLeaveTemplate",bid == 1 and bid or nil)
db['bars']["zzABar"..bid] = db['bars']["zzABar"..bid] or {
['cols'] = 12,
['scale'] = 1,
['points'] = {},
}
db['bars']["zzABar"..bid]['points'] = db['bars']["zzABar"..bid]['points'] or {}
local f = addon['CreateSecureFrame']({
['name'] = "zzABar"..bid,
['db'] = db['bars']["zzABar"..bid]['points'],
['id'] = bid == 1 and bid or nil,
['width'] = 1,
['height'] = 1,
['parent'] = UIParent,
['xoff'] = xoffset,
['yoff'] = yoff,
['dragAble'] = dragAble,
})
-- local f = CreateFrame("Frame", "zzABar"..bid, UIParent, "SecureHandlerStateTemplate SecureHandlerEnterLeaveTemplate",bid == 1 and bid or nil)
f['sbuttons'] = {}
f['maxslots'] = mb
f:SetWidth(1)
f:SetHeight(1)
f:SetPoint("CENTER", xoffset, yoff)
f['sizeButton'] = bh or 32
if(bid > 1 and bid < 7) then
f:SetAttribute('actionpage', bid)
end
212,6 → 231,7
local offset = bid*mb-mb+i
local b = getButton(f, i, offset)
b:SetPoint("TOPLEFT", lastbutton, "TOPRIGHT", xoffset,0)
b:SetSize(32,32)
yoff = 0
lastbutton = b
b:SetAttribute('action--base',b:GetAttribute('action') or i)
227,8 → 247,9
f['sbuttons'][#f['sbuttons'] + 1] = b
-- b:SetAttribute('action', i)
end
addon['addDrag'](f)
addon['applySettings'](f:GetName())
-- addon['addDrag'](f)
-- f['sizeButton'] = lastbutton:GetHeight()
addon['applySettings'](f:GetName(),32)
if(db['bars'][f:GetName()]['fadein']) then fadeOut(lastbutton) end
return f:GetName()
end
278,10 → 299,10
addon['AddConfigEntry'](addon, name, 'toggle', 'fadein', 'Hide', 'Only show on mouseover', 0,1,12,1,false,o)
end
for i = 1,6 do
addP(createBar(i, NUM_ACTIONBAR_BUTTONS))
addP(createBar(i, NUM_ACTIONBAR_BUTTONS,32))
end
addP(createBar(20, NUM_SHAPESHIFT_SLOTS))
addP(createBar(21, NUM_PET_ACTION_SLOTS))
addP(createBar(20, NUM_SHAPESHIFT_SLOTS,32))
addP(createBar(21, NUM_PET_ACTION_SLOTS,32))
 
addP("MultiCastActionBarFrame")
addP(name.."MicroMenu")
294,6 → 315,22
MoveMicroButtons = function() end
VehicleMenuBar_MoveMicroButtons = function() end
-- hooksecurefunc("ChangeMultiCastActionPage", updateMCB)
hooksecurefunc("MultiActionBar_UpdateGridVisibility", function()
local bar = _G['zzABar2']
for i = 1, #bar['sbuttons'] do
local b = bar['sbuttons'][i]
if (ALWAYS_SHOW_MULTIBARS == "1" or ALWAYS_SHOW_MULTIBARS == 1 ) then
b:SetAttribute('showgrid',1)
-- print("show", b:GetName(),b:GetAttribute("showgrid"))
ActionButton_ShowGrid(b)
-- print("show", b:GetName(),b:GetAttribute("showgrid"))
else
b:SetAttribute('showgrid',0)
-- print("hide", b:GetName())
ActionButton_HideGrid(b)
end
end
end)
hideBlizz()
local exitButton = CreateFrame("BUTTON", name.."ExitButton", UIParent, "SecureHandlerClickTemplate")
exitButton:SetSize(64,64)