mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 10:26:02 +00:00
unitframes: add option for timeleft on indicators
This commit is contained in:
@@ -205,6 +205,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", nil, "all_procs", "0")
|
||||
pfUI:UpdateConfig("unitframes", nil, "debuffs_class", "0")
|
||||
pfUI:UpdateConfig("unitframes", nil, "indicator_size", "10")
|
||||
pfUI:UpdateConfig("unitframes", nil, "indicator_time", "1")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", nil, "clickcast", "")
|
||||
pfUI:UpdateConfig("unitframes", nil, "clickcast_shift", "")
|
||||
|
||||
+12
-3
@@ -1689,8 +1689,10 @@ function pfUI.uf:ClickAction(button)
|
||||
end
|
||||
end
|
||||
|
||||
function pfUI.uf:AddIcon(frame, pos, icon, timeleft)
|
||||
function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks)
|
||||
local showtime = C.unitframes.indicator_time == "1" and true or nil
|
||||
local iconsize = tonumber(C.unitframes.indicator_size)
|
||||
|
||||
if not frame.hp then return end
|
||||
local frame = frame.hp.bar
|
||||
if pos > 6 or pos > ceil(frame:GetWidth() / iconsize) then return end
|
||||
@@ -1711,11 +1713,18 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft)
|
||||
frame.icon[i].cd = CreateFrame(COOLDOWN_FRAME_TYPE, nil, frame.icon[i])
|
||||
frame.icon[i].cd.pfCooldownType = "ALL"
|
||||
frame.icon[i].cd:SetAlpha(0)
|
||||
CreateBackdrop(frame.icon[i], nil, true)
|
||||
end
|
||||
end
|
||||
frame.icon[pos].tex:SetTexture(icon)
|
||||
CooldownFrame_SetTimer(frame.icon[pos].cd, GetTime(), (timeleft and timeleft < 100 and iconsize > 9 and timeleft or 0), 1)
|
||||
pfUI.api.CreateBackdrop(frame.icon[pos], nil, true)
|
||||
|
||||
-- show remaining time if config is set
|
||||
if showtime and timeleft and timeleft < 100 and iconsize > 9 then
|
||||
CooldownFrame_SetTimer(frame.icon[pos].cd, GetTime(), timeleft, 1)
|
||||
else
|
||||
CooldownFrame_SetTimer(frame.icon[pos].cd, GetTime(), 0, 1)
|
||||
end
|
||||
|
||||
frame.icon[pos]:Show()
|
||||
end
|
||||
|
||||
|
||||
@@ -1499,6 +1499,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
|
||||
CreateConfig(nil, T["Show Procs as Buff Indicators"], C.unitframes, "show_procs", "checkbox")
|
||||
CreateConfig(nil, T["Show Totems as Buff Indicators"], C.unitframes, "show_totems", "checkbox")
|
||||
CreateConfig(nil, T["Show Procs of all Classes"], C.unitframes, "all_procs", "checkbox")
|
||||
CreateConfig(nil, T["Buff Indicator Show Time"], C.unitframes, "indicator_time", "checkbox")
|
||||
CreateConfig(nil, T["Buff Indicator Size"], C.unitframes, "indicator_size")
|
||||
CreateConfig(nil, T["Only Show Indicators for Dispellable Debuffs"], C.unitframes, "debuffs_class", "checkbox")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user