PDA

View Full Version : Need advice with Candybar


LordAstiroth
30-08-2008, 06:39 PM
Would someone advise me on how to best use candybar (or equivalent) timers?

I have added the timers to my addon, however, they are simply overlaying each other instead of stacking. Here is my lua:

if duration ~= nil then
if duration > 1.44 and enabled ~= 0 and WittyMage.db.profile.ShowSpellTimers and not active then

local color = WittyMage:FindSpellType(spellName)
local texture = GetSpellTexture(spellName, BOOKTYPE_SPELL)

if color == 1 then candybar:RegisterCandyBar(spellName.."CD", duration, spellName, texture, 0, 1, 0)
elseif color == 2 then candybar:RegisterCandyBar(spellName.."CD", duration, spellName, texture, 1, 0, 1)
elseif color == 3 then candybar:RegisterCandyBar(spellName.."CD", duration, spellName, texture, 1, 0, 0)
else candybar:RegisterCandyBar(spellName.."CD", duration, spellName, texture, 0, 0, 1)
end

candybar:SetCandyBarWidth(spellName.."CD", 135)
candybar:SetCandyBarHeight(spellName.."CD", 15)
candybar:RegisterCandyBarWithGroup(spellName.."CD", "Timers")

table.insert(WittyMage.Private.SpellTimers, spellName.."CD")

candybar:StartCandyBar(spellName.."CD", true)
candybar:SetCandyBarCompletion(spellName.."CD", TimerCompleted, spellName.."CD")

return candybar
end
end

LordAstiroth
31-08-2008, 11:25 PM
Nevermind, I figured it out.