mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-06 05:30:00 +00:00
class color cleanup
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
pfUI:RegisterModule("actionbar", "vanilla", function ()
|
||||
local _, class = UnitClass("player")
|
||||
local color = RAID_CLASS_COLORS[class]
|
||||
local cr, cg, cb = color.r , color.g, color.b
|
||||
local _, cr, cg, cb = GetUnitColor('player')
|
||||
local er, eg, eb, ea = GetStringColor(pfUI_config.appearance.border.color)
|
||||
|
||||
local backdrop_highlight = { edgeFile = pfUI.media["img:glow"], edgeSize = 8 }
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ pfUI:RegisterModule("afkcam", "vanilla:tbc", function ()
|
||||
local class = GetUnitData(arg2 or "")
|
||||
local author, msg
|
||||
if class and class ~= UNKNOWN then
|
||||
local class_color = rgbhex(RAID_CLASS_COLORS[class])
|
||||
local class_color = RAID_CLASS_COLORS[class]:GenerateHexColorMarkup()
|
||||
author = string.format("%s%s|r",class_color,arg2)
|
||||
else
|
||||
author = arg2
|
||||
|
||||
+2
-12
@@ -63,18 +63,8 @@ pfUI:RegisterModule("buff", "vanilla:tbc", function ()
|
||||
buff.texture:SetTexture(aura.icon)
|
||||
|
||||
if buff.btype == "HARMFUL" then
|
||||
local dtype = aura.dispelName
|
||||
if dtype == "Magic" then
|
||||
buff.backdrop:SetBackdropBorderColor(0,1,1,1)
|
||||
elseif dtype == "Poison" then
|
||||
buff.backdrop:SetBackdropBorderColor(0,1,0,1)
|
||||
elseif dtype == "Curse" then
|
||||
buff.backdrop:SetBackdropBorderColor(1,0,1,1)
|
||||
elseif dtype == "Disease" then
|
||||
buff.backdrop:SetBackdropBorderColor(1,1,0,1)
|
||||
else
|
||||
buff.backdrop:SetBackdropBorderColor(1,0,0,1)
|
||||
end
|
||||
local dispelColor = C_UnitAuras.GetAuraDispelTypeColor(aura.dispelName)
|
||||
buff.backdrop:SetBackdropBorderColor(dispelColor:GetRGBA())
|
||||
else
|
||||
buff.backdrop:SetBackdropBorderColor(br,bg,bb,ba)
|
||||
end
|
||||
|
||||
+6
-9
@@ -758,20 +758,17 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
|
||||
local real, _ = strsplit(":", name)
|
||||
local color = unknowncolorhex
|
||||
local match = false
|
||||
local class
|
||||
local guid = GetCurrentChatGUID()
|
||||
if guid then
|
||||
_, class = GetPlayerInfoByGUID(guid)
|
||||
end
|
||||
if not class then
|
||||
_, class = C_PlayerCache.GetPlayerInfoByName(real)
|
||||
end
|
||||
local _, class = C_PlayerCache.GetPlayerInfoByName(real)
|
||||
-- local guid = GetCurrentChatGUID()
|
||||
-- if guid then
|
||||
-- _, class = GetPlayerInfoByGUID(guid)
|
||||
-- end
|
||||
if not class then
|
||||
class = GetUnitData(real)
|
||||
end
|
||||
if class then
|
||||
if class ~= UNKNOWN then
|
||||
color = rgbhex(RAID_CLASS_COLORS[class])
|
||||
color = "|c" .. RAID_CLASS_COLORS[class].colorStr
|
||||
match = true
|
||||
end
|
||||
elseif C.chat.text.whosearchunknown == "1" then
|
||||
|
||||
@@ -34,9 +34,8 @@ pfUI:RegisterModule("mapcolors", function ()
|
||||
|
||||
local function GetTextureColor(frame)
|
||||
if UnitExists(frame.unit) then
|
||||
local _, class = UnitClass(frame.unit)
|
||||
local color = RAID_CLASS_COLORS[class]
|
||||
return color.r, color.g, color.b
|
||||
local _, r, g, b = GetUnitColor(frame.unit)
|
||||
return r, g, b
|
||||
else
|
||||
return .5, 1, .5
|
||||
end
|
||||
|
||||
@@ -1269,10 +1269,12 @@ end
|
||||
|
||||
local r, g, b, a = unpack(unitcolors[unittype])
|
||||
|
||||
if unittype == "ENEMY_PLAYER" and C.nameplates["enemyclassc"] == "1" and class and RAID_CLASS_COLORS[class] then
|
||||
r, g, b, a = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b, 1
|
||||
elseif unittype == "FRIENDLY_PLAYER" and C.nameplates["friendclassc"] == "1" and class and RAID_CLASS_COLORS[class] then
|
||||
r, g, b, a = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b, 1
|
||||
if class then
|
||||
if unittype == "ENEMY_PLAYER" and C.nameplates["enemyclassc"] == "1" then
|
||||
r, g, b, a = RAID_CLASS_COLORS[class]:GetRGBA()
|
||||
elseif unittype == "FRIENDLY_PLAYER" and C.nameplates["friendclassc"] == "1" then
|
||||
r, g, b, a = RAID_CLASS_COLORS[class]:GetRGBA()
|
||||
end
|
||||
end
|
||||
|
||||
if unitstr and UnitIsTapped(unitstr) and not UnitIsTappedByPlayer(unitstr) then
|
||||
|
||||
@@ -533,7 +533,7 @@ pfUI:RegisterModule("thirdparty-vanilla", "vanilla", function()
|
||||
hooksecurefunc("WIM_InitClassProps", function()
|
||||
for class in pairs(RAID_CLASS_COLORS) do
|
||||
local wimclass = _G[format("WIM_LOCALIZED_%s",class)]
|
||||
local colorstr = rgbhex(RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b, RAID_CLASS_COLORS[class].a)
|
||||
local colorstr = "|c" .. RAID_CLASS_COLORS[class].colorStr
|
||||
_G.WIM_ClassColors[wimclass] = gsub(colorstr, "^|cff", "")
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user