/trunk
debuff = 16, |
weapon = 2, |
} |
-- interger as id's for correct select order on AceConfig dialogs |
local SORT_TYPES = { |
['none'] = 1, |
['alpha'] = 2, |
self.weapon = self.BisonBar:NewWeaponBar( self.db.profile.weapon) |
self.buff:CreateButtons( MAX_BUTTONS.buff, 0) |
self.debuff:CreateButtons( MAX_BUTTONS.debuff, 0) |
self.weapon:CreateButtons( MAX_BUTTONS.weapon, 16) |
self.weapon:CreateButtons( MAX_BUTTONS.weapon, 15) |
self:Update() |
self.db.RegisterCallback( self, 'OnNewProfile') |
self.db.RegisterCallback( self, 'OnProfileChanged') |
## X-Email: grayal@gmx.de |
## X-Category: Buffs |
## X-CompatibleLocales: enUS, enGB, deDE |
## Version: 1.3.0 |
## Version: 1.3.1 |
embeds.xml |
function BisonButton:UpdateWeapon( hasEnchant, timeLeft, charges) |
if hasEnchant then |
self.buffName = '' |
self.timeLeft = timeLeft and (timeLeft / 1000) |
self:Duration() |
self:Texture( GetInventoryItemTexture( PlayerFrame.unit, self:GetID())) |
self:Show() |
self:TooltipWeapon() |
else |
self.buffName = nil |
self.timeLeft = nil |
self:Duration() |
self:Texture( nil) |
function BisonBar:OnUpdateWeapon( elapsed) |
local btnMain, btnOff = self.buttons[1], self.buttons[2] |
if btnMain:GetID() == 18 then |
if btnMain:GetID() == 17 then |
btnMain, btnOff = btnOff, btnMain |
end |
if updateTimeWeapon < 0 then |
updateTimeWeapon = updateTimeWeapon + UPDATE_TIME_WEAPON |
local hasMainEnchant, mainExpiration, mainCharges, hasOffEnchant, offExpiration, offCharges = GetWeaponEnchantInfo() |
btnMain:UpdateWeapon( hasMainEnchant, mainExpiration, mainCharges) |
btnOff:UpdateWeapon( hasOffEnchant, offExpiration, offCharges) |
local mainEnchant, mainExpiration, mainCharges, offEnchant, offExpiration, offCharges = GetWeaponEnchantInfo() |
btnMain:UpdateWeapon( mainEnchant, mainExpiration, mainCharges) |
btnOff:UpdateWeapon( offEnchant, offExpiration, offCharges) |
else |
updateTimeWeapon = updateTimeWeapon - elapsed |
end |