WoWInterface SVN zz_Actionbuttons

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

trunk/zz_Actionbuttons/zz_Actionbuttons.toc
0,0 → 1,6
## Interface: 40300
## OptionalDeps: Ace3,zzCommon,Masque
## X-WoWI-ID:
## SavedVariables: zz_ActionbuttonsDB
Common\common.xml
core.lua
\ No newline at end of file
trunk/zz_Actionbuttons/core.lua New file
0,0 → 1,81
local name, addon = ...
local childName = name
local defaults = {}
local options, db
local _G = _G
local buttons = {}
local defBars = {
'Action','MultiBarBottomLeft','MultiBarBottomRight','MultiBarLeft','MultiBarRight'
}
addon['MSQ'] = LibStub("Masque",true)
if(addon['MSQ']) then addon['MSQGroup'] = addon['MSQ']:Group(name,name) end
 
local function localButtons()
wipe(buttons)
local lastbutton
for b = 1, #defBars do
local f
if(defBars[b] == 'Action') then
f = CreateFrame("Frame", name.."ActionBar", UIParent)
f:SetWidth(1)
f:SetHeight(1)
f:SetPoint("CENTER")
else
f = _G[defBars[b]]
end
if(f) then
f['dragAble'] = function() return true end
db['bars'][defBars[b]] = db['bars'][defBars[b]] or {}
f['db'] = db['bars'][defBars[b]]
addon['AddDrag'](f,"BOX",{
['width'] = 32,
['height'] = 32,
['anchor'] = "TOPLEFT",
['parentanchor'] = "TOPLEFT",
['xOffset'] = 16,
['yOffset'] = 16,
['offset'] = 16,
})
local i = 1
while(_G[defBars[b]..'Button'..i]) do
local button = _G[defBars[b]..'Button'..i]
buttons[#buttons + 1] = button
if(addon['MSQ'] and addon['MSQGroup']) then
addon['MSQGroup']:AddButton(button)
end
if(i == 1) then
-- hooksecurefunc(button, "SetPoint", print)
button:ClearAllPoints()
button:SetPoint("TOPLEFT", f)
-- print("pos", button:GetName())
else
button:SetPoint("TOPLEFT", lastbutton, "TOPRIGHT")
end
lastbutton = button
i = i + 1
end
end
end
print("found",#buttons,"buttons")
end
 
local function getPref(pref)
return db[pref[#pref]]
end
 
local function setPref(pref,value)
db[pref[#pref]] = value
end
 
local function init()
options = addon['InitConfig'](addon, childName, true, {
['type'] = "data source",
['OnTooltipShow'] = OnTooltip,
['OnClick'] = OnButton,
}, getPref, setPref)
db = addon['db']['profile'][childName]
db['bars'] = db['bars'] or {}
localButtons()
end
 
addon['startup'](addon, name, childName, init, true, defaults)
\ No newline at end of file
trunk/zz_Actionbuttons Property changes : Added: svn:externals + svn://svn.wowinterface.com/zzcommon-841/trunk/LibCommon Common