nameplates: add option for custom debuff icon size

This commit is contained in:
shagu
2020-04-28 12:37:01 +02:00
parent 3b2847d2a0
commit 65374aea5a
3 changed files with 18 additions and 9 deletions
+1
View File
@@ -622,6 +622,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "showhp", "0")
pfUI:UpdateConfig("nameplates", nil, "vpos", "-10")
pfUI:UpdateConfig("nameplates", nil, "width", "120")
pfUI:UpdateConfig("nameplates", nil, "debuffsize", "14")
pfUI:UpdateConfig("nameplates", nil, "heighthealth", "8")
pfUI:UpdateConfig("nameplates", nil, "heightcast", "8")
pfUI:UpdateConfig("nameplates", nil, "cpdisplay", "0")
+1
View File
@@ -2039,6 +2039,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U["nameplates"], T["Nameplate Width"], C.nameplates, "width")
CreateConfig(U["nameplates"], T["Healthbar Height"], C.nameplates, "heighthealth")
CreateConfig(U["nameplates"], T["Castbar Height"], C.nameplates, "heightcast")
CreateConfig(U["nameplates"], T["Debuff Icon Size"], C.nameplates, "debuffsize")
CreateConfig(U["nameplates"], T["Enable Combo Point Display"], C.nameplates, "cpdisplay", "checkbox")
CreateConfig(U["nameplates"], T["Highlight Target Nameplate"], C.nameplates, "targethighlight", "checkbox")
CreateConfig(U["nameplates"], T["Draw Glow Around Target Nameplate"], C.nameplates, "targetglow", "checkbox")
+16 -9
View File
@@ -183,13 +183,6 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
debuffs[i] = CreateFrame("Frame", nil, nameplate)
debuffs[i]:Hide()
debuffs[i]:SetFrameLevel(1)
if i == 1 then
debuffs[i]:SetPoint("TOPLEFT", nameplate.health, "BOTTOMLEFT", 0, -4)
elseif i <= 8 then
debuffs[i]:SetPoint("LEFT", debuffs[i-1], "RIGHT", 1, 0)
elseif i > 8 then
debuffs[i]:SetPoint("TOPLEFT", debuffs[i-8], "BOTTOMLEFT", 0, -1)
end
debuffs[i].icon = debuffs[i]:CreateTexture(nil, "BACKGROUND")
debuffs[i].icon:SetTexture(.3,1,.8,1)
@@ -279,6 +272,9 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
local plate_height_cast = C.nameplates.heighthealth + font_size + 5 + C.nameplates.heightcast + 5
local combo_size = 5
local width = tonumber(C.nameplates.width)
local debuffsize = tonumber(C.nameplates.debuffsize)
nameplate:SetWidth(plate_width)
nameplate:SetHeight(plate_height)
nameplate:SetPoint("TOP", parent, "TOP", 0, 0)
@@ -301,9 +297,20 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
nameplate.raidicon:SetWidth(C.nameplates.raidiconsize)
nameplate.raidicon:SetHeight(C.nameplates.raidiconsize)
-- update debuff positions
local limit = floor(width / debuffsize)
for i=1,16 do
nameplate.debuffs[i]:SetWidth(14)
nameplate.debuffs[i]:SetHeight(14)
nameplate.debuffs[i]:ClearAllPoints()
if i == 1 then
nameplate.debuffs[i]:SetPoint("TOPLEFT", nameplate.health, "BOTTOMLEFT", 0, -4)
elseif i <= limit then
nameplate.debuffs[i]:SetPoint("LEFT", nameplate.debuffs[i-1], "RIGHT", 1, 0)
elseif i > limit then
nameplate.debuffs[i]:SetPoint("TOPLEFT", nameplate.debuffs[i-limit], "BOTTOMLEFT", 0, -1)
end
nameplate.debuffs[i]:SetWidth(tonumber(C.nameplates.debuffsize))
nameplate.debuffs[i]:SetHeight(tonumber(C.nameplates.debuffsize))
end
for i=1,5 do