Skip to content

Commit

Permalink
nameplates: add option to adjust debuff icon offset
Browse files Browse the repository at this point in the history
  • Loading branch information
shagu committed Nov 27, 2024
1 parent 1d3b2d0 commit 06ddbcd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "vpos", "-10")
pfUI:UpdateConfig("nameplates", nil, "width", "120")
pfUI:UpdateConfig("nameplates", nil, "debuffsize", "14")
pfUI:UpdateConfig("nameplates", nil, "debuffoffset", "4")
pfUI:UpdateConfig("nameplates", nil, "heighthealth", "8")
pfUI:UpdateConfig("nameplates", nil, "heightcast", "8")
pfUI:UpdateConfig("nameplates", nil, "cpdisplay", "0")
Expand Down
3 changes: 2 additions & 1 deletion modules/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2238,8 +2238,9 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Debuffs"], nil, nil, "header")
CreateConfig(U["nameplates"], T["Enable Debuffs"], C.nameplates, "showdebuffs", "checkbox")
CreateConfig(U["nameplates"], T["Debuff Position"], C.nameplates.debuffs, "position", "dropdown", pfUI.gui.dropdowns.debuffposition)
CreateConfig(U["nameplates"], T["Estimate Debuffs"], C.nameplates, "guessdebuffs", "checkbox")
CreateConfig(U["nameplates"], T["Debuff Icon Offset"], C.nameplates, "debuffoffset")
CreateConfig(U["nameplates"], T["Debuff Icon Size"], C.nameplates, "debuffsize")
CreateConfig(U["nameplates"], T["Estimate Debuffs"], C.nameplates, "guessdebuffs", "checkbox")
CreateConfig(U["nameplates"], T["Show Debuff Stacks"], C.nameplates.debuffs, "showstacks", "checkbox")
CreateConfig(U["nameplates"], T["Filter Mode"], C.nameplates.debuffs, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter)
CreateConfig(U["nameplates"], T["Blacklist"], C.nameplates.debuffs, "blacklist", "list")
Expand Down
5 changes: 3 additions & 2 deletions modules/nameplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,17 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
-- update debuff positions
local width = tonumber(C.nameplates.width)
local debuffsize = tonumber(C.nameplates.debuffsize)
local debuffoffset = tonumber(C.nameplates.debuffoffset)
local limit = floor(width / debuffsize)
local font = C.nameplates.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
local font_style = C.nameplates.name.fontstyle

local aligna, alignb, offs, space
if C.nameplates.debuffs["position"] == "BOTTOM" then
aligna, alignb, offs, space = "TOPLEFT", "BOTTOMLEFT", -4, -1
aligna, alignb, offs, space = "TOPLEFT", "BOTTOMLEFT", -debuffoffset, -1
else
aligna, alignb, offs, space = "BOTTOMLEFT", "TOPLEFT", 4, 1
aligna, alignb, offs, space = "BOTTOMLEFT", "TOPLEFT", debuffoffset, 1
end

nameplate.debuffs[i].stacks:SetFont(font, font_size, font_style)
Expand Down

0 comments on commit 06ddbcd

Please sign in to comment.