Commit 2219d317 authored by fgprodigal's avatar fgprodigal

Fix difficultycolor tag

parent 31d83e7f
......@@ -15,36 +15,14 @@ local formattedTextStyles = {
['DEFICIT'] = '-%s',
}
ElvUF.Tags.Methods['difficultycolor'] = nil
local _diffcolor = ElvUF.Tags.Methods['difficultycolor']
ElvUF.Tags.Methods['difficultycolor'] = function(unit)
local r, g, b
if ( UnitIsWildBattlePet(unit) or UnitIsBattlePetCompanion(unit) ) then
local level = UnitBattlePetLevel(unit)
local teamLevel = C_PetJournal.GetPetTeamAverageLevel();
if teamLevel < level or teamLevel > level then
local c = GetRelativeDifficultyColor(teamLevel, level)
r, g, b = c.r, c.g, c.b
else
local c = QuestDifficultyColors.difficult
r, g, b = c.r, c.g, c.b
end
if not UnitIsWildBattlePet(unit) and not UnitIsBattlePetCompanion(unit) and UnitLevel(unit) == -1 then
local c = QuestDifficultyColors.impossible
return Hex(c.r, c.g, c.b)
else
local DiffColor = UnitLevel(unit) - E.mylevel
if UnitLevel(unit) == -1 or (DiffColor >= 5) then
r, g, b = 0.77, 0.12 , 0.23
elseif (DiffColor >= 3) then
r, g, b = 1.0, 0.49, 0.04
elseif (DiffColor >= -2) then
r, g, b = 1.0, 0.96, 0.41
elseif (-DiffColor <= GetQuestGreenRange()) then
r, g, b = 0.251, 0.753, 0.251
else
r, g, b = 0.6, 0.6, 0.6
end
return _diffcolor(unit)
end
return Hex(r, g, b)
end
local values = {}
......
## Interface: 90001
## Author: fgprodigal
## Version: 2.00
## Version: 2.01
## Title: |cff1784d1ElvUI|r |cff7aa6d6Ray|r|cffff0000U|r|cff7aa6d6I|r
## RequiredDeps: ElvUI, ElvUI_MerathilisUI
## DefaultState: Enabled
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment