/trunk
------------------------------------------------------------------------------------]] |
local BisonButton = Bison:CreateClass( 'Button') |
function BisonButton:New( bar, id, name) |
local b = self:Bind( CreateFrame( 'Button', name, bar)) |
function BisonButton:New( bar, id) |
local b = self:Bind( CreateFrame( 'Button', nil, bar)) |
b.bar = bar |
b.timeLeft = nil |
b:SetID( id) |
b:SetWidth( 30) |
b:SetHeight( 30) |
b.icon = b:CreateTexture( name..'Icon', 'BACKGROUND') |
b.icon = b:CreateTexture( nil, 'BACKGROUND') |
b.icon:SetPoint( 'TOPRIGHT') |
b.icon:SetPoint( 'BOTTOMLEFT') |
b.count = b:CreateFontString( name..'Count', 'BACKGROUND', 'NumberFontNormal') |
b.count = b:CreateFontString( nil, '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) |
return b |
end |
function BisonButton:NewBuff( bar, id, name) |
local b = self:New( bar, id, name) |
function BisonButton:NewBuff( bar, id) |
local b = self:New( bar, id) |
b:RegisterForClicks( 'RightButtonUp') |
b:SetScript( 'OnEnter', BisonButton.OnEnter) |
b:SetScript( 'OnShow', BisonButton.Update) |
return b |
end |
function BisonButton:NewDebuff( bar, id, name) |
local b = self:New( bar, id, name) |
function BisonButton:NewDebuff( bar, id) |
local b = self:New( bar, id) |
b:SetScript( 'OnEnter', BisonButton.OnEnter) |
b:SetScript( 'OnShow', BisonButton.Update) |
b:SetScript( 'OnUpdate', BisonButton.OnUpdate) |
return b |
end |
function BisonButton:NewWeapon( bar, id, name) |
local b = self:New( bar, id, name) |
function BisonButton:NewWeapon( bar, id) |
local b = self:New( bar, id) |
b:RegisterForClicks( 'RightButtonUp') |
b:SetScript( 'OnEnter', BisonButton.OnEnterWeapon) |
b:SetScript( 'OnClick', BisonButton.OnClickWeapon) |
for i = 1, size do |
local b |
if self.name == 'buff' then |
b = BisonButton:NewBuff( self, i + offset, 'BisonBuff'..i) |
b = BisonButton:NewBuff( self, i + offset) |
b:SetGhost( tostring( b:GetID()), 0.2, 0.8, 0.2) |
elseif self.name == 'debuff' then |
b = BisonButton:NewDebuff( self, i + offset, 'BisonDebuff'..i) |
b = BisonButton:NewDebuff( self, i + offset) |
b:AddBorder() |
b:SetGhost( tostring( b:GetID()), 0.8, 0.2, 0.2) |
elseif self.name == 'weapon' then |
b = BisonButton:NewWeapon( self, i + offset, 'BisonWeapon'..i) |
b = BisonButton:NewWeapon( self, i + offset) |
b:SetGhost( (b:GetID() == 17) and 'MH' or 'OH', 0.2, 0.2, 0.2) |
end |
b:Update() |
self:SetAnchors() |
end |
function BisonBar:Sort() |
table.sort( self.buttons, SORT[self.values.sort]) |
end |
function BisonBar:OnUpdate( elapsed) |
if updateTimeBuff < 0 then |
updateTimeBuff = updateTimeBuff + UPDATE_TIME_BUFF |
btnOff:Alpha( alphaValue) |
end |
function BisonBar:AddButtons( biGrp) |
for i,b in pairs( self.buttons) do |
biGrp:AddButton( b) |
end |
end |
function BisonBar:Sort() |
table.sort( self.buttons, SORT[self.values.sort]) |
end |
function BisonBar:RestoreSettings( locked, values) |
self.values = values |
self:ClearAllPoints() |
local last, lastFirst |
local row = 1 |
local col = 1 |
for i,b in pairs( self.buttons) do |
for i, b in pairs( self.buttons) do |
b:ClearAllPoints() |
if last and lastFirst then |
if self.values.horizontal then |
self:Print( self.version) |
end |
local function GetBar( info) |
return (type(info) == 'table') and info.arg or tostring(info) |
end |
function Bison:AddButtons( biGrp, info) |
local bar = GetBar( info) |
if self.db.profile[bar] then |
self[bar]:AddButtons( biGrp) |
end |
end |
--[[--------------------------------------------------------------------------------- |
Set/Get Methods |
------------------------------------------------------------------------------------]] |
self:SetEnabled( not self:IsEnabled()) |
end |
local function GetBar( info) |
return (type(info) == 'table') and info.arg or tostring(info) |
end |
function Bison:IsVisible( info) |
local bar = GetBar( info) |
return self.db.profile[bar] and self.db.profile[bar].show |
Bison.lua |
BuffBar.lua |
Options.lua |
Facade.lua |