/trunk
------------------------------------------------------------------------------------]] |
local updateTimeBuff = 0 |
local updateTimeWeapon = 0.1 |
local flashTime = 0 |
local flashState = true |
local alphaValue = 1 |
--[[--------------------------------------------------------------------------------- |
BisonButton |
self:Tooltip() |
end |
end |
self:Alpha( alphaValue) |
self:SetFlashing() |
end |
function BisonButton:Duration() |
end |
end |
function BisonButton:Alpha( alpha) |
if self.bar.values.flashing and self.timeLeft and self.timeLeft < BUFF_WARNING_TIME then |
self:SetAlpha( alpha) |
function BisonButton:SetFlashing() |
local shouldFlash = self.bar.values.flashing and self.timeLeft |
if shouldFlash then |
if self.duration and self.duration < BUFF_WARNING_TIME then |
shouldFlash = self.timeLeft < self.duration/2 |
else |
shouldFlash = self.timeLeft < BUFF_WARNING_TIME |
end |
end |
if shouldFlash then |
if not UIFrameIsFading(self) then |
UIFrameFlash(self, 0.2, 0.2, self.timeLeft, true, 0, 0.7) |
end |
else |
self:SetAlpha( 1.0) |
self:SetAlpha(1) |
UIFrameFlashRemoveFrame(self) |
end |
end |
local name, rank, texture, count, debuffType, duration, expiration = UnitAura( PlayerFrame.unit, self:GetID(), self.buffFilter) |
if name then |
self.buffName = name |
self.duration = duration |
if duration > 0 and expiration then |
self.timeLeft = expiration - GetTime() |
else |
end |
self:Duration() |
self:Texture( texture) |
self:Alpha( 1.0) |
self:SetFlashing() |
self:Count( count) |
self:Border( name, debuffType) |
self:Show() |
else |
self.buffName = nil |
self.timeLeft = nil |
self.duration = nil |
self:Duration() |
self:Texture( nil) |
self:Count( 0) |
if hasEnchant then |
self.buffName = '' |
self.timeLeft = timeLeft and (timeLeft / 1000) |
self.duration = 0 |
self:Duration() |
self:Texture( GetInventoryItemTexture( PlayerFrame.unit, self:GetID())) |
self:Count( charges) |
else |
updateTimeBuff = updateTimeBuff - elapsed |
end |
flashTime = flashTime - elapsed |
if flashTime < 0 then |
flashTime = flashTime + (flashState and BUFF_FLASH_TIME_OFF or BUFF_FLASH_TIME_ON) |
flashState = not flashState |
end |
if flashState then |
alphaValue = (BUFF_FLASH_TIME_ON - flashTime) / BUFF_FLASH_TIME_ON |
else |
alphaValue = flashTime / BUFF_FLASH_TIME_ON |
end |
alphaValue = (alphaValue * (1 - BUFF_MIN_ALPHA)) + BUFF_MIN_ALPHA |
end |
function BisonBar:OnUpdateWeapon( elapsed) |
else |
updateTimeWeapon = updateTimeWeapon - elapsed |
end |
btnMain:Alpha( alphaValue) |
btnOff:Alpha( alphaValue) |
btnMain:SetFlashing() |
btnOff:SetFlashing() |
end |
function BisonBar:AddButtons( biGrp) |