diff --git a/api/config.lua b/api/config.lua index 398adfb7..493ffa0b 100644 --- a/api/config.lua +++ b/api/config.lua @@ -116,6 +116,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "player", "txtleft", "unit") pfUI:UpdateConfig("unitframes", "player", "txtcenter", "none") pfUI:UpdateConfig("unitframes", "player", "txtright", "healthdyn") + pfUI:UpdateConfig("unitframes", "player", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "player", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "player", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "player", "classcolor", "1") pfUI:UpdateConfig("unitframes", "player", "showPVPMinimap", "0") pfUI:UpdateConfig("unitframes", "player", "showPVP", "0") @@ -143,6 +147,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "target", "txtleft", "unit") pfUI:UpdateConfig("unitframes", "target", "txtcenter", "none") pfUI:UpdateConfig("unitframes", "target", "txtright", "healthdyn") + pfUI:UpdateConfig("unitframes", "target", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "target", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "target", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "target", "classcolor", "1") pfUI:UpdateConfig("unitframes", "target", "animation", "0") pfUI:UpdateConfig("unitframes", "focus", "visible", "1") @@ -167,6 +175,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "focus", "txtleft", "unit") pfUI:UpdateConfig("unitframes", "focus", "txtcenter", "none") pfUI:UpdateConfig("unitframes", "focus", "txtright", "healthdyn") + pfUI:UpdateConfig("unitframes", "focus", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "focus", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "focus", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "focus", "classcolor", "1") pfUI:UpdateConfig("unitframes", "group", "visible", "1") pfUI:UpdateConfig("unitframes", "group", "portrait", "off") @@ -190,6 +202,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "group", "txtleft", "unit") pfUI:UpdateConfig("unitframes", "group", "txtcenter", "none") pfUI:UpdateConfig("unitframes", "group", "txtright", "healthmiss") + pfUI:UpdateConfig("unitframes", "group", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "group", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "group", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "group", "classcolor", "1") pfUI:UpdateConfig("unitframes", "group", "hide_in_raid", "0") pfUI:UpdateConfig("unitframes", "grouptarget", "visible", "1") @@ -214,6 +230,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "grouptarget", "txtleft", "unit") pfUI:UpdateConfig("unitframes", "grouptarget", "txtcenter", "none") pfUI:UpdateConfig("unitframes", "grouptarget", "txtright", "healthperc") + pfUI:UpdateConfig("unitframes", "grouptarget", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "grouptarget", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "grouptarget", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "grouptarget", "classcolor", "1") pfUI:UpdateConfig("unitframes", "grouppet", "visible", "1") pfUI:UpdateConfig("unitframes", "grouppet", "portrait", "off") @@ -237,6 +257,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "grouppet", "txtleft", "unit") pfUI:UpdateConfig("unitframes", "grouppet", "txtcenter", "none") pfUI:UpdateConfig("unitframes", "grouppet", "txtright", "healthperc") + pfUI:UpdateConfig("unitframes", "grouppet", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "grouppet", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "grouppet", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "grouppet", "classcolor", "1") pfUI:UpdateConfig("unitframes", "raid", "visible", "1") pfUI:UpdateConfig("unitframes", "raid", "portrait", "off") @@ -260,6 +284,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "raid", "txtleft", "name") pfUI:UpdateConfig("unitframes", "raid", "txtcenter", "none") pfUI:UpdateConfig("unitframes", "raid", "txtright", "healthmiss") + pfUI:UpdateConfig("unitframes", "raid", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "raid", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "raid", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "raid", "classcolor", "1") pfUI:UpdateConfig("unitframes", "ttarget", "visible", "1") pfUI:UpdateConfig("unitframes", "ttarget", "portrait", "bar") @@ -283,6 +311,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "ttarget", "txtleft", "none") pfUI:UpdateConfig("unitframes", "ttarget", "txtcenter", "name") pfUI:UpdateConfig("unitframes", "ttarget", "txtright", "none") + pfUI:UpdateConfig("unitframes", "ttarget", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "ttarget", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "ttarget", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "ttarget", "classcolor", "1") pfUI:UpdateConfig("unitframes", "pet", "visible", "1") pfUI:UpdateConfig("unitframes", "pet", "portrait", "bar") @@ -306,6 +338,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "pet", "txtleft", "none") pfUI:UpdateConfig("unitframes", "pet", "txtcenter", "name") pfUI:UpdateConfig("unitframes", "pet", "txtright", "none") + pfUI:UpdateConfig("unitframes", "pet", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "pet", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "pet", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "pet", "classcolor", "1") pfUI:UpdateConfig("unitframes", "fallback", "visible", "1") pfUI:UpdateConfig("unitframes", "fallback", "portrait", "bar") @@ -329,6 +365,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "fallback", "txtleft", "unit") pfUI:UpdateConfig("unitframes", "fallback", "txtcenter", "none") pfUI:UpdateConfig("unitframes", "fallback", "txtright", "healthdyn") + pfUI:UpdateConfig("unitframes", "fallback", "healthcolor", "1") + pfUI:UpdateConfig("unitframes", "fallback", "powercolor", "1") + pfUI:UpdateConfig("unitframes", "fallback", "levelcolor", "1") + pfUI:UpdateConfig("unitframes", "fallback", "classcolor", "1") pfUI:UpdateConfig("bars", nil, "icon_size", "20") pfUI:UpdateConfig("bars", nil, "background", "1") diff --git a/api/unitframes.lua b/api/unitframes.lua index 664a8694..5c7a014e 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1287,9 +1287,12 @@ function pfUI.uf:GetStatusValue(unit, pos) end function pfUI.uf.GetColor(self, preset) + local config = self.config + local unitstr = self.label .. self.id local r, g, b = 1, 1, 1 - if preset == "unit" then + + if preset == "unit" and config["classcolor"] == "1" then if UnitIsPlayer(unitstr) then local _, class = UnitClass(unitstr) if RAID_CLASS_COLORS[class] then @@ -1301,18 +1304,18 @@ function pfUI.uf.GetColor(self, preset) end end - elseif preset == "class" then + elseif preset == "class" and config["classcolor"] == "1" then local _, class = UnitClass(unitstr) r = RAID_CLASS_COLORS[class].r g = RAID_CLASS_COLORS[class].g b = RAID_CLASS_COLORS[class].b - elseif preset == "reaction" then + elseif preset == "reaction" and config["classcolor"] == "1" then r = UnitReactionColor[UnitReaction(unitstr, "player")].r g = UnitReactionColor[UnitReaction(unitstr, "player")].g b = UnitReactionColor[UnitReaction(unitstr, "player")].b - elseif preset == "health" then + elseif preset == "health" and config["healthcolor"] == "1" then local perc = UnitHealth(unitstr) / UnitHealthMax(unitstr) local r1, g1, b1, r2, g2, b2 if perc <= 0.5 then @@ -1328,12 +1331,12 @@ function pfUI.uf.GetColor(self, preset) g = g1 + (g2 - g1)*perc b = b1 + (b2 - b1)*perc - elseif preset == "power" then + elseif preset == "power" and config["powercolor"] == "1" then r = ManaBarColor[UnitPowerType(unitstr)].r g = ManaBarColor[UnitPowerType(unitstr)].g b = ManaBarColor[UnitPowerType(unitstr)].b - elseif preset == "level" then + elseif preset == "level" and config["levelcolor"] == "1" then r = GetDifficultyColor(UnitLevel(unitstr)).r g = GetDifficultyColor(UnitLevel(unitstr)).g b = GetDifficultyColor(UnitLevel(unitstr)).b diff --git a/modules/gui.lua b/modules/gui.lua index 118ff230..911a68cc 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -935,6 +935,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.player, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.player, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.player, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.player, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.player, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.player, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.player, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable PvP Icon", C.unitframes.player, "showPVP", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Align PvP Icon to Minimap", C.unitframes.player, "showPVPMinimap", "checkbox") @@ -964,6 +968,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.target, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.target, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.target, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.target, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.target, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.target, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.target, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Focus", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Player Frame", C.unitframes.focus, "visible", "checkbox") @@ -988,6 +996,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.focus, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.focus, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.focus, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.focus, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.focus, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.focus, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.focus, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Group", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Group Frames", C.unitframes.group, "visible", "checkbox") @@ -1013,6 +1025,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.group, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.group, "txtright", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Hide Group Frames When In A Raid", C.unitframes.group, "hide_in_raid", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.group, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.group, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.group, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.group, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Group Target", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Group Target Frames", C.unitframes.grouptarget, "visible", "checkbox") @@ -1037,6 +1053,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.grouptarget, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.grouptarget, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.grouptarget, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.grouptarget, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.grouptarget, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.grouptarget, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.grouptarget, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Group Pet", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Group Pet Frames", C.unitframes.grouppet, "visible", "checkbox") @@ -1061,6 +1081,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.grouppet, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.grouppet, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.grouppet, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.grouppet, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.grouppet, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.grouppet, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.grouppet, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Raid", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Raid Frames", C.unitframes.raid, "visible", "checkbox") @@ -1085,6 +1109,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.raid, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.raid, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.raid, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.raid, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.raid, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.raid, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.raid, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Target of Target", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Target of Target Frame", C.unitframes.ttarget, "visible", "checkbox") @@ -1109,6 +1137,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.ttarget, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.ttarget, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.ttarget, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.ttarget, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.ttarget, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.ttarget, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.ttarget, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Pet", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Pet Frame", C.unitframes.player, "visible", "checkbox") @@ -1133,6 +1165,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.pet, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.pet, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.pet, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.pet, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.pet, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.pet, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.pet, "classcolor", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Custom Units", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Custom Frames", C.unitframes.fallback, "visible", "checkbox") @@ -1157,6 +1193,10 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.fallback, "txtleft", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.fallback, "txtcenter", "dropdown", txtValues) pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.fallback, "txtright", "dropdown", txtValues) + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Health Color in Text", C.unitframes.fallback, "healthcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Power Color in Text", C.unitframes.fallback, "powercolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Level Color in Text", C.unitframes.fallback, "levelcolor", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Class Color in Text", C.unitframes.fallback, "classcolor", "checkbox") -- action bar pfUI.gui.bar = pfUI.gui:CreateConfigTab("Action Bar")