Quantcast
WoWInterface: SVN - zz_Actionbuttons - Path Comparison - / Rev 6 and / Rev 7

WoWInterface SVN zz_Actionbuttons

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 6 to Rev 7
    Reverse comparison

Rev 6 → Rev 7

trunk/zz_Actionbuttons/core.lua
2,10 → 2,18
local childName = name
local defaults = {}
local options, db
local _,class = UnitClass('player')
local _G = _G
local buttons = {}
local defBars = {
'Action','MultiBarBottomLeft','MultiBarBottomRight','MultiBarLeft','MultiBarRight','Shapeshift','PetAction' ,'BonusAction'
'Action',
'BonusAction',
'MultiBarRight',
'MultiBarLeft',
'MultiBarBottomRight',
'MultiBarBottomLeft',
'Shapeshift',
'PetAction',
}
 
local privFrame = {
16,11 → 24,11
}
 
local bagButtons = {
MainMenuBarBackpackButton,
CharacterBag0Slot,
CharacterBag1Slot,
CharacterBag2Slot,
CharacterBag3Slot,
'CharacterBag3Slot',
'CharacterBag2Slot',
'CharacterBag1Slot',
'CharacterBag0Slot',
'MainMenuBarBackpackButton',
}
addon['MSQ'] = LibStub("Masque",true)
if(addon['MSQ']) then addon['MSQGroup'] = addon['MSQ']:Group(name,name) end
65,8 → 73,18
return (_G[bname] and privFrame[bname] == nil) and bname or ( type(privFrame[bname]) == 'string' and privFrame[bname] or name..bname.."Bar")
end
 
 
local function resizeDrag(self, lastbutton)
local width = (addon['round'](12/self['db']['rows'],0) + .5) * lastbutton:GetWidth()
local height = (self['db']['rows'] + .5) * lastbutton:GetHeight()
_G[self:GetName().."drag"]:ClearAllPoints()
_G[self:GetName().."drag"]:SetWidth(width)
_G[self:GetName().."drag"]:SetHeight(height)
_G[self:GetName().."drag"]:SetPoint("TOPLEFT", _G[self:GetName().."drag"]:GetParent(), "TOPLEFT", - lastbutton:GetWidth()/4,lastbutton:GetHeight()/4)
end
 
local function localButtons()
wipe(buttons)
-- wipe(buttons)
local lastbutton
for b = 1, #defBars do
local barname = getBarname(defBars[b])
75,6 → 93,8
if(f) then
if(defBars[b]=='Action' and not hooked[f]) then
f:SetAttribute("actionpage",b)
elseif(defBars[b]=='MultiBarRight' and not hooked[f]) then
f:SetAttribute("actionpage",b)
end
f:SetFrameStrata("MEDIUM")
f:SetParent(UIParent)
104,10 → 124,10
if(defBars[b] == 'Action') then
button:SetID(i)
else
button:SetID(0)
-- button:SetID(0)
end
buttons[#buttons + 1] = button
if(addon['MSQ'] and addon['MSQGroup']) then
if(addon['MSQ'] and addon['MSQGroup'] and not buttons[button]) then
buttons[button] = true
addon['MSQGroup']:AddButton(button)
end
button:ClearAllPoints()
125,10 → 145,10
end
end
end
resizeDrag(f, lastbutton)
end
local f = _G[name.."MicroMenu"] or CreateFrame("Frame", name.."MicroMenu", UIParent)
addDrag(f)
 
local spr = 12/db['bars'][f:GetName()]['rows']
lastbutton = f
local y,row = 1,0
151,6 → 171,7
end
end
end
resizeDrag(f, lastbutton)
f = _G[name.."BagBar"] or CreateFrame("Frame", name.."BagBar", UIParent)
addDrag(f)
local spr = 12/db['bars'][f:GetName()]['rows']
158,7 → 179,6
local y,row = 1,0
for i = 1, #bagButtons do
local btn = _G[bagButtons[i]]
print(i,bagButtons[i], btn)
if(btn) then
UIPARENT_MANAGED_FRAME_POSITIONS[btn:GetName()] = nil
btn:SetParent(f)
169,6 → 189,10
btn:SetPoint("TOPLEFT", lastbutton, "TOPRIGHT")
end
y = y + 1
if(addon['MSQ'] and addon['MSQGroup'] and not buttons[btn]) then
buttons[btn] = true
addon['MSQGroup']:AddButton(btn)
end
lastbutton = btn
if(y > spr) then
y = 1
176,6 → 200,13
end
end
end
resizeDrag(f, lastbutton)
if(BonusActionBarFrame:IsVisible()) then
for i = 1, 12 do
_G["ActionButton"..i]:SetAlpha(class == 'WARRIOR' and 1 or 0)
_G["ActionButton"..i]:EnableMouse(class=='WARRIOR')
end
end
end
 
local function getBarPref(pref)
187,6 → 218,10
localButtons()
end
 
local function resetCenter(pref)
_G[pref[#pref-1]]:center()
end
 
local function buildPrefs()
for b = 1, #defBars do
local bname = getBarname(defBars[b])
197,6 → 232,7
}, addon['options']['args'][childName])
addon['AddConfigEntry'](addon, name, 'range', 'rows', 'Rows', 'Number of rows', 0,1,12,1,false,o)
addon['AddConfigEntry'](addon, name, 'range', 'scale', 'Scale', 'Scale of this bar', 1,0.1,3,0.1,true,o)
addon['AddConfigEntry'](addon, name, 'execute', 'center', 'Center', 'Reset position', 2,resetCenter,nil,nil,nil,o)
end
local o = addon['AddConfigMenu'](addon, {
['name'] = name.."MicroMenu",