View Single Post
12-04-08, 08:23 PM   #289
Adalyn
A Kobold Labourer
Join Date: Apr 2008
Posts: 1
I'm some crazy person doing crazy stuffs.

anyways im trying to create statusbars for target debuffs and from what I can tell I have the code correct, but I could be wrong.

Code:
local auraUpdate = function(self, icons, unit, icon, index, offset, filter, isDebuff)
	local name, rank, texture, count, dtype, duration, timeLeft, isPlayer = UnitAura(unit, index, "HARMFUL|PLAYER")
	
	icon.bar:SetMinMaxValues(0, duration)
	icon.bar:SetValue(timeLeft - GetTime())
end

local auraBar = function(self, button, index, isDebuff)
	local count = button.count
	count:ClearAllPoints()
	count:SetPoint("BOTTOM")
	
	local bar = CreateFrame("StatusBar", nil, button)
	bar:SetWidth(100)
	bar:SetHeight(button.icon:GetHeight())
	bar:SetStatusBarTexture(horizont)
	bar:SetBackdrop{
		bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
		insets = {left = -1.5, right = -1.5, top = -1.5, bottom = -1.5},
	}
	bar:SetBackdropColor(0, 0, 0, 0.4)
	bar:SetPoint("LEFT", button.icon, "RIGHT", 0, 0)

	button.bar = bar
	
	button.icon:SetTexCoord(0.07, 0.93, 0.07, 0.93)
end
the debuffs icon shows up, and the duration cooldown shows up fine, but no statusbar. adding print(timeLeft - GetTime()) to the auraUpdate function sucessfully prints what the statusbar value should be....