View Single Post
10-09-12, 07:08 PM   #53
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Xrystal --

I think I have found a reliable way to display the vehicle exit button (at least it's worked for me so far)

Here's the snippet I'm using...

Code:
        local actionBar = CreateFrame( "Frame", "nUI6_VehiceExitBar", nUI6_UIParent, "SecureHandlerStateTemplate" );
        local exitButton = CreateFrame( "Button", "nUI6_VehicleExitButton", actionBar. "ActionButtonTemplate" );
        
        -- set button size, bar size, anchor points, blah blah blah

        exitButton:SetAttribute( "action", nil );
        exitButton.id = nil;
        
        exitButton:SetScript( "OnClick", VehicleExit );

        exitButton.icon:SetTexture( "Interface\\Vehicles\\UI-Vehicles-Button-Exit-Up" );
        exitButton:SetPushedTexture( "Interface\\Vehicles\\UI-Vehicles-Button-Exit-Down" );
        exitButton:SetHighlightTexture( "Interface\\Vehicles\\UI-Vehicles-Button-Highlight", "ADD" );
        exitButton:Show();

        local highlightTexture = exitButton:GetHighlightTexture();
        local pushedTexture = exitButton:GetPushedTexture();

        exitButton.icon:SetTexCoord( 0.140625, 0.859375, 0.140625, 0.859375 );
        pushedTexture:SetTexCoord( 0.140625, 0.859375, 0.140625, 0.859375 );
        highlightTexture:SetTexCoord( 0.130625, 0.879375, 0.130625, 0.879375 );
                
        RegisterStateDriver( exitButton, "visibility", "show" );
        RegisterStateDriver( actionBar, "visibility", "[vehicleui] show; [target=vehicle, exists] show; hide" );
Maybe you can use some of this for a better managed exit button than throwing it over the main action bar?
__________________

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/