View Single Post
09-30-12, 06:43 AM   #39
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
I *think* I have the extra action button sorted out... but, like the vehicle exit button, I crapped out last night before I could test it.

Here's a few snippets of the code (not all of it, or exact, as that gets a bit crazy with all the nUI6isms) I'm using a single button action bar for this...

Code:
        local extraButton  = CreateFrame( "CheckButton", buttonName, parent, "ExtraActionButtonTemplate" );

          local children = { extraButton:GetRegions() };
        
        extraButton:SetAttribute( "action", nil );
        extraButton:SetID( 1 );
        
        -- find the decorative art around the button and hide it

          for i,child in ipairs( children ) do
            
            if child.GetTexture 
            then
                if child:GetTexture() == "Interface\\UnitPowerBarAlt\\SpellPush-Frame"
                then
                    child:Hide();
                end
            end
        end

          extraButton:SetParent( actionBar:GetParent() );
        actionBar:SetParent( extraButton );
                
        actionBar:SetScript( "OnShow", 
        
            function()        
                extraButton.style:SetTexture( GetOverrideBarSkin() or DefaultExtraActionStyle );
                ActionButton_UpdateUsable( extraButton );
            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/