Thread Tools Display Modes
05-17-21, 03:02 AM   #1
pinkney
A Defias Bandit
Join Date: May 2021
Posts: 3
Issue Changing CraftFrame Colors

I have an addon (Lorti-UI-Classic) that recolors the default WoW UI frames. However it's not applied to the craft frame and tradeskill frames. I am trying to add that.

Here's an example of the code it has that successfully recolors the Character frame:

--PAPERDOLL/Characterframe
local a, b, c, d, _, e = PaperDollFrame:GetRegions()
for _, v in pairs({a, b, c, d, e

})do
v:SetVertexColor(.35, .35, .35)
end


When I try to do the same to the CraftFrame window, it throws a Lua error.

The code I used is basically the same as above:

--CraftFrame
local a, b, c, d, _, e = CraftFrame:GetRegions()
for _, v in pairs({a, b, c, d, e

})do
v:SetVertexColor(.35, .35, .35)
end


I used "/framestack" to get the names of the windows. I did it for CraftFrame and TradeFrame. The error says:

Message: Interface\AddOns\Lorti-UI-Classic\core\frames.lua:383: attempt to index global 'CraftFrame' (a nil value)

Even if I try to just manually set the region windows without the loop, it still doesn't seem to work. However there is no error -- I think it just doesn't recolor anything.

Any ideas? Thanks in advance!

Last edited by pinkney : 05-17-21 at 05:57 AM.
  Reply With Quote
05-17-21, 03:49 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
I'm confused. What frame and what error belong together?

For the Lua-Error "Message: Interface\AddOns\Lorti-UI-Classic\core\frames.lua:383: attempt to index global 'ChatFrame' (a nil value)"

Thats because there is not one chatframe but as many as you create.
NUM_CHAT_WINDOWS represents the number of chatframes and the name would be "ChatFrame1" to "ChatFrameN".
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
05-17-21, 04:17 AM   #3
pinkney
A Defias Bandit
Join Date: May 2021
Posts: 3
I'm sorry I put "ChatFrame" but it's actually "CraftFrame."

Interface\AddOns\Lorti-UI-Classic\core\frames.lua:382: attempt to index global 'CraftFrame' (a nil value)
  Reply With Quote
05-17-21, 05:45 AM   #4
pinkney
A Defias Bandit
Join Date: May 2021
Posts: 3
I think I narrowed something down... when I do:

/dump CraftFrame:GetRegions()

It throws an error. However, if I open the CraftFrame (my enchanting window) and then re-run the command, it returns a value.

I guess I need the re-coloring to occur after the window has been opened? Or force open+close the window somehow on load? I dunno.
  Reply With Quote
05-17-21, 08:57 AM   #5
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
CRAFT_SHOW fires for it. Should be easy to wait for it.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Issue Changing CraftFrame Colors

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off