mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 21:40:49 +00:00
buffwatch: add option to only track own debuffs
This commit is contained in:
@@ -119,6 +119,7 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("buffbar", "tdebuff", "colorstacks", "0")
|
pfUI:UpdateConfig("buffbar", "tdebuff", "colorstacks", "0")
|
||||||
pfUI:UpdateConfig("buffbar", "tdebuff", "width", "-1")
|
pfUI:UpdateConfig("buffbar", "tdebuff", "width", "-1")
|
||||||
pfUI:UpdateConfig("buffbar", "tdebuff", "height", "20")
|
pfUI:UpdateConfig("buffbar", "tdebuff", "height", "20")
|
||||||
|
pfUI:UpdateConfig("buffbar", "tdebuff", "selfdebuff", "0")
|
||||||
pfUI:UpdateConfig("buffbar", "tdebuff", "filter", "blacklist")
|
pfUI:UpdateConfig("buffbar", "tdebuff", "filter", "blacklist")
|
||||||
pfUI:UpdateConfig("buffbar", "tdebuff", "threshold", "120")
|
pfUI:UpdateConfig("buffbar", "tdebuff", "threshold", "120")
|
||||||
pfUI:UpdateConfig("buffbar", "tdebuff", "whitelist", "")
|
pfUI:UpdateConfig("buffbar", "tdebuff", "whitelist", "")
|
||||||
|
|||||||
Vendored
+1
@@ -433,6 +433,7 @@ local slim = {
|
|||||||
["tdebuff"] = {
|
["tdebuff"] = {
|
||||||
["enable"] = "1",
|
["enable"] = "1",
|
||||||
["height"] = "14",
|
["height"] = "14",
|
||||||
|
["selfdebuff"] = "1",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["chat"] = {
|
["chat"] = {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ pfUI:RegisterModule("buffwatch", "vanilla:tbc", function ()
|
|||||||
return anchor
|
return anchor
|
||||||
end
|
end
|
||||||
|
|
||||||
local function GetBuffData(unit, id, type, skipTooltip)
|
local function GetBuffData(unit, id, type, selfdebuff)
|
||||||
if unit == "player" then
|
if unit == "player" then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID+id, type)
|
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID+id, type)
|
||||||
local stacks = GetPlayerBuffApplications(bid)
|
local stacks = GetPlayerBuffApplications(bid)
|
||||||
@@ -82,12 +82,15 @@ pfUI:RegisterModule("buffwatch", "vanilla:tbc", function ()
|
|||||||
local texture = GetPlayerBuffTexture(bid)
|
local texture = GetPlayerBuffTexture(bid)
|
||||||
local name
|
local name
|
||||||
|
|
||||||
if not skipTooltip and texture then
|
if texture then
|
||||||
scanner:SetPlayerBuff(bid)
|
scanner:SetPlayerBuff(bid)
|
||||||
name = scanner:Line(1)
|
name = scanner:Line(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
return remaining, texture, name, stacks
|
return remaining, texture, name, stacks
|
||||||
|
elseif libdebuff and selfdebuff then
|
||||||
|
local name, rank, texture, stacks, dtype, duration, timeleft = libdebuff:UnitOwnDebuff(unit, id)
|
||||||
|
return timeleft, texture, name, stacks
|
||||||
elseif libdebuff then
|
elseif libdebuff then
|
||||||
local name, rank, texture, stacks, dtype, duration, timeleft = libdebuff:UnitDebuff(unit, id)
|
local name, rank, texture, stacks, dtype, duration, timeleft = libdebuff:UnitDebuff(unit, id)
|
||||||
return timeleft, texture, name, stacks
|
return timeleft, texture, name, stacks
|
||||||
@@ -228,8 +231,10 @@ pfUI:RegisterModule("buffwatch", "vanilla:tbc", function ()
|
|||||||
|
|
||||||
local function RefreshBuffBarFrame(frame)
|
local function RefreshBuffBarFrame(frame)
|
||||||
-- reinitialize all active buffs
|
-- reinitialize all active buffs
|
||||||
|
local selfdebuff = frame.config.selfdebuff == "1"
|
||||||
|
|
||||||
for i=1,32 do
|
for i=1,32 do
|
||||||
local timeleft, texture, name, stacks = GetBuffData(frame.unit, i, frame.type)
|
local timeleft, texture, name, stacks = GetBuffData(frame.unit, i, frame.type, selfdebuff)
|
||||||
timeleft = timeleft or 0
|
timeleft = timeleft or 0
|
||||||
|
|
||||||
if texture and name and name ~= "" and BuffIsVisible(frame.config, name) then
|
if texture and name and name ~= "" and BuffIsVisible(frame.config, name) then
|
||||||
|
|||||||
@@ -1990,6 +1990,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
|
|||||||
CreateConfig(nil, T["Color Debuff Stacks"], C.buffbar.tdebuff, "colorstacks", "checkbox")
|
CreateConfig(nil, T["Color Debuff Stacks"], C.buffbar.tdebuff, "colorstacks", "checkbox")
|
||||||
CreateConfig(nil, T["Buffbar Width"], C.buffbar.tdebuff, "width")
|
CreateConfig(nil, T["Buffbar Width"], C.buffbar.tdebuff, "width")
|
||||||
CreateConfig(nil, T["Buffbar Height"], C.buffbar.tdebuff, "height")
|
CreateConfig(nil, T["Buffbar Height"], C.buffbar.tdebuff, "height")
|
||||||
|
CreateConfig(nil, T["Only Show Own Debuffs (|cffffaaaaExperimental|r)"], C.buffbar.tdebuff, "selfdebuff", "checkbox")
|
||||||
CreateConfig(nil, T["Filter Mode"], C.buffbar.tdebuff, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter)
|
CreateConfig(nil, T["Filter Mode"], C.buffbar.tdebuff, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter)
|
||||||
CreateConfig(nil, T["Time Threshold"], C.buffbar.tdebuff, "threshold")
|
CreateConfig(nil, T["Time Threshold"], C.buffbar.tdebuff, "threshold")
|
||||||
CreateConfig(nil, T["Whitelist"], C.buffbar.tdebuff, "whitelist", "list")
|
CreateConfig(nil, T["Whitelist"], C.buffbar.tdebuff, "whitelist", "list")
|
||||||
|
|||||||
Reference in New Issue
Block a user