Quantcast Help getting cooldown to show on totem icons... - WoWInterface
Thread Tools Display Modes
12-11-14, 07:20 PM   #1
Dakini
A Defias Bandit
 
Dakini's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 2
Help getting cooldown to show on totem icons...

Basically I setup a totem module today, but I can't get cooldown spirals to show, even tho I am following the guide.

Here's my totem code:
Code:
local function addTotemBar(self)
	local Totems = {}
	
	for i = 1, MAX_TOTEMS do
		local Totem = CreateFrame("Button", nil, self)
		Totem:SetSize(20, 20)
		Totem:SetBackdrop(backdrop)
		Totem:SetBackdropColor(0, 0, 0)
		
		local Icon = Totem:CreateTexture(nil, "OVERLAY")
		Icon:SetAllPoints()
		Icon:SetTexCoord(.1, .9, .1, .9)
		
		local Cooldown = CreateFrame("Cooldown", nil, Totem)
		Cooldown:SetAllPoints()
		
		if i == 1 then
			Totem:SetPoint("TOPLEFT", self.Health, "BOTTOMLEFT", 0, -8)
		else
			Totem:SetPoint("LEFT", Totems[i-1], "RIGHT", 5, 0)
		end
		
		Totem.Icon = Icon
		Totem.Cooldown = Cooldown
		Totems[i] = Totem
	end

	self.Totems = Totems
end
  Reply With Quote
12-11-14, 10:21 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I believe you either need to inherit from a predefined cooldown template:

Code:
local Cooldown = CreateFrame("Cooldown", nil, Totem, "CooldownFrameTemplate")
...or manually set the correct textures on your cooldown object; you can see the default ones in Cooldown.xml. I'd suggest just inheriting from the template.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
12-11-14, 10:30 PM   #3
Dakini
A Defias Bandit
 
Dakini's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 2
I was so confused because I copied the example from totems.lua and it didn't work. Your suggested fix does work, thank you so much
  Reply With Quote
12-12-14, 02:15 AM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,026
It's a thing that was changed with 6.0. I've updated the example to include the template.
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Help getting cooldown to show on totem icons...

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off