WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   VertexColor (https://www.wowinterface.com/forums/showthread.php?t=56446)

numberzero2 07-26-18 09:35 AM

VertexColor
 
Hello!

I'm having problems to set a vertex color to some Blizzard frames. For the majority of frames this code work, but some doesn't, Idk if this is a blizzard problem or I'm doing something wrong to those frames, maybe I don't have permission to change them?

Example of a code that doesn't change the vertex color:
Lua Code:
  1. for i, v in pairs({ CollectionsJounalTopBorder, CollectionsJounalRightBorder,
  2.     CollectionsJounalLeftBorder, CollectionsJounalBottomBorder }) do
  3.     v:SetVertexColor("some random color preset you choose")
  4. end

Someone can help me if this? Thanks in advance.

Fizzlemizz 07-26-18 09:50 AM

There's an r in Journal.

numberzero2 07-26-18 10:38 AM

Quote:

Originally Posted by Fizzlemizz (Post 329011)
There's an r in Journal.

Ops bad example my bad. This one doesn't work too:
Lua Code:
  1. for i, v in pairs({ PlayerTalentFrameTopBorder, PlayerTalentFrameRightBorder,
  2.     PlayerTalentFrameLeftBorder, PlayerTalentFrameBottomBorder }) do
  3.     v:SetVertexColor("some random color preset you choose")
  4. end

Fizzlemizz 07-26-18 10:49 AM

Works for me:
The frame also has
PlayerTalentFrameBtnCornerLeft and PlayerTalentFrameBtnCornerRight plus others inherited from other templates.

numberzero2 07-26-18 11:02 AM

Quote:

Originally Posted by Fizzlemizz (Post 329014)
Works for me:
The frame also has
PlayerTalentFrameBtnCornerLeft and PlayerTalentFrameBtnCornerRight plus others inherited from other templates.

It work, but don't change the color. Try to change to (.1, .1, .1)

Fizzlemizz 07-26-18 11:10 AM

Try to change to (1, 0, 0),

.1, .1, .1 makes them pretty much black

numberzero2 07-26-18 11:21 AM

Quote:

Originally Posted by Fizzlemizz (Post 329016)
Try to change to (1, 0, 0),

.1, .1, .1 makes them pretty much black

Worked for you? for me the color doesn't change (stay the blizzard gray dafault). Man this make me sad. Thanks for the help. I will see if I can make it work here too.

Fizzlemizz 07-26-18 11:59 AM

Code:

/run for i, v in pairs({ PlayerTalentFrameTopBorder, PlayerTalentFrameRightBorder,PlayerTalentFrameLeftBorder,PlayerTalentFrameBottomBorder,PlayerTalentFrameBtnCornerLeft,PlayerTalentFrameBtnCornerRight }) do v:SetVertexColor(1, 0, 0) end
Maybe you're setting the colour too early and it's being changed back.

numberzero2 07-26-18 12:15 PM

Weird, by using a run command it work, but when I put this in a Lua code doesn't. Any idea why this is happening?
I will try to set a timer to this one and see if it change. (Edit: Didn't work)

numberzero2 07-26-18 12:33 PM

Quote:

Originally Posted by numberzero2 (Post 329020)
Weird, by using a run command it work, but when I put this in a Lua code doesn't. Any idea why this is happening?
I will try to set a timer to this one and see if it change. (Edit: Didn't work)

Looks like it need to be open/load first (the frame), so you can change the color. I opened that frame and put a 15sec timer to run the command in lua, it worked. Any solution?

numberzero2 07-26-18 12:42 PM

Quote:

Originally Posted by Fizzlemizz (Post 329018)
Code:

/run for i, v in pairs({ PlayerTalentFrameTopBorder, PlayerTalentFrameRightBorder,PlayerTalentFrameLeftBorder,PlayerTalentFrameBottomBorder,PlayerTalentFrameBtnCornerLeft,PlayerTalentFrameBtnCornerRight }) do v:SetVertexColor(1, 0, 0) end
Maybe you're setting the colour too early and it's being changed back.

This seems to work, but have to be a better option.
Lua Code:
  1. C_Timer.After(1, function()
  2. TalentMicroButton:Click()
  3. end)
  4. C_Timer.After(1.5, function()
  5.     for i, v in pairs({ PlayerTalentFrameTopBorder, PlayerTalentFrameRightBorder,
  6.         PlayerTalentFrameLeftBorder, PlayerTalentFrameBottomBorder,
  7.         PlayerTalentFramePortraitFrame, PlayerTalentFrameTopRightCorner,
  8.         PlayerTalentFrameBtnCornerLeft,  }) do
  9.             v:SetVertexColor(.1, .1, .1)
  10.              PlayerTalentFrameCloseButton:Click()
  11.     end
  12. end)

Fizzlemizz 07-26-18 12:54 PM

The TalentUI is Load On Demand (the frames and code don't get loaded until you press N or click the talent menu)

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("ADDON_LOADED")
  3. f:SetScript("OnEvent", function(self, event, name)
  4.     if name == "Blizzard_TalentUI" then
  5.         for i, v in pairs({ PlayerTalentFrameTopBorder, PlayerTalentFrameRightBorder, PlayerTalentFrameLeftBorder, PlayerTalentFrameBottomBorder, PlayerTalentFrameBtnCornerLeft, PlayerTalentFrameBtnCornerRight }) do
  6.             v:SetVertexColor(.1, .1, .1)
  7.         end
  8.     end
  9. end)

numberzero2 07-26-18 01:18 PM

Thank you, now it's working the way I wanted.

One last question, how can I find those events for others frames? Like the collection one.

Again thank you for the help.

Fizzlemizz 07-26-18 01:22 PM

The event will remain the same, the name will change.

https://wow.gamepedia.com/Viewing_Bl...interface_code

Once you've exported the code section there will be an addons folder that contains all the Bizzard_xxx addons. You can check their .toc files to see if they are marked

## LoadOnDemand: 1

numberzero2 07-26-18 01:54 PM

Quote:

Originally Posted by Fizzlemizz (Post 329026)
The event will remain the same, the name will change.

https://wow.gamepedia.com/Viewing_Bl...interface_code

Once you've exported the code section there will be an addons folder that contains all the Bizzard_xxx addons. You can check their .toc files to see if they are marked

## LoadOnDemand: 1

Ok Thank you.


All times are GMT -6. The time now is 05:24 AM.

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