WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   round Icons back to square (https://www.wowinterface.com/forums/showthread.php?t=58874)

rulezyx 08-03-21 01:00 PM

round Icons back to square
 
Hello,

aside from the player portraits there are a few round icons in the default UI which I want to change back to square,

but that cant be done by just replacing the Icon-Textures (Folder).

Basically I want to change them back to square so they match my frames.

(Left)Example with default shape (round)
(Left)Example with edited shape (square)

I was able to locate the GroupFinder Icons but for most other frames like the TalentFrame,

example: PlayerTalentFrameSpecializationSpellScrollFrameScrollChildAbility1Icon

I get a "a nil value" error.

Example Round-Icons TalentFrame

Code:

GroupFinderFrameGroupButton1Icon:SetTexCoord(0.85, 0.15, 0.15, 0.85)
GroupFinderFrameGroupButton1Icon:SetScale(0.70)
GroupFinderFrameGroupButton2Icon:SetTexCoord(0.85, 0.15, 0.15, 0.85)
GroupFinderFrameGroupButton2Icon:SetScale(0.70)
GroupFinderFrameGroupButton3Icon:SetTexCoord(0.85, 0.15, 0.15, 0.85)
GroupFinderFrameGroupButton3Icon:SetScale(0.70)

I never reshaped icons before and I am unsure if some of these textures are protected but maybe someone knows a better solution for this. :)

SDPhantom 08-04-21 12:05 AM

Blizzard_TalentUI creates PlayerTalentFrame, which it marked as LoD.

Blizzard_TalentUI.lua:248 calls SetPortraitToTexture(), which is the function that applies the circular mask. This line specifically sets the icons for the spec list on the left side. For the details pane, line 1156 sets the spec icon in the description and line 1267 sets the icons for the ability list.

rulezyx 08-04-21 06:28 AM

Ok ty, I forgot that SetPortraitToTexture exist.

I already changed the Classes-Circles texture to squares but it doesn't seem to affect the outcome.

At first I thought it will use the texture as a template to create the round shape.:rolleyes:

Latest Blizzard-textures in my UI are custom made and I also tried to get most of my issues done by making matching textures for almost everything possible.

Quote:

local _, class = UnitClass("player");
self:SetPortraitTextureRaw("Interface\\TargetingFrame\\UI-Classes-Circles");
self:SetPortraitTexCoord(unpack(CLASS_ICON_TCOORDS[strupper(class)]));

The last part seems to apply the metrics.

Basically I want to make all the round icons back to squares without affecting the portraits(avatar-prieview)frames which are supposed to be round like my targetframes.

There are quite a few frames:

Talentframe (Icons)
PvPQueue (Rewards, Icons)
ChallangesFrame (Affixes)
Encounterjournal (Suggesting-, Legendarypage)
Store (Icons)

Do you know any easy solution to achieve this?

Miiru did something similar with MiirGui but with changing Playerportraits too.

SDPhantom 08-04-21 05:26 PM

Looks like PlayerTalentFrame inherits PortraitFrameMixin. Neither PortraitFrameMixin:SetPortraitTextureRaw() nor PortraitFrameMixin:SetPortraitTexCoord() call SetPortraitToTexture() while PortraitFrameMixin:SetPortraitToAsset() does.

Digging through the art files reveals that the image itself was created with the circular mask, meaning you'll need to swap to a different image instead. You could probably swap the texture with "Interface\Glues\CharacterCreate\UI-CharacterCreate-Classes" using the same texcoords.

rulezyx 08-04-21 06:53 PM

I replaced/edited almost all textures within the UI and replaced all round icon-textures with square ones including UI-Classes-Circles.

There are some exceptions like the old garrision spec/role ones or round faction icons but these are not affecting those frames.

Also replacing the files in the Masks-Folder did nothing.

I am unsure if this can be done by just replacing textures since I can't find anything else related but maybe I am missing something.

SDPhantom 08-05-21 01:28 AM

I don't think it's going to work purely from texture replacements, you're going to have to run some Lua code.
You'll need to run PortraitFrameMixin:SetPortraitTextureRaw() for every frame that calls PortraitFrameMixin:SetPortraitToAsset(). and pass it the same texture path.

rulezyx 08-09-21 12:16 AM

Ok that makes sense but I still dont get the PortraitFrameMixin:SetPortraitToAsset() part.

I was doing a bit of research but couldn't find much about replacing/changing that for so many different parts.

I will probably just do the textcoords for possible icons and resizing the other ones because for lua its obv hard where to start and too much frames involved which is a bit to far for my bad knowledge.

Thank you for the links:)


All times are GMT -6. The time now is 05:04 PM.

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