From 61785e937f4b29e13a0d1ae072ae4c263a4a339d Mon Sep 17 00:00:00 2001 From: shagu Date: Wed, 1 Jul 2020 17:55:23 +0200 Subject: [PATCH] nameplates: add option to show debuff stacks --- api/config.lua | 1 + modules/gui.lua | 1 + modules/nameplates.lua | 14 ++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/api/config.lua b/api/config.lua index cf9844e0..22296eca 100644 --- a/api/config.lua +++ b/api/config.lua @@ -661,6 +661,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("nameplates", "debuffs", "filter", "none") pfUI:UpdateConfig("nameplates", "debuffs", "whitelist", "") pfUI:UpdateConfig("nameplates", "debuffs", "blacklist", "") + pfUI:UpdateConfig("nameplates", "debuffs", "showstacks", "0") pfUI:UpdateConfig("abuttons", nil, "enable", "0") pfUI:UpdateConfig("abuttons", nil, "position", "bottom") diff --git a/modules/gui.lua b/modules/gui.lua index 70af3272..a843d393 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2108,6 +2108,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U["nameplates"], T["Enable Debuffs"], C.nameplates, "showdebuffs", "checkbox") CreateConfig(U["nameplates"], T["Estimate Debuffs"], C.nameplates, "guessdebuffs", "checkbox") CreateConfig(U["nameplates"], T["Debuff Icon Size"], C.nameplates, "debuffsize") + 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") CreateConfig(U["nameplates"], T["Whitelist"], C.nameplates.debuffs, "whitelist", "list") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 3adeeb91..7a3d3506 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -255,6 +255,12 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () debuffs[i].icon:SetTexture(.3,1,.8,1) debuffs[i].icon:SetAllPoints(debuffs[i]) + debuffs[i].stacks = debuffs[i]:CreateFontString(nil, "OVERLAY") + debuffs[i].stacks:SetAllPoints(debuffs[i]) + debuffs[i].stacks:SetJustifyH("RIGHT") + debuffs[i].stacks:SetJustifyV("BOTTOM") + debuffs[i].stacks:SetTextColor(1,1,0) + debuffs[i].cd = CreateFrame(COOLDOWN_FRAME_TYPE, nil, debuffs[i], "CooldownFrameTemplate") debuffs[i].cd.pfCooldownType = "ALL" end @@ -371,6 +377,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () -- update debuff positions local limit = floor(width / debuffsize) for i=1,16 do + nameplate.debuffs[i].stacks:SetFont(font, font_size, font_style) nameplate.debuffs[i]:ClearAllPoints() if i == 1 then nameplate.debuffs[i]:SetPoint("TOPLEFT", nameplate.health, "BOTTOMLEFT", 0, -4) @@ -535,6 +542,13 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () plate.debuffs[index].icon:SetTexture(texture) plate.debuffs[index].icon:SetTexCoord(.078, .92, .079, .937) + if stacks and stacks > 1 and C.nameplates.debuffs["showstacks"] == "1" then + plate.debuffs[index].stacks:SetText(stacks) + plate.debuffs[index].stacks:Show() + else + plate.debuffs[index].stacks:Hide() + end + if duration and timeleft then plate.debuffs[index].cd:SetAlpha(0) plate.debuffs[index].cd:Show()