Commit Graph
4208 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 149c8cb3c3 Bump CAPI min to 11813 2026-10-31 19:00:19 -05:00
Brues 93ab07a662 Show cooldown text through ClassicAPI's native countdown
The cooldown module no longer builds its own text frame with a 10 Hz
OnUpdate per cooldown. The CooldownFrame_SetTimer hook now configures
each Cooldown frame's own countdown instead: SetHideCountdownNumbers
for the per-frame text toggles and omnicc's noCooldownCount,
SetMinimumCountdownDuration for the GCD threshold, and
GetCountdownFontString for the pfUI font and size. The engine ticks
the numbers, gated by the countdownForCooldowns cvar. The cvar gets a
checkbox in the Cooldown settings, and pfUI.SetupCVars turns it on.

The text comes from one shared C_StringUtil numeric rule formatter,
given to each frame with SetCountdownFormatter. Its breakpoints keep
pfUI's format: the number in its unit's cooldown color, a unit (m/h/d)
once the unit below passes 99, and tenths in the low color when
milliseconds are on. Values now round up. GetColoredTimeString formats
through the same formatter, so the buff, buffwatch and tooltip timers
match. A config:changed callback rebuilds the breakpoints, and every
frame picks them up on its next update.

The paper-doll slots swap their indicator Models for Cooldown frames,
as the spellbook and bags already do. They and the spellbook take the
BLIZZARD tag when they are created, replacing the per-update hooks in
the skin module. Models get no numbers. Hide Foreign Cooldown
Animations clears the draw flags instead of setting alpha to 0, so the
numbers stay visible. The buff module's sweep hides its numbers
because buff.timer carries the text.
2026-10-31 18:45:17 -05:00
Brues 84da90c7d4 Run the raid and questitem delay timers on C_Timer
Both modules waited out their delays in an OnUpdate script. Each now
keeps one C_Timer.NewTimer handle and cancels it whenever a new request
comes in, so the update runs 0.5 s after the last one.

Raid: the roster pass becomes pfUI.uf.raid:UpdateRoster, and
pfUI.uf.raid:QueueUpdate schedules it. Roster events queue it with a
0.5 s delay; a config change or a tank toggle queues it for the next
frame. The frame no longer shows and hides itself to run the pass, and
the extra 1 s throttle is gone because the debounce already merges
bursts.

Questitem: without the OnUpdate script the scanner frame only handled
events, so it moves onto pfUI.events with one callback per event, and
pfUI.questitem becomes a plain table. The showquest check now lives in
QueueSeed.
2026-10-31 17:25:44 -05:00
Brues d2cefe69cf Add a DBM-style range radar for party and raid members
/radar toggles it and /radar <yards> sets the range; the right-click
menu and the mouse wheel step through 5-40 yd. The map turns with
GetPlayerFacing so ahead is up, and ClassicAPI.UnitPosition places
class-colored dots (the mirrored name, since SuperWoW takes the global
with x, y, z order).

The range ring is two stacked TempPortraitAlphaMask discs: a ring-color
disc under a slightly smaller background-color one. It turns red when a
member is inside the range, and a list under the radar shows the five
nearest with their raid markers inline. Raid markers come from the
markN tokens, so marked mobs show too and a marked member shows the
marker instead of a dot.

Units behind terrain (UnitInLineOfSight, traced 4x a second) are
dimmed. Units on another floor, over 5 yd up or down and steeper than
45 degrees so hills don't count, get an arrow above or below them.
Hovering a blip shows its name, distance and both states; clicking a
blip or a list row targets it.
2026-10-31 17:17:35 -05:00
Brues 9da2d459dd Fix dressup Undress button text: UNDRESS global doesn't exist in 1.12.1 2026-10-31 16:43:29 -05:00
Brues 2b7febf617 Replace pfUI's clamp/isempty/modf with ClassicAPI's Clamp/TableIsEmpty
The world map's shift/ctrl wheel alpha and scale use Clamp, and the
fresh-install profile check uses TableIsEmpty (pfUI_init and pfUI_config
are always tables by then). modf only wrapped math.modf and had no callers.
2026-10-31 15:47:52 -05:00
Brues 3b64bfa98b Show the target LoS indicator through ClassicAPI's UnitInLineOfSight
The indicator moves from the unitxp module to the target frame, so it no
longer needs UnitXP_SP3. Its checkbox and the shared font size move to a
Target Indicators header; unitxp_font_size becomes indicator_font_size.
The unused pfUI.api.UnitInLineOfSight wrapper, which shadowed the
ClassicAPI global inside the pfUI environment, is removed.
2026-10-31 15:41:15 -05:00
Brues 217b00e9a4 Use ClassicAPI.strsplit for pfUI's strsplit 2026-10-31 15:33:13 -05:00
Brues 2d5cf94ae1 Fold librange into pfUI.api.UnitInRange 2026-10-31 15:23:13 -05:00
Brues 7ba0fedd2b Make the inspect window movable by dropping EnableMovable's addon wait 2026-10-31 15:21:18 -05:00
Brues b6a41e70ec Switch action bar pages and shift-drag on MODIFIER_STATE_CHANGED 2026-10-31 15:16:28 -05:00
Brues e43ddd31fd Read nameplate units directly instead of scanning by name 2026-10-31 15:08:39 -05:00
Brues f81ea09d1c Choose 3D, 2D or round/square class icon portraits 2026-10-31 14:43:43 -05:00
Brues 78d4e0a56e Run the Turtle WoW setup with RunNextFrame and hook the map once
The one-shot OnUpdate frame becomes RunNextFrame. Its call into the map loader ran with the delay frame as this, so the loader's hooked flag sat on a different frame than on PLAYER_ENTERING_WORLD and the map hooks went on twice: shift and ctrl mouse wheel changed alpha and scale by two steps. The flag is now a local of the module.
2026-10-31 14:28:01 -05:00
Brues caf7112651 Scan chat bubbles once per frame with DirtiableMixin
Each chat message queued its own scan for the next frame, so a busy frame scanned the same bubbles several times. MarkDirty runs one scan for all of that frame's messages.
2026-10-31 14:28:01 -05:00
Brues e5a78c8d54 Animate unit frame bars with ClassicAPI's SmoothStatusBarMixin
Health and power bars take SmoothStatusBarMixin instead of pfUI's own OnUpdate animation, so the animation no longer runs faster at higher frame rates. The speed dropdown becomes an on/off checkbox, since the mixin's rate is fixed. A new range keeps the bar's filled share, so it doesn't jump before the animation moves on.
2026-10-31 14:20:20 -05:00
Brues 43f90751d6 Clear AFK when a holiday scene is clicked 2026-10-31 13:45:35 -05:00
Brues f90279e003 Drive the haste and spell power text from events
Replace the 0.25s ticker with UNIT_SPELL_HASTE for haste and
PLAYER_DAMAGE_DONE_MODS for spell power, which fires on the
MOD_DAMAGE_DONE fields GetSpellBonusDamage reads.
2026-10-31 13:27:48 -05:00
Brues 17fe9f0dd9 Drive the mounted trigger from PLAYER_MOUNT_DISPLAY_CHANGED
IsMounted reads the mount display field, which this event watches. The trigger listened to UNIT_AURA_DELTA, which can fire before that field updates and only worked because the switch waits half a second. UNIT_AURA_DELTA still drives the stealth and dining triggers.
2026-10-31 13:20:03 -05:00
Brues 54e66fea11 Drive range, offline, aggro and combat state from events
Every unit frame re-checked its range fade, offline state, combat and
aggro glow and indicator icons on a 0.2-0.5s tick, and infight polled
aggro every 0.3s. Each now comes from an event.

Aggro: the 270-token scan and its cache are gone. UNIT_TARGET fires for
every unit in view (SuperWoW registers them all), so a table of which
hostile unit attacks which friendly one, by GUID, follows every attacker,
including ones no token reaches. A unit that comes into view mid-fight
is noted when a token first reaches it (target, focus, mouseover, a
nameplate, a member's target). A read drops attackers that left view,
where nothing fires, and a loading screen resets the table. Changes go
out as "aggro:changed" with the old and the new victim, so only the
frames showing those redraw; infight listens too.

Combat square and glow follow UNIT_FLAGS. Range fade follows ClassicAPI's
UNIT_IN_RANGE_UPDATE, registered only by frames that fade, by GUID for a
chained unit; with the 40y check off, frames fade by sight through
UNIT_DISTANCE_CHECK_UPDATE, which also swaps a portrait's question mark
for the model. A UnitXP threshold has no event and keeps its poll.
UNIT_CONNECTION refreshes a member who goes offline or comes back; the
PARTY_MEMBER_ENABLE/DISABLE branches were never registered.

A full refresh now draws the indicator icons and combat state, so a new
unit brings its own. UNIT_FACTION redraws the PvP icon and reaction
colour; its "pvp" refresh step drew nothing. Unlock mode and /pftest
re-apply the fade on entry and exit.

What stays on the tick: the pet frames and the UnitXP range check.
2026-10-31 13:10:46 -05:00
Brues d21d13bdfa Skin ClassicAPI options edit boxes instead of treating them as dropdowns 2026-10-31 12:40:07 -05:00
Brues 480889cb05 Drive power from UNIT_POWER_UPDATE and UNIT_MAXPOWER
1.12's UNIT_MANA, UNIT_RAGE and the rest fire for every power a unit
has, not only the one it shows, so a druid in cat or bear form redrew
every frame showing them, health colours and texts included, on each
mana tick. ClassicAPI's generic power events name the power in arg2.

Unit frames register them on their own token and redraw only for the
power their bar shows, or for mana under a druid mana bar. They fire
for tokens only, so the GUID-followed target-of-X frames keep the
per-type events; those now share one list with UNIT_AURA, so a frame
swaps auras and power on the same check.

energytick counts gains on the power it tracks alone, so a cat druid's
mana regen is no longer read as energy. It forgets the power while
hidden, so a bear's mana ticks are not measured against rage, and
re-baselines on a shift, so leaving cat form is not a fake mana gain.

The equipment manager's dining trigger wakes on mana changes only.
2026-10-31 11:55:54 -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 8b5a27f9be Expire cached aggro on UNIT_TARGET
UnitHasAggro caches a positive answer for 1s and a negative one for
0.3s, so the aggro glow lagged a taunt or a mob turning on a healer by
up to that long. A retarget now expires the entries it can affect: every
unit that had aggro and the retargeting unit's new target. The rest stay
cached, so the scan runs no more often. Mobs without a token of their
own fire it with their GUID, and "<guid>target" composes.
2026-10-31 06:36:42 -05:00
Brues cc5c562516 Rebuild the unit tooltip when its unit retargets
pfUI's unit lines -- target, guild, colours, speed, unit id, the buff
row -- were added once from OnShow, so the target line went stale while
hovering, and any SetUnit on a shown tooltip wiped them. They now go on
from OnTooltipSetUnit, every time a unit is set.

While a unit tooltip is up it listens for UNIT_TARGET on the unit's
GUID and re-sets the unit a frame later, through the token the tooltip
was built from: "mouseover" stops naming the unit once the cursor
leaves, so a fading tooltip is left to fade. Item and spell ids stay on
OnShow.
2026-10-31 06:36:42 -05:00
Brues a9542bd467 Follow target-of-target frames with UNIT_TARGET
A frame whose unit is another unit's target (targettarget,
targettargettarget, pettarget, focustarget, partyNtarget) has no token
that unit events name, so it polled: bars every 0.2s, a full aura and
portrait rescan every second, and a GUID compare to notice swaps.

Such a frame now registers its unit events by the unit's GUID, which
every unit event also fires with, and UNIT_TARGET by the GUID of every
link of its chain. A link retargeting re-points the frame at once and
queues one full refresh; the ticks are gone. The 0.2s visibility timer
stays for them, since nothing reports a unit going out of sight.

Nameplates register UNIT_TARGET on their own token, so a mob turning to
someone else recolours its combat state immediately instead of after
the colour cache and data tick run out.

Drop pfScanActive and the namebuf delay: both guarded against the old
target-swapping range scan, which no longer exists. focus.lua's
instantRefresh was never read.
2026-10-31 06:27:21 -05:00
Brues 45bc65b3c0 bump CAPI min to 1.18.10 2026-10-31 06:10:04 -05:00
Brues 113ff257cf CHAT_MSG_BN_WHISPER and RAID_INSTANCE_WELCOME are not valid events 2026-10-31 03:12:33 -05:00
Brues 07e315cd86 Toggle the item comparison live with shift
The comparison read IsShiftKeyDown() only when the tooltip was set, so
pressing or releasing shift while hovering did nothing until the next
hover. Each hooked tooltip now remembers the item it shows, dropped on
OnTooltipCleared and OnHide, and MODIFIER_STATE_CHANGED shows or hides
its comparison right away, as on retail.

Merchant and auction comparisons show regardless of shift and never
store a link, so shift leaves them up.
2026-10-31 03:05:56 -05:00
Brues b3298571dd End the nameplate right-click on GLOBAL_MOUSE_UP
The right-click emulation polled IsMouselooking() every frame while the
button was held, to catch the release. GLOBAL_MOUSE_UP reports the
release directly, so the frame and its OnUpdate go away.

PLAYER_STOPPED_LOOKING can't stand in for it: ClassicAPI fires the
LOOKING pair only for left-button free-look, and only once the camera
has moved, so a click without a drag fires neither event.
2026-10-31 02:57:03 -05:00
Brues f5c08822f8 Keep empty fields and literal delimiters in strsplit
pfUI.api.strsplit (also the bare strsplit in module code) built a
"([^%s]+)" pattern from the delimiter. That dropped empty fields
("a,,b" gave "a", "b") despite the comment, and a delimiter that is a
pattern character (% ] ^ -) broke the pattern. It now scans for an
escaped character class and keeps every field, like WoW's strsplit.

The custom buff indicator list skips the empty entries this now yields
for "" and the list editor's leading "#", so an empty list no longer
scans auras.
2026-10-31 02:49:46 -05:00
Brues 6f5c225ec3 Drive unit frame visibility from events
Every unit frame re-checked its visibility five times a second. Now
group, target and pet events re-check it in OnEvent, which also runs
while a frame is hidden, and the focus module already re-checks focus
and focustarget on PLAYER_FOCUS_CHANGED.

Only the frames with a tick keep the 0.2 second poll. They show another
unit's target or a pet that can go out of sight, and no event reports
either. The focus target frame now gets the same tick as targettarget,
because no event reports the focus changing its target.

Unlock mode and /pftest have no event, so they re-check every frame
when they change. RegisterUnitWatch does not fit here. It polls on the
same 0.2 second timer, and it only shows a unit that exists, without
the pet range, raid grid and group hiding rules.
2026-10-31 02:04:20 -05:00
Brues a8d805626d Replace QueueFunction and RunOOC with RunNextFrame
RunOOC never waited for combat to end; it ran its function on the next
frame. QueueFunction ran one function every 0.2 seconds. Each caller now
defers with ClassicAPI's RunNextFrame.

The loot roll announcement sends its name lists and the roll directly.
The 0.2 second spacing did not help with the server's chat flood limit
(10 messages less than a second apart), and an announcement is at most
four messages.
2026-10-31 01:57:10 -05:00
Brues df13e30e08 Add a Valentine's Day AFK scene
Hearts drawn from a turned square and two tinted minimap-mask discs float up the screen and sway, a rosy glow lines the edges, and the goblin Cupid hovers by the side.
2026-10-31 01:50:12 -05:00
Brues 235422689b Add Hallow's End and Christmas AFK scenes
The fireworks screen becomes a shared AFK scene: a fading night, the greeting, and a click or coming back to close it. Hallow's End gets a flickering candlelight edge and a row of undead, seven of fifteen creature displays at random, that rise one after another. Christmas gets endless snowfall and a drift that piles up for as long as the player is AFK. Fireworks now spawn across the scene's own size instead of the UI-scaled screen size.
2026-10-31 01:50:12 -05:00
Brues f79494a53a Play the New Year fireworks as animation groups
Explosions are pooled textures that grow and fade with a Scale and Alpha group instead of resizing frames every frame, and the night fades in with an Alpha group instead of stepping alpha per frame.
2026-10-31 00:53:57 -05:00
Brues 7db85b6c07 Play button press animations as animation groups
Each style is now a list of keyframes that a button builds into chained
Scale and Alpha animations the first time it plays. The animations are
timed by the engine instead of stepping by 30/GetFramerate() each frame,
scale the drawing instead of the frame, and run no Lua while they play.
The damped bounce styles ease between the extremes of their old curves.
2026-10-31 00:45:09 -05:00
Brues 61282115a3 Pulse the screen edge glow smoothly and drive it from events
The glow stepped its color ten times a second and re-checked combat,
health and death on every step. An animation group now shifts the color
along an IN_OUT curve and pauses while the glow is hidden. Combat,
health and death update from their events. Aggro has no event, so a
ticker polls it every .3s, matching UnitHasAggro's cache, and only while
that glow is enabled.
2026-10-31 00:36:43 -05:00
Brues b64ae7dd53 Replace HookAddonOrVariable with an EventUtil-based HookAddon
The polling lurker frame is gone. HookAddon gates on
C_AddOns.DoesAddOnExist, waits for PLAYER_LOGIN with
EventUtil.ContinueOnPlayerLogin, then runs on
EventUtil.ContinueOnAddOnLoaded. Addons loaded at startup still hook
only after every pfUI module and skin exists and after the addon's
own VARIABLES_LOADED setup. Load-on-demand addons still hook on their
ADDON_LOADED.

The "or variable" form is gone. Callers that passed a global now pass
the addon that defines it: TheoryCraft, SuperMacro, DPSMate and
Turtle_GroupUI. DPSMate names its windows from its settings, so its
hook now checks for DPSMate_DPSMate itself, as the variable lookup
used to. eqcompare's Guda check uses HookAddon too.
2026-10-31 00:28:30 -05:00
Brues b9c260b8e1 Confirm clipboard copies with fading screen text instead of chat 2026-10-30 23:50:42 -05:00
Brues ff5deac0ec Copy links with CopyToClipboard instead of a popup
Clicking a chat URL and the GUI's Donate/GitHub/Website buttons now put the address straight on the clipboard and say so in chat. The url link goes through ClassicAPI's LinkUtil handler registry, so SetItemRef is no longer replaced. Exporting a profile also copies the string.
2026-10-30 23:45:08 -05:00
Brues cff4be9416 Mousewheel Scroll Speed doesn't require a reload to change 2026-10-30 23:40:50 -05:00
Brues 6a670ab668 Tint swing timer bars while the target is out of range
C_SwingTimer checks the range for each shown bar, and
PLAYER_SWING_RANGE_UPDATE turns a bar the new Out Of Range Color (grey by
default, since the main-hand bar and the hunter dead zone are red) while
its swing can't reach the current target. The melee check is the
server's 2D reach; the ranged one covers the hunter's minimum range too.
No check (no target, nothing to attack, no weapon) keeps the normal
color.
2026-10-30 23:31:29 -05:00
Brues c5894f7f15 Scroll chat with ScrollByAmount
The mouse wheel on the chat frames and on the AFK camera's chat moves by
ScrollByAmount instead of looping ScrollUp / ScrollDown. Shift-wheel up
scrolls by the full range, so the oldest line stops on top as it does
with the wheel; ScrollToTop would leave it alone on the bottom line.
2026-10-30 23:26:36 -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
Brues 70cc994a97 Zoom, pan and per-slot undress in the dressing room
EnableClickRotate becomes EnableModelControls, the controls of 4.3.4's
ModelWithControlsTemplate: left-drag turns the model without ClassicAPI's
step animation, the mouse wheel moves the camera toward the face with
SetPortraitZoom, and right-drag pans with 4.3.4's per-race pan speed and
bounds. Showing the frame resets zoom and pan. Every model frame pfUI
skins gets them.

The dressing room gains an Undress button and a column of slot buttons
on each side, in the paperdoll's order; clicking one calls UndressSlot.
2026-10-30 23:11:09 -05:00
Brues 2c7ca8afdd Read the dock anchor only once a frame is docked
SetupMenu reads each radio's selection when the dropdown is set up at module load, before any frame is docked, so IsDockAnchor indexed a nil dock parent.
2026-10-30 22:25:27 -05:00
Brues 1b71ee617f Wait on ContinueOnItemLoad for inbox, panel and loot history items
The inbox package border now waits for the item to load, since another
player's item may not be cached. The panel and loot history drop their
cached branch: ContinueOnItemLoad runs at once for a cached item. The
swing timer reads the off-hand inventory type from the slot instead of
parsing the item link.
2026-10-30 21:44:37 -05:00