Thread Tools Display Modes
09-17-14, 07:16 PM   #1
evilbib
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 30
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?
  Reply With Quote
09-17-14, 07:23 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-17-14, 07:35 PM   #3
evilbib
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 30
Originally Posted by Phanx View Post
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>
  Reply With Quote
09-17-14, 08:19 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-17-14, 08:26 PM   #5
evilbib
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 30
Originally Posted by Phanx View Post
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!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GhostFrame Button Highlight

Thread Tools
Display Modes

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