Skip to content

Commit

Permalink
unitframes: add offset options to power bars
Browse files Browse the repository at this point in the history
  • Loading branch information
dbulatovicx32 authored Jul 26, 2024
1 parent 9a40ca7 commit ada9ee9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", unit, "height", "46")
pfUI:UpdateConfig("unitframes", unit, "pheight", "10")
pfUI:UpdateConfig("unitframes", unit, "pwidth", "-1")
pfUI:UpdateConfig("unitframes", unit, "poffx", "0")
pfUI:UpdateConfig("unitframes", unit, "poffy", "0")
pfUI:UpdateConfig("unitframes", unit, "portraitheight", "-1")
pfUI:UpdateConfig("unitframes", unit, "portraitwidth", "-1")
pfUI:UpdateConfig("unitframes", unit, "panchor", "TOP")
Expand Down
2 changes: 1 addition & 1 deletion api/unitframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ function pfUI.uf:UpdateConfig()
end

f.power:ClearAllPoints()
f.power:SetPoint(f.config.panchor, f.hp, relative_point, 0, -2*default_border - f.config.pspace * GetPerfectPixel())
f.power:SetPoint(f.config.panchor, f.hp, relative_point, f.config.poffx, -2*default_border - f.config.pspace + f.config.poffy * GetPerfectPixel())
f.power:SetWidth((f.config.pwidth ~= "-1" and f.config.pwidth or f.config.width))
f.power:SetHeight(f.config.pheight)
if tonumber(f.config.pheight) < 0 then f.power:Hide() end
Expand Down
2 changes: 2 additions & 0 deletions modules/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,8 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U[c], T["Powerbar"], nil, nil, "header")
CreateConfig(U[c], T["Power Bar Height"], C.unitframes[c], "pheight")
CreateConfig(U[c], T["Power Bar Width"], C.unitframes[c], "pwidth")
CreateConfig(U[c], T["Power Bar X-Offset"], C.unitframes[c], "poffx")
CreateConfig(U[c], T["Power Bar Y-Offset"], C.unitframes[c], "poffy")
CreateConfig(U[c], T["Left Text"], C.unitframes[c], "txtpowerleft", "dropdown", pfUI.gui.dropdowns.uf_texts)
CreateConfig(U[c], T["Center Text"], C.unitframes[c], "txtpowercenter", "dropdown", pfUI.gui.dropdowns.uf_texts)
CreateConfig(U[c], T["Right Text"], C.unitframes[c], "txtpowerright", "dropdown", pfUI.gui.dropdowns.uf_texts)
Expand Down

0 comments on commit ada9ee9

Please sign in to comment.