Thread: Macros in nUI
View Single Post
01-13-11, 05:20 PM   #13
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
I suspect the GetMacroItem() call is needed in the nUI6 code, too, to make it work with all macros.

EDIT: See if this code block works...

Code:
                -- is there a cooldown on the action and what is the name of the action itself?
                
                if buttonDetail.isPetButton then 
                
                    spellName          = GetPetActionInfo( button:GetID() );
                    spellType, spellId = spellName and GetSpellBookItemInfo( spellName, "pet" );
                    caster             = UnitExists( "vehicle" ) and "vehicle" or "pet";
                    
                else
                                    
                    spellType, spellId = GetActionInfo( button.action );
                    caster             = "player";
                    
                    if spellType == "macro" then
                        local item = spellId and GetMacroItem( spellId );
                        spellName  = (item and GetItemSpell( item )) or (spellId and GetMacroSpell( spellId ));
                    else
                        spellName = spellId and GetSpellInfo( spellId );
                    end
                    
                end

                if spellName then
                    start, duration, enable = GetSpellCooldown( spellName );
                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/

Last edited by spiel2001 : 01-13-11 at 05:26 PM.