WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   GhostFrame Button Highlight (https://www.wowinterface.com/forums/showthread.php?t=49921)

evilbib 09-17-14 07:16 PM

GhostFrame Button Highlight
 
Hi,

first of all my code:

Code:

GhostFrameContentsFrameIcon:SetTexCoord(0.07, 0.93, 0.07, 0.93)
GhostFrameContentsFrameText:SetFont(STANDARD_TEXT_FONT, 12, "OUTLINE")
GhostFrameContentsFrameText:SetShadowOffset(-1, 1)
GhostFrameContentsFrameText:SetShadowColor(0, 0, 0, 0)
GhostFrameLeft:SetVertexColor(0, 0, 0, 0)
GhostFrameMiddle:SetVertexColor(0, 0, 0, 0)
GhostFrameRight:SetVertexColor(0, 0, 0, 0)

GhostFrame:SetBackdrop( {
  bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
  edgeFile = nil,
  insets = { left = 3, right = 3, top = 3, bottom = 3 }
})

GhostFrame:SetBackdropColor(0, 0, 0, 0.7)
GhostFrameContentsFrame:CreateBeautyBorder(11)
GhostFrameContentsFrame:SetBeautyBorderPadding(-2)

But the border is infront of the highlight texture...
My problem is that I cant figure out how to change the highlight texture of the GhostFrame Button.
Any suggestions?

Phanx 09-17-14 07:23 PM

The GhostFrame inherits from the UIPanelLargeSilverButton, so you'll need to look at that to find the highlight texture. It's actually three textures (one for the left end, one for the right end, and another stretched between them for the middle) so you'll need to change each one individually, or get rid of them all and add a single one if you prefer that.

evilbib 09-17-14 07:35 PM

Quote:

Originally Posted by Phanx (Post 296845)
The GhostFrame inherits from the UIPanelLargeSilverButton, so you'll need to look at that to find the highlight texture. It's actually three textures (one for the left end, one for the right end, and another stretched between them for the middle) so you'll need to change each one individually, or get rid of them all and add a single one if you prefer that.

Found them but how do I change them if they have the same names as the normal textures?

Code:

                <Layers>
                        <Layer level="BACKGROUND">
                                <Texture name="$parentLeft" file="Interface\Buttons\UI-SilverButtonLG-Left-Up">
                                        <Size>
                                                <AbsDimension x="32" y="64"/>
                                        </Size>
                                        <Anchors>
                                                <Anchor point="TOPLEFT" x="0" y="0"/>
                                        </Anchors>
                                </Texture>
                                <Texture name="$parentRight" file="Interface\Buttons\UI-SilverButtonLG-Right-Up">
                                        <Size>
                                                <AbsDimension x="32" y="64"/>
                                        </Size>
                                        <Anchors>
                                                <Anchor point="TOPRIGHT" x="0" y="0"/>
                                        </Anchors>
                                </Texture>
                                <Texture name="$parentMiddle" file="Interface\Buttons\UI-SilverButtonLG-Mid-Up">
                                        <Size>
                                                <AbsDimension x="32" y="64"/>
                                        </Size>
                                        <Anchors>
                                                <Anchor point="TOPLEFT" relativeTo="$parentLeft" relativePoint="TOPRIGHT" x="0" y="0"/>
                                                <Anchor point="TOPRIGHT" relativeTo="$parentRight" relativePoint="TOPLEFT" x="0" y="0"/>
                                        </Anchors>
                                </Texture>
                        </Layer>
                        <Layer level="HIGHLIGHT">
                                <Texture name="$parentLeft" file="Interface\Buttons\UI-SilverButtonLG-Left-Hi">
                                        <Size>
                                                <AbsDimension x="32" y="64"/>
                                        </Size>
                                        <Anchors>
                                                <Anchor point="TOPLEFT" x="0" y="0"/>
                                        </Anchors>
                                </Texture>
                                <Texture name="$parentRight" file="Interface\Buttons\UI-SilverButtonLG-Right-Hi">
                                        <Size>
                                                <AbsDimension x="32" y="64"/>
                                        </Size>
                                        <Anchors>
                                                <Anchor point="TOPRIGHT" x="0" y="0"/>
                                        </Anchors>
                                </Texture>
                                <Texture name="$parentMiddle" file="Interface\Buttons\UI-SilverButtonLG-Mid-Hi">
                                        <Size>
                                                <AbsDimension x="32" y="64"/>
                                        </Size>
                                        <Anchors>
                                                <Anchor point="TOPLEFT" relativeTo="$parentLeft" relativePoint="TOPRIGHT" x="0" y="0"/>
                                                <Anchor point="TOPRIGHT" relativeTo="$parentRight" relativePoint="TOPLEFT" x="0" y="0"/>
                                        </Anchors>
                                </Texture>
                        </Layer>
                </Layers>


Phanx 09-17-14 08:19 PM

Well that's some lazy programming, even for Blizzard... fortunately you can access all of a frame's regions and children even if they don't have names and/or keys:

Code:

local bgLeft, bgRight, bgMiddle, highlightLeft, highlightRight, highlightMiddle = GhostFrame:GetRegions()
local contentsFrame = GhostFrame:GetChildren()
local text, icon = contentsFrame:GetRegions()

They're returned in the order they're created. If the GhostFrame had any regions directly on it, they'd come after all the regions it inherits from its template.

evilbib 09-17-14 08:26 PM

Quote:

Originally Posted by Phanx (Post 296848)
Well that's some lazy programming, even for Blizzard... fortunately you can access all of a frame's regions and children even if they don't have names and/or keys:

Code:

local bgLeft, bgRight, bgMiddle, highlightLeft, highlightRight, highlightMiddle = GhostFrame:GetRegions()
local contentsFrame = GhostFrame:GetChildren()
local text, icon = contentsFrame:GetRegions()

They're returned in the order they're created. If the GhostFrame had any regions directly on it, they'd come after all the regions it inherits from its template.

Thanks got it! ;)


All times are GMT -6. The time now is 09:23 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI