I got a button with Textures:
Lua Code:
-- friend = frame
local name = friend:GetName().."FavoritesButton"
local texture = "Interface\\Miscellaneous\\UI-Advanced-Friends-Frame-Favorites-Button"
local button = CreateFrame("Button", name, friend)
button:SetNormalTexture(texture.."-".."Normal")
button:SetPushedTexture(texture.."-".."Pushed")
button:SetHighlightTexture(texture.."-".."Highlight")
button:SetHitRectInsets(4, 4, 2, 2);
button:SetSize(32, 32)
This code makes a button with 3 textures - normal, pushed, and highlight. But when i /framestack and inspect this buttons, they are made without name, so texture names looks like this: FriendsFrameFriendsScrollFrameButton1FavoritesButton.0000000001d8293f80
FriendsFrameFriendsScrollFrameButton1FavoritesButton.0000000001d8293fd0
FriendsFrameFriendsScrollFrameButton1FavoritesButton.0000000001d8293fk0
But i would like to name this texture, to make them readable like this: FriendsFrameFriendsScrollFrameButton1FavoritesButtonNormalTexture
FriendsFrameFriendsScrollFrameButton1FavoritesButtonPushedTexture
FriendsFrameFriendsScrollFrameButton1FavoritesButtonHighlightTexture
I know that it's possible to make with XML:
Code:
<Frame name="FriendsFrameFriendsScrollFrameButton">
<Button name="$parentFavoritesButton">
<Size x="32" y="32"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset x="0" y="0"/>
</Anchor>
</Anchors>
<NormalTexture name="$parentNormalTexture" file="Interface\FriendsFrame\TravelPass-Invite">
<Size x="32" y="32"/>
<TexCoords left="0.01562500" right="0.39062500" top="0.27343750" bottom="0.52343750"/>
</NormalTexture>
<PushedTexture name="$parentPushedTexture" file="Interface\FriendsFrame\TravelPass-Invite">
<Size x="32" y="32"/>
<TexCoords left="0.42187500" right="0.79687500" top="0.27343750" bottom="0.52343750"/>
</PushedTexture>
<DisabledTexture name="$parentDisabledTexture" file="Interface\FriendsFrame\TravelPass-Invite">
<Size x="32" y="32"/>
<TexCoords left="0.01562500" right="0.39062500" top="0.00781250" bottom="0.25781250"/>
</DisabledTexture>
<HighlightTexture name="$parentHighlightTexture" file="Interface\FriendsFrame\TravelPass-Invite" alphaMode="ADD">
<Size x="32" y="32"/>
<TexCoords left="0.42187500" right="0.79687500" top="0.00781250" bottom="0.25781250"/>
</HighlightTexture>
<Scripts>
-- ...
</Scripts>
</Button>
</Frame>
But i can't figure if it's possible to make in Lua. If it's possible, could you please point me, how can i make it. As always, I will very appreciate your help.