View Single Post
03-11-24, 01:41 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
Both
Lua Code:
  1. for _, colorTable in pairs(RAID_CLASS_COLORS) do
and
Lua Code:
  1. local colorTable = RAID_CLASS_COLORS[class]
are making changes directly into the global RAID_CLASS_COLORS table. That will change the colour for everything else in the UI using RAID_CLASS_COLORS and it will always be black for everything.

All your actions in both PLAYER_LOGIN and UNIT_AURA just keep changing this global table's colours to black again and again....

Lua Code:
  1. colorTable.r, colorTable.g, colorTable.b = 0, 0, 0

is exactly the same as:

Lua Code:
  1. RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b = 0, 0, 0

and
Lua Code:
  1. colorTable.r, colorTable.g, colorTable.b = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b

is exactly the same as:

Lua Code:
  1. RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b

You need to work at the point you want to set the colour of a texture and decide what you want to do with colouring.
eg:
Lua Code:
  1. local classColor = RAID_CLASS_COLORS[class]
  2. if hasPowerWordShield then
  3.     sometexture:SetVertexColor(classColor.r, classColor.g, classColor.b) -- use default
  4. else
  5.     sometexture:SetVertexColor(0, 0, 0) -- set to black
  6. end

And don't do anything at PLAYER_LOGIN
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-11-24 at 04:34 PM.
  Reply With Quote