Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Nov 4, 2018
2 parents ab06128 + 2837f93 commit ead0336
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 196 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## Version 80000.15

- Fixed an issue where xp bar was causing errors when there's no bars to show;
- Fixed unit name colouring in tooltips;
- Updated Simplified Chinese translation. Translated by aenerv7@Curse.

## Version 80000.14

- Fixed an issue which made pet action buttons turn black;
Expand Down
98 changes: 49 additions & 49 deletions core/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,61 +78,61 @@ local textures = {
},
inlineicons = {
-- first line
["LEADER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:1:33:1:33|t",
["DAMAGER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:34:66:1:33|t",
["HEALER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:67:99:1:33|t",
["TANK"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:100:132:1:33|t",
["RESTING"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:133:165:1:33|t",
["COMBAT"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:166:198:1:33|t",
["HORDE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:199:231:1:33|t",
["LEADER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:1:33:1:33|t",
["DAMAGER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:34:66:1:33|t",
["HEALER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:67:99:1:33|t",
["TANK"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:100:132:1:33|t",
["RESTING"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:133:165:1:33|t",
["COMBAT"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:166:198:1:33|t",
["HORDE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:199:231:1:33|t",
-- second line
["ALLIANCE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:1:33:34:66|t",
["FFA"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:34:66:34:66|t",
["PHASE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:67:99:34:66|t",
["PHASE_WM"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:100:132:34:66|t",
["QUEST"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:133:165:34:66|t",
["SHEEP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:166:198:34:66|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:199:231:34:66|t",
["ALLIANCE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:1:33:34:66|t",
["FFA"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:34:66:34:66|t",
["PHASE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:67:99:34:66|t",
["PHASE_WM"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:100:132:34:66|t",
["QUEST"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:133:165:34:66|t",
["SHEEP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:166:198:34:66|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:199:231:34:66|t",
-- third line
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:1:33:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:34:66:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:67:99:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:100:132:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:133:165:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:166:198:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:199:231:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:1:33:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:34:66:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:67:99:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:100:132:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:133:165:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:166:198:67:99|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:199:231:67:99|t",
-- fourth line
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:1:33:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:34:66:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:67:99:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:100:132:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:133:165:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:166:198:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:199:231:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:1:33:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:34:66:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:67:99:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:100:132:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:133:165:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:166:198:100:132|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:199:231:100:132|t",
-- fifth line
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:1:33:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:34:66:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:67:99:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:100:132:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:133:165:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:166:198:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:199:231:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:1:33:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:34:66:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:67:99:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:100:132:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:133:165:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:166:198:133:165|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:199:231:133:165|t",
-- sixth line
["WARRIOR"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:1:33:166:198|t",
["MAGE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:34:66:166:198|t",
["ROGUE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:67:99:166:198|t",
["DRUID"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:100:132:166:198|t",
["HUNTER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:133:165:166:198|t",
["SHAMAN"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:166:198:166:198|t",
["PRIEST"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:199:231:166:198|t",
["WARRIOR"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:1:33:166:198|t",
["MAGE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:34:66:166:198|t",
["ROGUE"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:67:99:166:198|t",
["DRUID"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:100:132:166:198|t",
["HUNTER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:133:165:166:198|t",
["SHAMAN"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:166:198:166:198|t",
["PRIEST"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:199:231:166:198|t",
-- seventh line
["WARLOCK"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:1:33:199:231|t",
["PALADIN"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:34:66:199:231|t",
["DEATHKNIGHT"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:67:99:199:231|t",
["MONK"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:100:132:199:231|t",
["DEMONHUNTER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:133:165:199:231|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:166:198:199:231|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%d:%d:0:0:256:256:199:231:199:231|t",
["WARLOCK"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:1:33:199:231|t",
["PALADIN"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:34:66:199:231|t",
["DEATHKNIGHT"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:67:99:199:231|t",
["MONK"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:100:132:199:231|t",
["DEMONHUNTER"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:133:165:199:231|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:166:198:199:231|t",
-- ["TEMP"] = "|TInterface\\AddOns\\ls_UI\\assets\\unit-frame-icons:%f:%f:0:0:256:256:199:231:199:231|t",
},
}

Expand Down
50 changes: 28 additions & 22 deletions core/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -323,38 +323,44 @@ end
-----------

do
function E:GetUnitClassColor(unit)
local class = select(2, UnitClass(unit))
if class then
return C.db.global.colors.class[class]
function E:GetUnitColor(unit, colorByClass, colorByReaction)
if not UnitIsConnected(unit) then
return C.db.profile.colors.disconnected
elseif not UnitPlayerControlled(unit) and UnitIsTapDenied(unit) then
return C.db.profile.colors.tapped
elseif colorByClass and UnitIsPlayer(unit) then
return self:GetUnitClassColor(unit)
elseif colorByReaction then
return self:GetUnitReactionColor(unit)
end

return C.db.global.colors.white
return C.db.profile.colors.reaction[4]
end

function E:GetUnitClassColor(unit)
return C.db.global.colors.class[select(2, UnitClass(unit))] or C.db.global.colors.white
end

function E:GetUnitReactionColor(unit)
local reaction = UnitReaction(unit, "player")
if reaction then
return C.db.profile.colors.reaction[reaction]
if select(2, UnitDetailedThreatSituation("player", unit)) ~= nil then
return C.db.profile.colors.reaction[2]
end

return C.db.profile.colors.reaction[4]
return C.db.profile.colors.reaction[UnitReaction(unit, "player")] or C.db.profile.colors.reaction[4]
end

function E:GetUnitClassification(unit)
if UnitExists(unit) then
local classification = UnitClassification(unit)
if classification == "rare" then
return "R"
elseif classification == "rareelite" then
return "R+"
elseif classification == "elite" then
return "+"
elseif classification == "worldboss" then
return "B"
elseif classification == "minus" then
return "-"
end
local classification = UnitClassification(unit)
if classification == "rare" then
return "R"
elseif classification == "rareelite" then
return "R+"
elseif classification == "elite" then
return "+"
elseif classification == "worldboss" then
return "B"
elseif classification == "minus" then
return "-"
end

return ""
Expand Down
Loading

0 comments on commit ead0336

Please sign in to comment.