WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Kgpanels border color script (https://www.wowinterface.com/forums/showthread.php?t=50582)

Verisnia 11-25-14 06:17 PM

Kgpanels border color script
 
I've been trying to set a script to change the colour of the panel borders to class colours when I log onto any character (any class). Whenever I first login, the border colour has reset itself to the borders normal colour of white. The script I currently have that is headed in the right direction (sort of, I suppose) is this below.


Lua Code:
  1. local _,class = UnitClass("player")
  2.  
  3. self:SetBackdropBorderColor(RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b)


Am I missing something or just being silly like usual?

Ekaterina 11-26-14 10:19 PM

You're on the right track - just add that to kgpanels onload scripts. Although I'd recommend adding a reference to CUSTOM_CLASS_COLORS, just so that you don't have to re-write your scipts if you choose to start altering the class colors.

lua Code:
  1. local _, Class = UnitClass("player")
  2. local Color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[Class]
  3. self:SetBackdopBorderColor(Color.r, Color.g, Color.b)


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

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