Thread Tools Display Modes
06-02-09, 06:10 PM   #1
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
Erm Scott .. is this correct ?

While looking at a way to disable the duration timers for the other post I spotted this and I'm wondering if it is correct. It is in the nUI_Button.lua file around line 750. Sounds like is_usable should be set to false but I could be reading it wrong.


Code:
					elseif oom == 1 then 
						
						is_usable = true;
						is_oom    = true;
				
					end
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
 
06-02-09, 06:32 PM   #2
neuralassassin
A Scalebane Royal Guard
 
neuralassassin's Avatar
Join Date: Sep 2008
Posts: 423
I think that refers to is usable as in is in range or usable on a current target might be wrong though
__________________

 
06-02-09, 06:38 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
From what I could see is_oom is out of mana which would technically mean you can't use the action button due to lack of mana But we can see what Scott says
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
 
06-02-09, 06:53 PM   #4
neuralassassin
A Scalebane Royal Guard
 
neuralassassin's Avatar
Join Date: Sep 2008
Posts: 423
your right i meant the is usable as in is in range beacuse if its range it will show oom if out of range it would show that but as i said not sure we'll probably both be wrong
__________________


Last edited by neuralassassin : 06-02-09 at 06:56 PM.
 
06-02-09, 06:57 PM   #5
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
That is correct... what that "elseif oom == 1" means is that the reason the spell was unusable was because the player is out of mana, but otherwise the spell would be usable. So the is_usable is true and the is_oom is true which ends up lighting up the spell,m but coloring it blue to indicate you're OOM. Otherwise, if is_usable was false, the spell would be dimmed out as in "you can't use that on this target"
__________________

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/
 
06-02-09, 07:30 PM   #6
neuralassassin
A Scalebane Royal Guard
 
neuralassassin's Avatar
Join Date: Sep 2008
Posts: 423
Aha two points
__________________

 
06-02-09, 09:05 PM   #7
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
me is still confused with this conditionals *sigh* But as long as Scott says its doing what its supposed to Im happy
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
 
06-03-09, 09:57 PM   #8
neuralassassin
A Scalebane Royal Guard
 
neuralassassin's Avatar
Join Date: Sep 2008
Posts: 423
Its how nUI determines what color to make the button
oom false usable true: no color normal button
oom true usable true: button is blue (oom)
oom true usable false: button is red (not usable)
__________________

 
06-03-09, 10:09 PM   #9
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
ah now that I understood both have to be true to work .. hmm what if oom is false and usable is false ... equivalent to true ?
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
 
06-03-09, 10:18 PM   #10
neuralassassin
A Scalebane Royal Guard
 
neuralassassin's Avatar
Join Date: Sep 2008
Posts: 423
nope cause then your out of range so button would be red
__________________

 
06-04-09, 04:14 AM   #11
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
There's actually three variables at work...

is_oom -- out of mana
is_oor -- out of range
is_usable -- can currently be cast

is_usable = false, is_oor = any, is_oom = any -- button grayed out
is_usable = true, is_oor = true, is_oom = any -- button is red
is_usable = true, is_oor = false, is_oom = true -- button is blue
is_usable = true, is_oor = false, is_oom = false -- button is normal

Code:
 
                   -- color the icon based on the state we last calculated for it
                    -- I'd like to only do this when the state changes, but WoW's code
                    -- steps on our coloring if we don't do it every time
                    
                    if not is_usable then 
                        color = nUI_ButtonColors["UNUSABLE"] or nUI_DefaultConfig.ButtonColors["UNUSABLE"];
                        overlay.layers.icon:SetDesaturated( nil );
                        overlay.layers.icon:SetVertexColor( color.r, color.g, color.b, 1 );
                    elseif is_oor then
                        color = nUI_ButtonColors["OOR"] or nUI_DefaultConfig.ButtonColors["OOR"];
                        overlay.layers.icon:SetDesaturated( nil );
                        overlay.layers.icon:SetVertexColor( color.r, color.g, color.b, 1 );
                    elseif is_oom then
                        color = nUI_ButtonColors["OOM"] or nUI_DefaultConfig.ButtonColors["OOM"];
                        overlay.layers.icon:SetDesaturated( nil );
                        overlay.layers.icon:SetVertexColor( color.r, color.g, color.b, 1 );
                    else
                        overlay.layers.icon:SetDesaturated( nil );
                        overlay.layers.icon:SetVertexColor( 1, 1, 1, 1 );
                    end
__________________

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/
 
06-04-09, 04:45 AM   #12
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
Okay, think I got it .. Red = Out of Range, Blue = Out of Mana, Gray = Unusable. Rofl.

I'll get it someday. I'm one of those people that learn by using it and I think these notes help for when I do my next addon.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
 
 

WoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Support » nUI: Technical Support » Erm Scott .. is this correct ?


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