WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   UnitReaction color (https://www.wowinterface.com/forums/showthread.php?t=56151)

GreyFox777 04-13-18 03:44 PM

UnitReaction color
 
Hello guys,

im trying to edit a name tag to work with color reaction, but no success. Can you help me to edit the code please?

Quote:

self.Name:SetTextColor(unpack(cfg.colors.health))
instead of cfg.colors.health it should be the reactiontable (i have it already). Im just don't know how to setup correctly the table.



Table:

Quote:

oUF.colors.reaction = {
[1] = {182/255, 34/255, 32/255},
[2] = {182/255, 34/255, 32/255},
[3] = {182/255, 92/255, 32/255},
[4] = {220/225, 180/255, 52/255},
[5] = {132/255, 181/255, 26/255},
[6] = {132/255, 181/255, 26/255},
[7] = {132/255, 181/255, 26/255},
[8] = {132/255, 181/255, 26/255},
}

Rainrider 04-14-18 04:17 AM

The tag function: https://github.com/Rainrider/oUF_Lay...gs.lua#L15-L31
Registering it with oUF: https://github.com/Rainrider/oUF_Lay.../tags.lua#L172
Setting up the events: https://github.com/Rainrider/oUF_Lay.../tags.lua#L173
Setting up the font strings (creation, placement, building a compound tag): https://github.com/Rainrider/oUF_Lay....lua#L195-L219
Attaching it to a unit frame: https://github.com/Rainrider/oUF_Lay...rimary.lua#L59

As for the colors, you are advised not to overwrite oUF colors directly but rather use a metatable. See here for an example.


All times are GMT -6. The time now is 07:48 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI