Swing timer: bars fill from duration objects, drop the OnUpdate

Each bar fills itself from a duration object of the swing, a text
binding counts it down, and the marker with its glows rides the fill's
edge. One C_Timer per bar ends the swing, runs the melee grace and
switches a hunter's reload to the deadzone. Colors update on the events
that change them, ACTIONBAR_UPDATE_STATE standing in for the per-tick
IsCurrentAction reconcile; a bar waiting past its grace hides on
STOP_AUTOATTACK or leaving combat. The three bar builders become one.

The Swing Timer throttle setting only paced the OnUpdate, so it goes.
This commit is contained in:
Brues
2026-11-03 01:07:02 -06:00
parent 9187155ea6
commit 14ae659f2a
3 changed files with 230 additions and 520 deletions
-61
View File
@@ -1788,67 +1788,6 @@ pfUI:RegisterModule("gui", function ()
end, true)
end)
CreateGUIEntry(T["Throttling"], T["Swing Timer"], function()
local swingCustom
CreateConfig(function()
if swingCustom and swingCustom.input then
local isCustom = pfUI.throttle:IsCustom("swingtimer")
if not isCustom then
swingCustom.input:EnableMouse(false)
swingCustom.input:EnableKeyboard(false)
swingCustom.input:ClearFocus()
swingCustom.input:SetTextColor(.5,.5,.5,1)
swingCustom.input:SetText(tostring(pfUI.throttle:GetFps("swingtimer")))
else
swingCustom.input:EnableMouse(true)
swingCustom.input:EnableKeyboard(true)
swingCustom.input:SetTextColor(.2,1,.8,1)
if _G.pfUI_throttle.swingtimer_custom then
swingCustom.input:SetText(_G.pfUI_throttle.swingtimer_custom)
end
end
end
end, T["Swing Timer Update Rate"], _G.pfUI_throttle, "swingtimer", "dropdown", {
"very_slow:" .. T["Very Slow"] .. " (2 FPS)",
"slow:" .. T["Slow"] .. " (5 FPS)",
"normal:" .. T["Normal"] .. " (10 FPS)",
"fast:" .. T["Fast"] .. " (20 FPS)",
"very_fast:" .. T["Very Fast"] .. " (30 FPS)",
"fastest:" .. T["Fastest"] .. " (50 FPS)",
"custom:" .. T["Custom"],
})
swingCustom = CreateConfig(nil, T["Custom FPS"], _G.pfUI_throttle, "swingtimer_custom")
local isCustom = pfUI.throttle:IsCustom("swingtimer")
if not isCustom then
swingCustom.input:EnableMouse(false)
swingCustom.input:EnableKeyboard(false)
swingCustom.input:SetTextColor(.5,.5,.5,1)
swingCustom.input:SetText(tostring(pfUI.throttle:GetFps("swingtimer")))
else
swingCustom.input:EnableMouse(true)
swingCustom.input:EnableKeyboard(true)
swingCustom.input:SetTextColor(.2,1,.8,1)
if _G.pfUI_throttle.swingtimer_custom then
swingCustom.input:SetText(_G.pfUI_throttle.swingtimer_custom)
end
end
-- Spacer before reset button
local spacer = CreateConfig(nil, " ", nil, nil, "header")
spacer:GetParent().objectCount = spacer:GetParent().objectCount - 1
spacer:SetHeight(10)
-- Reset to defaults button
CreateConfig(nil, T["Reset to Defaults"], nil, nil, "button", function()
pfUI.throttle:ResetToDefault("swingtimer")
_G.pfUI_throttle.swingtimer_custom = "50"
Reload()
end, true)
end)
CreateGUIEntry(T["Unit Frames"], T["General"], function()
CreateConfig(nil, T["Disable pfUI Unit Frames"], C.unitframes, "disable", "checkbox")
CreateConfig(nil, T["Animate Health And Power Bars"], C.unitframes, "animatebars", "checkbox")