View Single Post
07-08-09, 11:40 AM   #4
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
That's probably a bug in the logic.

Most of nUI's modules try to avoid unnecessary screen updates (which are relatively expensive) by caching their states and performing a relatively inexpensive test to see if the state changed before doing anything that would cause a screen update.

In the case of cooldowns, when the text that is to be displayed on the button changes, I call "SetText()" to update the button face, then set button.text = newValue; -- as long as the text remains the same as what "button.text" says it is displaying, I don't update the button face.

My guess (I'm at work, so I can't look at the code, but you can confirm this pretty quickly) is that when the display feature is turned off via the slash command, I am setting the text to "" by calling SetText( "" ) but I am not updating the cached value. So, when you turn the cooldown back on, it doesn't realize the button text is empty and so it doesn't set the cooldown text again until it changes from the last stored value.

Follow that? Take a look at [ nUI > Bars > nUI_Button.lua ] and look for either layer.cooldown:SetText() or cdc:SetText() and you should see where I am testing if the text changed and probably also testing to see if the feature is turned off via slash command.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/