mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-08 14:40:01 +00:00
unitframes: add option for custom power colors
This commit is contained in:
@@ -170,6 +170,11 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", nil, "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", nil, "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", nil, "animation_speed", "5")
|
||||
pfUI:UpdateConfig("unitframes", nil, "portraitalpha", "0.1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "always2dportrait", "0")
|
||||
@@ -251,6 +256,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "player", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "player", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "player", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "player", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "player", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "player", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "player", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "target", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "target", "showPVP", "0")
|
||||
@@ -304,6 +313,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "target", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "target", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "target", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "target", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "target", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "target", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "target", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "focus", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "focus", "showPVP", "0")
|
||||
@@ -356,6 +369,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "focus", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "focus", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "focus", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "focus", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "focus", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "focus", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "focus", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "group", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "showPVP", "0")
|
||||
@@ -409,6 +426,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "group", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "group", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "group", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "showPVP", "0")
|
||||
@@ -461,6 +482,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouptarget", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "showPVP", "0")
|
||||
@@ -513,6 +538,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "grouppet", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "raid", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "showPVP", "0")
|
||||
@@ -565,6 +594,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "raid", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "raid", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "showPVP", "0")
|
||||
@@ -617,6 +650,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "ttarget", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "pet", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "showPVP", "0")
|
||||
@@ -669,6 +706,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "pet", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "pet", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "visible", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "showPVP", "0")
|
||||
@@ -721,6 +762,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "ptarget", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "visible", "1")
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "showPVP", "0")
|
||||
@@ -773,6 +818,10 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "customcolor", ".2,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "custombg", "0")
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "manacolor", ".5,.5,1,1")
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "energycolor", "1,1,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "ragecolor", "1,.5,.5,1")
|
||||
pfUI:UpdateConfig("unitframes", "fallback", "focuscolor", "1,1,.75,1")
|
||||
|
||||
pfUI:UpdateConfig("bars", "bar1", "pageable", "1")
|
||||
pfUI:UpdateConfig("bars", "bar2", "pageable", "1")
|
||||
|
||||
+20
-6
@@ -1495,13 +1495,13 @@ function pfUI.uf:RefreshUnit(unit, component)
|
||||
end
|
||||
end
|
||||
|
||||
local r, g, b, a = .2, .2, .2, 1
|
||||
|
||||
-- set healthbar color
|
||||
local custom_active = nil
|
||||
local customfullhp = unit.config.defcolor == "0" and unit.config.customfullhp or C.unitframes.customfullhp
|
||||
local customcolor = unit.config.defcolor == "0" and unit.config.customcolor or C.unitframes.customcolor
|
||||
local custom = unit.config.defcolor == "0" and unit.config.custom or C.unitframes.custom
|
||||
|
||||
local r, g, b, a = .2, .2, .2, 1
|
||||
if customfullhp == "1" and UnitHealth(unitstr) == UnitHealthMax(unitstr) then
|
||||
r, g, b, a = pfUI.api.strsplit(",", customcolor)
|
||||
custom_active = true
|
||||
@@ -1540,10 +1540,24 @@ function pfUI.uf:RefreshUnit(unit, component)
|
||||
|
||||
unit.hp.bar:SetStatusBarColor(r, g, b, a)
|
||||
|
||||
local p = ManaBarColor[UnitPowerType(unitstr)]
|
||||
local pr, pg, pb = 0, 0, 0
|
||||
if p then pr, pg, pb = p.r + .5, p.g +.5, p.b +.5 end
|
||||
unit.power.bar:SetStatusBarColor(pr, pg, pb)
|
||||
-- set powerbar color
|
||||
local mana = unit.config.defcolor == "0" and unit.config.manacolor or C.unitframes.manacolor
|
||||
local rage = unit.config.defcolor == "0" and unit.config.ragecolor or C.unitframes.ragecolor
|
||||
local energy = unit.config.defcolor == "0" and unit.config.energycolor or C.unitframes.energycolor
|
||||
local focus = unit.config.defcolor == "0" and unit.config.focuscolor or C.unitframes.focuscolor
|
||||
|
||||
local r, g, b, a = .5, .5, .5, 1
|
||||
local utype = UnitPowerType(unitstr)
|
||||
if utype == 0 then
|
||||
r, g, b, a = pfUI.api.strsplit(",", mana)
|
||||
elseif utype == 1 then
|
||||
r, g, b, a = pfUI.api.strsplit(",", rage)
|
||||
elseif utype == 2 then
|
||||
r, g, b, a = pfUI.api.strsplit(",", focus)
|
||||
elseif utype == 3 then
|
||||
r, g, b, a = pfUI.api.strsplit(",", energy)
|
||||
end
|
||||
unit.power.bar:SetStatusBarColor(r, g, b, a)
|
||||
|
||||
if UnitName(unitstr) then
|
||||
unit.hpLeftText:SetText(pfUI.uf:GetStatusValue(unit, "hpleft"))
|
||||
|
||||
Reference in New Issue
Block a user