Setting Class Icon via SetAtlas and GetClassAtlas doesn't seem to work for me
As the title says.
I've been trying to create a custom unit frame piece by piece ( for reasons - have you seen nUI's archaic code? rofl ) and have stumbled on the portrait part. Based on Blizzards code here : https://github.com/Gethe/wow-ui-sour...Frame.lua#L166 I have a simple frame with a texture which accepts the SetPortraitTexture image quite fine. However, when I toggle on 'ReplaceMyFramePortrait' interface option and use the following code to use a different image it doesn't work. My first attempt was this, which correctly retrieved the value from the GetCVar function and the classIconAtlas is set to classicon-WARLOCK which I can assume is correct as that is Blizzards function. Now, the Blizzard PlayerFrame correctly makes the change, however, mine does not. Lua Code:
So, I thought I would try a different route, as I can see from https://github.com/Gethe/wow-ui-text...ree/live/ICONS that the class icons individual files still exist. Now my test character was a warlock and the file for her comes up as ICONS\ClassIcon_Warlock.png so I tried the following code. And it worked. Lua Code:
So, the question is, does anyone know if there is some special setup for a texture to have to make atlas functions work ? Blizzard seems to be using them more nowadays so thought I better get to figuring them out rofl. Thanks in advance. |
Maybe I'm missing something but this always ends up at SetPortraitTexture
Lua Code:
Possibly something like: Lua Code:
|
oh my .. I totally forgot the return statement. I thought it was supposed to lead back to that line with the atlas doing its stuff behind the scenes ..
Thanks, made me check their code again as I thought I had done the exact same thing they did rofl. Lua Code:
Ended up doing this in my code. It shouldn't get to the useClassIcon else statements but if they do they're covered with the old fashioned class icon files ( until they disappear ) unless the class part fails for some strange reason. With the "player" part replaced with unitFrame.unit for completeness ( not that I have the other units working yet rofl.) Lua Code:
|
All times are GMT -6. The time now is 08:42 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI