diff --git a/api/config.lua b/api/config.lua index 508a8512..d92b7661 100644 --- a/api/config.lua +++ b/api/config.lua @@ -65,6 +65,8 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", nil, "pastel", "1") pfUI:UpdateConfig("unitframes", nil, "custom", "0") 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, "animation_speed", "5") pfUI:UpdateConfig("unitframes", nil, "portraitalpha", "0.1") pfUI:UpdateConfig("unitframes", nil, "portraittexture", "1") diff --git a/modules/group.lua b/modules/group.lua index ebc61ff9..5d5800f3 100644 --- a/modules/group.lua +++ b/modules/group.lua @@ -104,6 +104,14 @@ pfUI:RegisterModule("group", function () pfUI.uf.group[i].hp.bar:SetAllPoints(pfUI.uf.group[i].hp) pfUI.uf.group[i].hp.bar:SetMinMaxValues(0, 100) + if C.unitframes.custombg == "1" then + local cr, cg, cb, ca = strsplit(",", C.unitframes.custombgcolor) + cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) + pfUI.uf.group[i].hp.bar.texture = pfUI.uf.group[i].hp.bar:CreateTexture(nil,"BACKGROUND") + pfUI.uf.group[i].hp.bar.texture:SetTexture(cr,cg,cb,ca) + pfUI.uf.group[i].hp.bar.texture:SetAllPoints(pfUI.uf.group[i].hp.bar) + end + pfUI.uf.group[i].power = CreateFrame("Frame",nil, pfUI.uf.group[i]) pfUI.uf.group[i].power:SetWidth(175) pfUI.uf.group[i].power:SetHeight(10) diff --git a/modules/gui.lua b/modules/gui.lua index fea24d05..77009d16 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -852,6 +852,8 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Pastel Colors", C.unitframes, "pastel", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Custom Color Health Bars", C.unitframes, "custom", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.uf, "Custom Health Bar Color", C.unitframes, "customcolor", "color") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Custom Color Health Bar Background", C.unitframes, "custombg", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.uf, "Custom Health Bar Background Color", C.unitframes, "custombgcolor", "color") pfUI.gui:CreateConfig(pfUI.gui.uf, "Animation Speed", C.unitframes, "animation_speed") pfUI.gui:CreateConfig(pfUI.gui.uf, "Portrait Alpha", C.unitframes, "portraitalpha") pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable 2D Portraits As Fallback", C.unitframes, "portraittexture", "checkbox") diff --git a/modules/pet.lua b/modules/pet.lua index c3d4cfce..dc5c5f33 100644 --- a/modules/pet.lua +++ b/modules/pet.lua @@ -150,6 +150,14 @@ pfUI:RegisterModule("pet", function () pfUI.uf.pet.hp.bar:SetAllPoints(pfUI.uf.pet.hp) pfUI.uf.pet.hp.bar:SetMinMaxValues(0, 100) + if C.unitframes.custombg == "1" then + local cr, cg, cb, ca = strsplit(",", C.unitframes.custombgcolor) + cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) + pfUI.uf.pet.hp.bar.texture = pfUI.uf.pet.hp.bar:CreateTexture(nil,"BACKGROUND") + pfUI.uf.pet.hp.bar.texture:SetTexture(cr,cg,cb,ca) + pfUI.uf.pet.hp.bar.texture:SetAllPoints(pfUI.uf.pet.hp.bar) + end + pfUI.uf.pet.hp.raidIcon = CreateFrame("Frame",nil,pfUI.uf.pet.hp) pfUI.uf.pet.hp.raidIcon:SetFrameStrata("MEDIUM") pfUI.uf.pet.hp.raidIcon:SetParent(pfUI.uf.pet.hp.bar) diff --git a/modules/player.lua b/modules/player.lua index 58c287a1..b4665bff 100644 --- a/modules/player.lua +++ b/modules/player.lua @@ -213,6 +213,14 @@ pfUI:RegisterModule("player", function () pfUI.uf.player.hp.bar:SetAllPoints(pfUI.uf.player.hp) pfUI.uf.player.hp.bar:SetMinMaxValues(0, 100) + if C.unitframes.custombg == "1" then + local cr, cg, cb, ca = strsplit(",", C.unitframes.custombgcolor) + cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) + pfUI.uf.player.hp.bar.texture = pfUI.uf.player.hp.bar:CreateTexture(nil,"BACKGROUND") + pfUI.uf.player.hp.bar.texture:SetTexture(cr,cg,cb,ca) + pfUI.uf.player.hp.bar.texture:SetAllPoints(pfUI.uf.player.hp.bar) + end + pfUI.uf.player.hp.leaderIcon = CreateFrame("Frame",nil,pfUI.uf.player.hp.bar) pfUI.uf.player.hp.leaderIcon:SetWidth(10) pfUI.uf.player.hp.leaderIcon:SetHeight(10) diff --git a/modules/raid.lua b/modules/raid.lua index b019c986..8066e892 100644 --- a/modules/raid.lua +++ b/modules/raid.lua @@ -59,6 +59,14 @@ pfUI:RegisterModule("raid", function () pfUI.uf.raid[i].hp.bar:SetAllPoints(pfUI.uf.raid[i].hp) pfUI.uf.raid[i].hp.bar:SetMinMaxValues(0, 100) + if C.unitframes.custombg == "1" then + local cr, cg, cb, ca = strsplit(",", C.unitframes.custombgcolor) + cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) + pfUI.uf.raid[i].hp.bar.texture = pfUI.uf.raid[i].hp.bar:CreateTexture(nil,"BACKGROUND") + pfUI.uf.raid[i].hp.bar.texture:SetTexture(cr,cg,cb,ca) + pfUI.uf.raid[i].hp.bar.texture:SetAllPoints(pfUI.uf.raid[i].hp.bar) + end + pfUI.uf.raid[i].power = CreateFrame("Frame",nil, pfUI.uf.raid[i]) pfUI.uf.raid[i].power:SetPoint("BOTTOM", 0, 0) pfUI.uf.raid[i].power:SetWidth(50) diff --git a/modules/target.lua b/modules/target.lua index e448ba1e..34b5ca29 100644 --- a/modules/target.lua +++ b/modules/target.lua @@ -253,6 +253,14 @@ pfUI:RegisterModule("target", function () pfUI.uf.target.hp.bar:SetAllPoints(pfUI.uf.target.hp) pfUI.uf.target.hp.bar:SetMinMaxValues(0, 100) + if C.unitframes.custombg == "1" then + local cr, cg, cb, ca = strsplit(",", C.unitframes.custombgcolor) + cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) + pfUI.uf.target.hp.bar.texture = pfUI.uf.target.hp.bar:CreateTexture(nil,"BACKGROUND") + pfUI.uf.target.hp.bar.texture:SetTexture(cr,cg,cb,ca) + pfUI.uf.target.hp.bar.texture:SetAllPoints(pfUI.uf.target.hp.bar) + end + pfUI.uf.target.hp.leaderIcon = CreateFrame("Frame",nil,pfUI.uf.target.hp.bar) pfUI.uf.target.hp.leaderIcon:SetWidth(10) pfUI.uf.target.hp.leaderIcon:SetHeight(10) diff --git a/modules/targettarget.lua b/modules/targettarget.lua index 49bef362..45cb3a2a 100644 --- a/modules/targettarget.lua +++ b/modules/targettarget.lua @@ -134,6 +134,14 @@ pfUI:RegisterModule("targettarget", function () pfUI.uf.targettarget.hp.bar:SetAllPoints(pfUI.uf.targettarget.hp) pfUI.uf.targettarget.hp.bar:SetMinMaxValues(0, 100) + if C.unitframes.custombg == "1" then + local cr, cg, cb, ca = strsplit(",", C.unitframes.custombgcolor) + cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) + pfUI.uf.targettarget.hp.bar.texture = pfUI.uf.targettarget.hp.bar:CreateTexture(nil,"BACKGROUND") + pfUI.uf.targettarget.hp.bar.texture:SetTexture(cr,cg,cb,ca) + pfUI.uf.targettarget.hp.bar.texture:SetAllPoints(pfUI.uf.targettarget.hp.bar) + end + pfUI.uf.targettarget.hp.raidIcon = CreateFrame("Frame",nil,pfUI.uf.targettarget.hp) pfUI.uf.targettarget.hp.raidIcon:SetFrameStrata("MEDIUM") pfUI.uf.targettarget.hp.raidIcon:SetParent(pfUI.uf.targettarget.hp.bar)