Thread Tools Display Modes
11-19-10, 10:42 AM   #1
tenub
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 111
Simple Lua Cooldowns

I'm trying to change a texture's color based on whether or not a certain ability is on cooldown or not. I'm able to easily do this for a buff in only a few lines of code. I'd imagine it may be just as easy to do for a cooldown, but it may take some more code which I am uncertain of. I'm looking for anyone who could help me or at least point me in the right direction.
  Reply With Quote
11-19-10, 11:07 AM   #2
henrik_s
Enhancement Shaman
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 19
Something like this:

Code:
if GetSpellCooldown("MyAwesomeSpell") > 0 then 
	texture:SetTexture(r, g, b)
else
	texture:SetTexture(r, g, b)
end
  Reply With Quote
11-19-10, 02:45 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by henrik_s View Post
Code:
texture:SetTexture(r, g, b)
If your texture already has an image loaded and you want to apply a color filter to it, you might want to look into using texture:SetVertexColor(r,g,b) instead.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
11-19-10, 03:43 PM   #4
tenub
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 111
Awesome! Just needed that GetSpellCooldown() function.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Simple Lua Cooldowns


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