WoWInterface SVN Bison1

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 25 to Rev 26
    Reverse comparison

Rev 25 → Rev 26

Facade.lua File deleted
Bison.toc
5,9 → 5,9
## Author: Grayal
## DefaultState: enabled
## SavedVariables: BisonDB
## OptionalDeps: Ace3, LibDebugLog-1.0, ButtonFacade
## OptionalDeps: Ace3, LibDebugLog-1.0
## X-Name: Bison
## X-Embeds: Ace3, LibDebugLog-1.0, ButtonFacade
## X-Embeds: Ace3, LibDebugLog-1.0
## X-Email: grayal@gmx.de
## X-Category: Buffs
## X-CompatibleLocales: enUS, enGB, deDE
18,5 → 18,4
Localization.lua
Bison.lua
BuffBar.lua
Facade.lua
Options.lua
BuffBar.lua
29,7 → 29,7
b.icon:SetPoint( 'BOTTOMLEFT')
b.count = b:CreateFontString( name..'Count', 'BACKGROUND', 'NumberFontNormal')
b.count:SetPoint( 'BOTTOMRIGHT', b, 'BOTTOMRIGHT', -2, 2)
b.left = b:CreateFontString( name..'Cooldown', 'ARTWORK', 'GameFontNormalSmall')
b.left = b:CreateFontString( nil, 'ARTWORK', 'GameFontNormalSmall')
b.left:SetPoint( 'TOP', b, 'BOTTOM')
b.ghostlabel = b:CreateFontString( nil, 'OVERLAY', 'GameFontHighlight')
b.ghostlabel:SetHeight( 10)
314,18 → 314,20
--[[---------------------------------------------------------------------------------
BisonBar
------------------------------------------------------------------------------------]]
local LBF = LibStub('LibButtonFacade', true)
local BisonBar = Bison:CreateClass( 'Frame')
Bison.BisonBar = BisonBar
 
function BisonBar:New( values)
function BisonBar:New( values, barName)
local f = self:Bind( CreateFrame( 'Frame', nil, UIParent))
f:SetToplevel( true)
f:SetFrameStrata( 'LOW')
f:SetWidth( 65)
f:SetHeight( 40)
-- f:AddHelpTexture()
-- f:AddHelpTexture() -- only for test
f.buttons = {}
f.values = values
f.values = values
f.barName = barName
return f
end
 
337,8 → 339,8
tex:SetPoint( 'BOTTOMLEFT')
end
 
function BisonBar:NewBuffBar( values)
local f = self:New( values)
function BisonBar:NewBuffBar( values, barName)
local f = self:New( values, barName)
f:RegisterEvent( 'UNIT_AURA')
f:SetScript( 'OnEvent', BisonBar.OnEvent)
f:SetScript( 'OnUpdate', BisonBar.OnUpdate)
347,8 → 349,8
return f
end
 
function BisonBar:NewDebuffBar( values)
local f = self:New( values)
function BisonBar:NewDebuffBar( values, barName)
local f = self:New( values, barName)
f:RegisterEvent( 'UNIT_AURA')
f:SetScript( 'OnEvent', BisonBar.OnEvent)
f.name = 'debuff'
356,8 → 358,8
return f
end
 
function BisonBar:NewWeaponBar( values)
local f = self:New( values)
function BisonBar:NewWeaponBar( values, barName)
local f = self:New( values, barName)
f:SetScript( 'OnUpdate', BisonBar.OnUpdateWeapon)
f.name = 'weapon'
f.buffFilter = nil
380,6 → 382,9
end
b:Update()
table.insert( self.buttons, b)
if LBF then
LBF:Group( 'Bison', self.barName):AddButton( b)
end
end
end
 
445,6 → 450,9
self:SetPoint( 'BOTTOMLEFT', UIParent, 'BOTTOMLEFT', self.values.xPos, self.values.yPos)
self:SetAnchors()
self:UpdateLock( locked)
if LBF then
LBF:Group( 'Bison', self.barName):Skin( unpack( values.style))
end
end
 
function BisonBar:SetAnchors()
Bison.lua
4,18 → 4,23
local L = LibStub( 'AceLocale-3.0'):GetLocale( 'Bison')
local DEFAULTS = {
profile = {
buff = { xPos = 400, yPos = 500, xPadding = 5, yPadding = 15, scale = 1.0, rows = 2, cols = 16, show = true, flashing = true, timer = true, horizontal = true, sort = 'dec', },
debuff = { xPos = 400, yPos = 250, xPadding = 5, yPadding = 15, scale = 1.0, rows = 1, cols = 16, show = true, flashing = true, timer = true, horizontal = true, sort = 'dec', },
weapon = { xPos = 400, yPos = 200, xPadding = 5, yPadding = 15, scale = 1.0, rows = 1, cols = 2, show = true, flashing = true, timer = true, horizontal = true, sort = 'none', },
buff = { xPos = 400, yPos = 500, xPadding = 5, yPadding = 15, scale = 1.0, rows = 2, cols = 16, show = true, flashing = true, timer = true, horizontal = true, sort = 'dec', style = { 'Blizzard', 0, nil }, },
debuff = { xPos = 400, yPos = 250, xPadding = 5, yPadding = 15, scale = 1.0, rows = 1, cols = 16, show = true, flashing = true, timer = true, horizontal = true, sort = 'dec', style = { 'Blizzard', 0, nil }, },
weapon = { xPos = 400, yPos = 200, xPadding = 5, yPadding = 15, scale = 1.0, rows = 1, cols = 2, show = true, flashing = true, timer = true, horizontal = true, sort = 'none', style = { 'Blizzard', 0, nil }, },
locked = true,
enabled = true,
}
}
local MAX_BUTTONS = {
buff = 32,
buff = 32,
debuff = 16,
weapon = 2,
}
local BAR_NAMES = {
[L.BarBuff] = 'buff',
[L.BarDebuff] = 'debuff',
[L.BarWeapon] = 'weapon',
}
local SORT_TYPES = {
['none'] = 1,
['alpha'] = 2,
40,16 → 45,16
Bison.version = format( L.Version, GetAddOnMetadata( 'Bison', 'Version') or 'unknown', RED_FONT_COLOR_CODE, 'WotLK', FONT_COLOR_CODE_CLOSE)
 
function Bison:OnInitialize()
self:ToggleDebugLog( false)
self:ToggleDebugLog( true)
self.db = LibStub( 'AceDB-3.0'):New( 'BisonDB', DEFAULTS, 'Default')
self:InitConfig()
end
 
function Bison:OnEnable()
self.buff = self.BisonBar:NewBuffBar( self.db.profile.buff)
self.debuff = self.BisonBar:NewDebuffBar( self.db.profile.debuff)
self.weapon = self.BisonBar:NewWeaponBar( self.db.profile.weapon)
self.buff:CreateButtons( MAX_BUTTONS.buff, 0)
self.buff = self.BisonBar:NewBuffBar( self.db.profile.buff, L.BarBuff)
self.debuff = self.BisonBar:NewDebuffBar( self.db.profile.debuff, L.BarDebuff)
self.weapon = self.BisonBar:NewWeaponBar( self.db.profile.weapon, L.BarWeapon)
self.buff:CreateButtons( MAX_BUTTONS.buff, 0)
self.debuff:CreateButtons( MAX_BUTTONS.debuff, 0)
self.weapon:CreateButtons( MAX_BUTTONS.weapon, 15)
self:Update()
58,6 → 63,10
self.db.RegisterCallback( self, 'OnProfileCopied')
self.db.RegisterCallback( self, 'OnProfileReset')
self.db.RegisterCallback( self, 'OnProfileDeleted')
local LBF = LibStub( 'LibButtonFacade', true)
if LBF then
LBF:RegisterSkinCallback( 'Bison', self.OnSkin, self)
end
self:Debug( 'Bison enabled')
self:Print( self.version, 'loaded')
end
66,6 → 75,18
self:HideFrames()
end
 
function Bison:OnSkin( skin, gloss, backdrop, group, button, colors)
if group and BAR_NAMES[group] then
local bar = BAR_NAMES[group]
local pro = self.db.profile[bar]
if type(pro.style) ~= 'table' then pro.style = {} end
pro.style[1] = skin
pro.style[2] = gloss
pro.style[3] = backdrop
pro.style[4] = colors
end
end
 
--[[---------------------------------------------------------------------------------
Main Methods
------------------------------------------------------------------------------------]]
128,7 → 149,9
end
 
function Bison:AddButtons( biGrp, info)
self:Debug(info)
local bar = GetBar( info)
self:Debug(bar)
if self.db.profile[bar] then
self[bar]:AddButtons( biGrp)
end