Commit Graph
4 Commits
Author SHA1 Message Date
Brues 907d282a68 Centralize cooldown setup and settings
Every pfUI cooldown is now made by CreateCooldown(parent, kind) in the
new api/cooldown.lua, which replaces the cooldown module. A kind names
what the cooldown times: actionbar, bags, blizzard (spellbook and
character), unitframe, indicator, nameplate, buff, tooltip, totem or
lossofcontrol. The pfCooldownType, pfCooldownStyleText,
pfCooldownStyleAnimation and pfCooldownSize fields are gone. The new
file owns everything the cooldowns share:
- the numbers' font and size
- the formatter
- each kind's numbers, sweep and sweep direction
- the GCD threshold for spell kinds
- the CooldownFrame_SetTimer hook for other addons' Cooldown frames
UpdateCooldowns applies changed settings to every cooldown at once.
GetAuraTimer moves here from the unit frames.

All settings live in one C.cooldown table, on one page: Settings ->
Cooldown. It has the shared font, size, threshold, tenths and colors,
then "Show Numbers On", "Show Sweep On" and "Reverse Sweep On" lists
with a checkbox per kind. The per-module options are removed:
- each unit frame's timer text, animation and reverse, and the
  indicators' "Show Time Left"
- the nameplate debuff timer options
- the Blizzard and foreign font sizes and toggles
- Action Bars' cooldown text size
- the reverse options of bars, bags, buffs and totems
The old appearance.cd settings are not migrated.

The player buff frame and the tooltip aura icons now show the native
countdown too, which replaces their own text and OnUpdate ticking. The
buff frame keeps its inside or below-the-icon placement. Weapon
enchants report only their time left, so they start through
SetCooldownTimeLeft: numbers, no sweep. A slim poll remains for their
charges and renewals, since no event reports those. Buff indicators
now take the aura's real duration, which gives them a correct sweep.
The spellbook and character slots now hide GCD numbers like the other
spell cooldowns.
2026-10-31 19:17:14 -05:00
Brues b6f58b0e04 Drive auras from UNIT_AURA_DELTA
UNIT_AURA says nothing about what changed and stays silent when a buff
is refreshed or its duration packet lands, so a recast HoT kept its old
timer until something else rebuilt the row. UNIT_AURA_DELTA reports
added, updated and removed aura instances, refreshes included.

Unit frames register it on their own token. An add, a removal or a full
update rebuilds the auras as before; an update-only delta re-reads the
slot behind each shown icon for its stacks and timer and redraws the
buff indicators, without a relayout or a dispel scan. Frames that
follow a GUID (the target-of-X chain) stay on UNIT_AURA, since the
delta only fires for tokens. A finished aura layout announces itself
as "unitframe:auras".

buffwatch drops its 0.4s rescan: bars rebuild on the delta, on login
and on a target change, and a timer wakes the frame when the next aura
crosses the bar threshold. Bars re-anchor when the player or target
frame lays out its aura rows, and a whitelist or blacklist click
applies at once.

Nameplates, the loss of control alert and the equipment manager's
mount/stealth/dining check listen to the delta as well.
2026-10-31 11:32:47 -05:00
Brues 5224d02572 Drive the loss of control alert by events alone
The 0.1s rescan only caught timers that change without a loss of control
event: a refreshed debuff fires UNIT_AURA, and a second kick on a locked
school fires SPELL_UPDATE_COOLDOWN, after ClassicAPI has read the lockout
from the packet. The alert listens to both while it shows. pfUI's
cooldown text prints the time left on the icon, so the alert's own
countdown and LOSS_OF_CONTROL_SECONDS go.
2026-10-30 23:23:17 -05:00
Brues f56720dccc Add a loss of control alert
A movable alert in the middle of the screen for the strongest active
effect from C_LossOfControl: icon, cooldown sweep, the effect's name and
the seconds left. A school lockout reads "<School> Locked". It opens on
LOSS_OF_CONTROL_ADDED / _UPDATE and rescans every 0.1s while shown,
because a refreshed debuff or a second kick changes the timer without an
event.

The labels are Classic Era's LOSS_OF_CONTROL_DISPLAY_* GlobalStrings,
added to each locale file. The README lists the alert and the dressing
room controls.
2026-10-30 23:16:20 -05:00