mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-08 19:38:56 +00:00
Add radial sweeps to buff/debuff icon display
This commit is contained in:
@@ -71,6 +71,8 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("buffs", nil, "debuffrowsize", "16")
|
pfUI:UpdateConfig("buffs", nil, "debuffrowsize", "16")
|
||||||
pfUI:UpdateConfig("buffs", nil, "textinside", "0")
|
pfUI:UpdateConfig("buffs", nil, "textinside", "0")
|
||||||
pfUI:UpdateConfig("buffs", nil, "fontsize", "-1")
|
pfUI:UpdateConfig("buffs", nil, "fontsize", "-1")
|
||||||
|
pfUI:UpdateConfig("buffs", nil, "cooldown_anim", "1")
|
||||||
|
pfUI:UpdateConfig("buffs", nil, "cooldown_reverse", "1")
|
||||||
|
|
||||||
pfUI:UpdateConfig("buffbar", "pbuff", "enable", "0")
|
pfUI:UpdateConfig("buffbar", "pbuff", "enable", "0")
|
||||||
pfUI:UpdateConfig("buffbar", "pbuff", "use_unitfonts", "0")
|
pfUI:UpdateConfig("buffbar", "pbuff", "use_unitfonts", "0")
|
||||||
|
|||||||
+33
-1
@@ -33,7 +33,7 @@ pfUI:RegisterModule("buff", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local slots = buff.btype == "HELPFUL" and helpfulSlots or harmfulSlots
|
local slots = buff.btype == "HELPFUL" and helpfulSlots or harmfulSlots
|
||||||
local name, icon, count, dispelType, _, expirationTime, _, _, _, spellId = C_UnitAuras.UnitAuraBySlot("player", slots[buff.id])
|
local name, icon, count, dispelType, duration, expirationTime, _, _, _, spellId = C_UnitAuras.UnitAuraBySlot("player", slots[buff.id])
|
||||||
|
|
||||||
--detect weapon buffs
|
--detect weapon buffs
|
||||||
if buff.btype == "HELPFUL" and ((C.buffs.separateweapons == "0" and buff.gid <= pfUI.buff.wepbuffs.count) or (pfUI.buff.wepbuffs.count > 0 and buff.weapon ~= nil)) then
|
if buff.btype == "HELPFUL" and ((C.buffs.separateweapons == "0" and buff.gid <= pfUI.buff.wepbuffs.count) or (pfUI.buff.wepbuffs.count > 0 and buff.weapon ~= nil)) then
|
||||||
@@ -84,6 +84,28 @@ pfUI:RegisterModule("buff", function ()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- drive the sweep from the aura duration (weapon enchants and permanent
|
||||||
|
-- auras report no usable total, so those buttons stay text-only)
|
||||||
|
if buff.mode == buff.btype and duration and duration > 0 and expirationTime and expirationTime > 0 then
|
||||||
|
local now = GetTime()
|
||||||
|
local timeleft = expirationTime - now
|
||||||
|
if timeleft > 0 then
|
||||||
|
local effDuration = duration > timeleft and duration or timeleft
|
||||||
|
local newStart = now + timeleft - effDuration
|
||||||
|
if buff.cdStart == nil or abs(buff.cdStart - newStart) > .5 or buff.cdDuration ~= effDuration then
|
||||||
|
CooldownFrame_SetTimer(buff.cd, newStart, effDuration, 1)
|
||||||
|
buff.cdStart = newStart
|
||||||
|
buff.cdDuration = effDuration
|
||||||
|
end
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(buff.cd, 0, 0, 0)
|
||||||
|
buff.cdStart = nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(buff.cd, 0, 0, 0)
|
||||||
|
buff.cdStart = nil
|
||||||
|
end
|
||||||
|
|
||||||
buff:Show()
|
buff:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -117,6 +139,14 @@ pfUI:RegisterModule("buff", function ()
|
|||||||
buff.stacks:SetJustifyV("BOTTOM")
|
buff.stacks:SetJustifyV("BOTTOM")
|
||||||
buff.stacks:SetAllPoints(buff)
|
buff.stacks:SetAllPoints(buff)
|
||||||
|
|
||||||
|
-- radial sweep (the template covers the button and starts hidden;
|
||||||
|
-- the cooldown hook drives it from here, text stays with buff.timer)
|
||||||
|
buff.cd = CreateFrame("Cooldown", buttonName .. "Cooldown", buff, "CooldownFrameTemplate")
|
||||||
|
buff.cd.pfCooldownType = "ALL"
|
||||||
|
buff.cd.pfCooldownStyleText = 0
|
||||||
|
buff.cd.pfCooldownStyleAnimation = tonumber(C.buffs.cooldown_anim) or 0
|
||||||
|
buff.cd.pfCooldownReverse = tonumber(C.buffs.cooldown_reverse) or 0
|
||||||
|
|
||||||
buff:RegisterForClicks("RightButtonUp")
|
buff:RegisterForClicks("RightButtonUp")
|
||||||
|
|
||||||
buff.weapon = weapon
|
buff.weapon = weapon
|
||||||
@@ -307,6 +337,8 @@ pfUI:RegisterModule("buff", function ()
|
|||||||
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing)
|
offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing)
|
||||||
end
|
end
|
||||||
buff:SetSize(buffSize, buffSize)
|
buff:SetSize(buffSize, buffSize)
|
||||||
|
buff.cd.pfCooldownStyleAnimation = tonumber(C.buffs.cooldown_anim) or 0
|
||||||
|
buff.cd.pfCooldownReverse = tonumber(C.buffs.cooldown_reverse) or 0
|
||||||
buff:ClearAllPoints()
|
buff:ClearAllPoints()
|
||||||
buff:SetPoint("TOPRIGHT", relFrame, "TOPRIGHT",offsetX, offsetY)
|
buff:SetPoint("TOPRIGHT", relFrame, "TOPRIGHT",offsetX, offsetY)
|
||||||
|
|
||||||
|
|||||||
@@ -2497,6 +2497,8 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
CreateConfig(U["buff"], T["Number Of Debuffs Per Row"], C.buffs, "debuffrowsize")
|
CreateConfig(U["buff"], T["Number Of Debuffs Per Row"], C.buffs, "debuffrowsize")
|
||||||
CreateConfig(U["buff"], T["Show Duration Inside Buff"], C.buffs, "textinside", "checkbox")
|
CreateConfig(U["buff"], T["Show Duration Inside Buff"], C.buffs, "textinside", "checkbox")
|
||||||
CreateConfig(U["buff"], T["Buff Font Size"], C.buffs, "fontsize")
|
CreateConfig(U["buff"], T["Buff Font Size"], C.buffs, "fontsize")
|
||||||
|
CreateConfig(Reload, T["Show Timer Animation"], C.buffs, "cooldown_anim", "checkbox")
|
||||||
|
CreateConfig(Reload, T["Reverse Timer Animation"], C.buffs, "cooldown_reverse", "checkbox")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CreateGUIEntry(T["Buffs"], T["Totem Icons"], function()
|
CreateGUIEntry(T["Buffs"], T["Totem Icons"], function()
|
||||||
|
|||||||
Reference in New Issue
Block a user