Сообщение от
carevitch
Screenshot_1.png
как сделать, чтобы эти места отображались по цвету класса ?
примерно, как на картинке ниже
и желательно без градиента, а то близовский градиент бесит )
PHP код:
local UnitClass = UnitClass
local RAID_CLASS_COLORS = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS
local tex = PlayerFrame:CreateTexture()
tex:SetSize(119,19)
tex:SetPoint("TOPLEFT",PlayerFrameBackground)
tex:SetTexture([[Interface\Buttons\WHITE8X8]])
PlayerFrameGroupIndicator:RegisterEvent("PLAYER_LOGIN")
PlayerFrameGroupIndicator:SetScript("OnEvent",function(self)
local _,class = UnitClass("player")
local c = RAID_CLASS_COLORS[class]
tex:SetVertexColor(c.r,c.g,c.b)
self:SetScript("OnEvent",nil)
self:UnregisterEvent("PLAYER_LOGIN")
end)
hooksecurefunc("TargetFrame_CheckFaction",function(self)
local _,class = UnitClass(self.unit)
local c = RAID_CLASS_COLORS[class]
self.nameBackground:SetVertexColor(c.r,c.g,c.b)
self.nameBackground:SetTexture([[Interface\Buttons\WHITE8X8]])
end)
- - - Updated - - -
https://imgur.com/PLFNloB
- - - Updated - - -
варик не меняющий цвета нпц
PHP код:
local RAID_CLASS_COLORS = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS
local UnitSelectionColor = UnitSelectionColor
local UnitIsPlayer = UnitIsPlayer
local UnitClass = UnitClass
local tex = PlayerFrame:CreateTexture()
tex:SetSize(119,19)
tex:SetPoint("TOPLEFT",PlayerFrameBackground)
tex:SetTexture([[Interface\Buttons\WHITE8X8]])
PlayerFrameGroupIndicator:RegisterEvent("PLAYER_LOGIN")
PlayerFrameGroupIndicator:SetScript("OnEvent",function(self)
local _,class = UnitClass("player")
local c = RAID_CLASS_COLORS[class]
tex:SetVertexColor(c.r,c.g,c.b)
self:SetScript("OnEvent",nil)
self:UnregisterEvent("PLAYER_LOGIN")
end)
hooksecurefunc("TargetFrame_CheckFaction",function(self) --
if UnitIsPlayer(self.unit) then
local _,class = UnitClass(self.unit)
local c = RAID_CLASS_COLORS[class]
self.nameBackground:SetVertexColor(c.r,c.g,c.b)
else
self.nameBackground:SetVertexColor(UnitSelectionColor(self.unit))
end
self.nameBackground:SetTexture([[Interface\Buttons\WHITE8X8]])
end)
[свернуть]