unitframes: add option for text offsets for hp & power bars

This commit is contained in:
dbulatovicx32
2024-09-23 09:44:20 +02:00
committed by GitHub
parent b707c4b11f
commit b0553c1328
3 changed files with 36 additions and 12 deletions
+12
View File
@@ -448,11 +448,23 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", unit, "levelcolor", "1")
pfUI:UpdateConfig("unitframes", unit, "classcolor", "1")
pfUI:UpdateConfig("unitframes", unit, "txthpleft", "unit")
pfUI:UpdateConfig("unitframes", unit, "txthpleftoffx", "0")
pfUI:UpdateConfig("unitframes", unit, "txthpleftoffy", "0")
pfUI:UpdateConfig("unitframes", unit, "txthpcenter", "none")
pfUI:UpdateConfig("unitframes", unit, "txthpcenteroffx", "0")
pfUI:UpdateConfig("unitframes", unit, "txthpcenteroffy", "0")
pfUI:UpdateConfig("unitframes", unit, "txthpright", "healthdyn")
pfUI:UpdateConfig("unitframes", unit, "txthprightoffx", "0")
pfUI:UpdateConfig("unitframes", unit, "txthprightoffy", "0")
pfUI:UpdateConfig("unitframes", unit, "txtpowerleft", "none")
pfUI:UpdateConfig("unitframes", unit, "txtpowerleftoffx", "0")
pfUI:UpdateConfig("unitframes", unit, "txtpowerleftoffy", "0")
pfUI:UpdateConfig("unitframes", unit, "txtpowercenter", "none")
pfUI:UpdateConfig("unitframes", unit, "txtpowercenteroffx", "0")
pfUI:UpdateConfig("unitframes", unit, "txtpowercenteroffy", "0")
pfUI:UpdateConfig("unitframes", unit, "txtpowerright", "none")
pfUI:UpdateConfig("unitframes", unit, "txtpowerrightoffx", "0")
pfUI:UpdateConfig("unitframes", unit, "txtpowerrightoffy", "0")
pfUI:UpdateConfig("unitframes", unit, "hitindicator", "0")
pfUI:UpdateConfig("unitframes", unit, "hitindicatorsize", "15")
pfUI:UpdateConfig("unitframes", unit, "hitindicatorfont", "Interface\\AddOns\\pfUI\\fonts\\Continuum.ttf")
+12 -12
View File
@@ -601,48 +601,48 @@ function pfUI.uf:UpdateConfig()
f.hpLeftText:SetJustifyH("LEFT")
f.hpLeftText:SetParent(f.hp.bar)
f.hpLeftText:ClearAllPoints()
f.hpLeftText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*default_border, 1)
f.hpLeftText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*default_border, 0)
f.hpLeftText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*(default_border + f.config.txthpleftoffx), 1 + tonumber(f.config.txthpleftoffy))
f.hpLeftText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*(default_border + f.config.txthpleftoffx), f.config.txthpleftoffy)
f.hpRightText:SetFontObject(GameFontWhite)
f.hpRightText:SetFont(fontname, fontsize, fontstyle)
f.hpRightText:SetJustifyH("RIGHT")
f.hpRightText:SetParent(f.hp.bar)
f.hpRightText:ClearAllPoints()
f.hpRightText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*default_border, 1)
f.hpRightText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*default_border, 0)
f.hpRightText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*(default_border + f.config.txthprightoffx), 1 + tonumber(f.config.txthprightoffy))
f.hpRightText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*(default_border + f.config.txthprightoffx), f.config.txthprightoffy)
f.hpCenterText:SetFontObject(GameFontWhite)
f.hpCenterText:SetFont(fontname, fontsize, fontstyle)
f.hpCenterText:SetJustifyH("CENTER")
f.hpCenterText:SetParent(f.hp.bar)
f.hpCenterText:ClearAllPoints()
f.hpCenterText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*default_border, 1)
f.hpCenterText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*default_border, 0)
f.hpCenterText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*(default_border + f.config.txthpcenteroffx), 1 + tonumber(f.config.txthpcenteroffy))
f.hpCenterText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*(default_border + f.config.txthpcenteroffx), f.config.txthpcenteroffy)
f.powerLeftText:SetFontObject(GameFontWhite)
f.powerLeftText:SetFont(fontname, fontsize, fontstyle)
f.powerLeftText:SetJustifyH("LEFT")
f.powerLeftText:SetParent(f.power.bar)
f.powerLeftText:ClearAllPoints()
f.powerLeftText:SetPoint("TOPLEFT",f.power.bar, "TOPLEFT", 2*default_border, 1)
f.powerLeftText:SetPoint("BOTTOMRIGHT",f.power.bar, "BOTTOMRIGHT", -2*default_border, 0)
f.powerLeftText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*(default_border + f.config.txtpowerleftoffx), 1 + tonumber(f.config.txtpowerleftoffy))
f.powerLeftText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*(default_border + f.config.txtpowerleftoffx), f.config.txtpowerleftoffy)
f.powerRightText:SetFontObject(GameFontWhite)
f.powerRightText:SetFont(fontname, fontsize, fontstyle)
f.powerRightText:SetJustifyH("RIGHT")
f.powerRightText:SetParent(f.power.bar)
f.powerRightText:ClearAllPoints()
f.powerRightText:SetPoint("TOPLEFT",f.power.bar, "TOPLEFT", 2*default_border, 1)
f.powerRightText:SetPoint("BOTTOMRIGHT",f.power.bar, "BOTTOMRIGHT", -2*default_border, 0)
f.powerRightText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*(default_border + f.config.txtpowerrightoffx), 1 + tonumber(f.config.txtpowerrightoffy))
f.powerRightText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*(default_border + f.config.txtpowerrightoffx), f.config.txtpowerrightoffy)
f.powerCenterText:SetFontObject(GameFontWhite)
f.powerCenterText:SetFont(fontname, fontsize, fontstyle)
f.powerCenterText:SetJustifyH("CENTER")
f.powerCenterText:SetParent(f.power.bar)
f.powerCenterText:ClearAllPoints()
f.powerCenterText:SetPoint("TOPLEFT",f.power.bar, "TOPLEFT", 2*default_border, 1)
f.powerCenterText:SetPoint("BOTTOMRIGHT",f.power.bar, "BOTTOMRIGHT", -2*default_border, 0)
f.powerCenterText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*(default_border + f.config.txtpowercenteroffx) + f.config.poffx, 1 + tonumber(f.config.txtpowercenteroffy))
f.powerCenterText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*(default_border + f.config.txtpowercenteroffx) + f.config.poffx, f.config.txtpowercenteroffy)
f.incHeal:SetHeight(f.config.height)
f.incHeal:SetWidth(f.config.width)