View Single Post
05-18-16, 02:22 PM   #1
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
GetTexture() returns nil on unloaded textures

I've been trying to fix Xinhuan's LargerMacroIconSelection (WowAce)
The license is All Rights Reserved though...

For some reason GetTexture() returns nil on anonymous texture objects?
  • For example, on Legion if I want to get the texture path for the texture below, it returns nil
    While on Live it returns "Interface\\MacroFrame\\MacroPopup-TopLeft"
Blizzard_MacroUI/Blizzard_MacroUI.xml#L330-L335
MacroFrame/MacroPopup-TopLeft.PNG
Code:
<Texture file="Interface\MacroFrame\MacroPopup-TopLeft">
	<Size x="256" y="256"/>
	<Anchors>
		<Anchor point="TOPLEFT"/>
	</Anchors>
</Texture>
Code:
/run UIParentLoadAddOn("Blizzard_MacroUI")
/dump ({MacroPopupFrame:GetRegions()})[1]:GetTexture() -- returns nil on Legion
-----
  • The addon checks for any textures on MacroPopupFrame, and then adds bigger textures.
    It will find the textures, but then it tries to get the non-existing texture paths, so it stops there.
LargerMacroIconSelection.lua#L218-L220
Code:
kids = {MacroPopupFrame:GetRegions()}
Code:
for _, child in ipairs(kids) do
	if child.GetTexture then
		if child:GetTexture() == "Interface\\MacroFrame\\MacroPopup-TopLeft" then
-----
Not sure if this is a bug or not and if it's in the right forum. (I'm a noob with texture stuff)
  • Live:

  • Legion: LargerMacroIconSelection didn't proceed adding the bigger textures
Attached Files
File Type: zip LargerMacroIconSelection-v1.0.3-legionfix1.zip (4.4 KB, 196 views)

Last edited by Ketho : 06-29-16 at 01:00 PM.