Commit Graph
4132 Commits
Author SHA1 Message Date
Brues ba752056ad Stop the AFK camera when AFK clears while it spins
62e0d4eb stopped the camera only while the start delay was shown, but the
delay hides itself once the camera starts. AFK cleared during the spin
left the overlay up, and the next key press sent /afk and set AFK again.
Stop when the camera spins instead, which also keeps stop() and its
SetView(4) from running when AFK clears before the camera started.
2026-10-29 22:40:26 -05:00
Brues 1ccf87c61a Drop CreateGoldString's fallback for clients without coin icons
ClassicAPI always provides GetCoinTextureString, so the presence check
and the hand-built "g/s/c" string after it never ran.
2026-10-29 22:39:01 -05:00
Brues dc89f01dda Refresh the FPS & Lag panel tooltip while it is shown
The tooltip was built once on enter, so its memory, network and addon
figures stayed at the values from that moment. The widget's one-second
ticker now rebuilds it while the panel still owns GameTooltip. The
tooltip takes its owner as self, not this, so the ticker can call it.
2026-10-29 22:24:36 -05:00
Brues a917a70b1c Add an expand/collapse-all button to the Reputation tab
ClassicAPI 1.18's ExpandAllFactionHeaders and CollapseAllFactionHeaders
set every header in one call. The button sits on the "Faction" label's
row, in the headers' +/- column, and shows "+" while any header is
collapsed.
2026-10-29 22:24:36 -05:00
Brues 03ea3d5aa5 Clear cancelled resurrections announced over HealComm and CTRA
ParseChatMessage tested the raw message for "RessStop", which no
HealComm message is, so ParseComm's Resurrection/stop/ result was never
acted on. CTRA's RESNO was matched against the whole message, but it
carries the target's name, and the CTRA parser only recognised RES. A
cancelled rez from another player left the icon on the target's frame
until they were revived. RessStop still keeps a rez whose cast landed
and whose accept window is open.
v9.0.31
2026-10-29 18:58:15 -05:00
Brues 2b4d33d46a Keep libpredict tracking casts when HealComm is loaded
With HealComm-1.0 present (HealComm, LunaUnitFrames, NotGrid), the
compat hook unregistered every event on libpredict.sender to stop pfUI
broadcasting a duplicate of the player's casts. Since cast detection
moved onto that frame's UNIT_SPELLCAST_* handlers, that also blinded
libpredict to every cast, so the player's own resurrections never put
the rez icon on the target's frame: ParseChatMessage drops the player's
own Resurrection echo, expecting the cast events to have tracked it.

The compat hook now only mutes the outgoing HealComm and CTRA messages.
The HealComm.SendAddonMessage hook that parsed the player's own messages
while solo goes too, since libpredict tracks its own casts directly.
2026-10-29 18:56:51 -05:00
Brues 94dcfb3dad Compute bar layout options instead of tabulating pfGridmath
pfGridmath listed every exact cols x rows grid per bar size; the only
live use was seeding the layout dropdown, which a divisor loop now does.

Everything else that read it was unreachable: every layout option is a
"cols x rows" string, so ResolveBarLayout's BarLayoutFormfactor lookup
never matched, and the actionbar module resets a stored layout that
isn't one before BarLayoutSize/BarButtonAnchor run, so their fallbacks
never fired. BarLayoutFormfactor and env/tables.lua go with it.
2026-10-29 14:16:43 -05:00
Brues 0890905eb6 Drop named-unit frames and the pfValidUnits global
CreateUnitFrame and CreateCastbar could take a character name instead of
a unit token, but every caller passes a token, so that mode and the
empty-label guards around it were dead. The OnClick TargetByName branch
could never run anyway: label was always a string, and "" is truthy.

With that gone, the aggro scan was the only reader of pfValidUnits, so
its unit list now lives in unitframes.lua and is built once at load.

/focusname resolves the name with UnitTokenFromName (exact first, then
prefix) instead of swapping the target and muting UIErrorsFrame.
2026-10-29 14:00:54 -05:00
Brues 6c76a88467 Draw unit frame bars with the native StatusBar
The custom bar sized its textures in Lua from GetWidth(), so it had to
track how ClassicAPI reports the UI scale (#71), and it stretched the bar
texture instead of cropping it. The engine's StatusBar does that layout
itself.

The background of the missing part is a second StatusBar that fills
from the other end (ClassicAPI's SetReverseFill), one frame level below
the fill, so the incoming-heal texture still draws between the two.
SetFrameLevel moves both, and the health and power bars now sit two
levels above their backdrops. SetStatusBarBackgroundTexture becomes
SetStatusBarBackgroundColor, as it only ever took a color.
2026-10-29 11:06:02 -05:00
Brues 35c32f365e Remove scaledsize fix 2026-10-29 10:38:28 -05:00
Brues 6dcb5162be bags: use ClassicAPI's native item search
C_Container.SetItemSearch drives the search box; slots dim from isFiltered on INVENTORY_SEARCH_UPDATE and on each slot update. Matches name, subclass, equip slot and equipment set names. Drops the tooltip-scanning full-text option.
2026-10-29 10:35:28 -05:00
Brues 8afafe71cf Drop RunMacroText fallback and dead actionbar spellslot branches
ClassicAPI 1.18 provides RunMacroText natively; bump CAPI min to 1.18.0. spellslot/booktype/scanmacro were only ever cleared, never set.
2026-10-29 10:35:28 -05:00
Brues 99ed538ee7 bump CAPI min to 1.17.10 2026-10-29 10:35:28 -05:00
Brues f382039f21 panel: show per-addon memory in FPS & Lag tooltip
Use UpdateAddOnMemoryUsage/GetAddOnMemoryUsage like Blizzard's MainMenuBar performance tooltip: total addon memory plus the top 3 consumers, formatted with the TOTAL_MEM/ADDON_MEM global strings. Guarded so the tooltip falls back gracefully on clients without these APIs.
2026-10-29 10:35:28 -05:00
Brues 8307dd757e Bump ClassicAPI minimum 1.17.4 2026-10-29 10:35:28 -05:00
Brues 5ab5337bbc Keep status bars true to their value on ClassicAPI 1.18.0
ClassicAPI 1.18.0 divides the UI scale out of an anchored frame's
GetWidth/GetHeight, as 4.3.4 does. The status bar still divided it out
itself, so under a UI scale below 1 the bar emptied early (at 29% health
on a 0.71 scale). Only divide on older ClassicAPI.

Fixes #71
v9.0.30
2026-10-29 10:33:55 -05:00
Brues d15b1cd320 Only declare RunMacroText if it doesn't exist 2026-10-28 12:21:34 -05:00
0cabf2ec29 Add equipment manager auto-switching and "Unused" items panel (#70)
* Add equipment manager auto-switching and "Unused" items panel

Equipment manager (modules/equipmentmanager.lua):
- Add automatic set switching: ordered triggers (mounted, swimming,
  eating/drinking, shapeshift form/stance, zone, instance type, time
  of day, resting, stealthed, targeting a boss) equip a set; topmost
  matching trigger wins, with a 0.5s debounce
- Never swap gear in combat, while dead or casting; optionally restore
  the previous gear via a hidden "pfUI Auto-Restore" set
- Add an "Unused" side panel listing equippable items in bags, bank
  and paperdoll that no set uses, with an ignore list (tools and quest
  disguises pre-ignored), bank snapshot and bag highlighting
- Persist triggers, ignore list and bank snapshot in new per-character
  SavedVariable pfUI_eqmgr (all three .toc files)
- Add Character > Equipment Manager options (autoswitch, announce,
  minimum item quality, include bank) in gui.lua and config.lua
- Hide ignored-slot overlays when the manager frame is closed

Add frFR translations for the new equipment manager strings.

* equipmentmanager: lean on ClassicAPI for unused scan and autoswitch

- Unused panel: list items via GetInventoryItemsForSlot instead of
  hand-packing locations and walking the bags.
- Bank snapshot: record set membership while the bank is open.
  GetItemLocations reports bank items as missing once it closes, so set
  items in the bank were listed as unused.
- Autoswitch: check CanUseEquipmentSets and the UseEquipmentSet result
  before marking a trigger applied, and retry when the swap is blocked.
- Drive the engine from events (aura, form, zone, resting, target,
  regen) instead of a 4 Hz ticker; poll only swimming, time and eating.
- Detect eating/drinking by the localized names of the Food (433) and
  Drink (430) auras instead of hardcoded locale strings and icon paths.
- Drop presence guards on APIs that always exist; use strsplittable and
  strtrim for trigger values.

* equipmentmanager: wake the dining trigger on player health/mana events

Drop dining from the poll: listen to UNIT_HEALTH/UNIT_MANA for the player
while a dining trigger is enabled, so taking the set off once full is
event-driven. Register UNIT_AURA for the player only.

* equipmentmanager: split trigger values with strsplit

strsplittable needs ClassicAPI 1.17.11; strsplit has been there since
1.7.3, so this keeps the minimum where it is.

* equipmentmanager: let the trigger hint wrap

---------

Co-authored-by: Duciel <336374+Duciel@users.noreply.github.com>
Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
2026-10-27 11:02:44 -05:00
Brues fe376b8e51 Keep buff timer text above the cooldown sweep 2026-10-25 20:32:49 -05:00
Brues e326cea05e Add radial sweeps to buff/debuff icon display 2026-10-25 20:26:45 -05:00
Brues d9e74b3bc5 Add per-frame reverse toggle for cooldown sweeps 2026-10-25 20:24:12 -05:00
Brues 0e428de74c Fix inactive nameplate alpha capped at 99%
CacheConfig clamped notargalpha to 0.99, so a 100% setting never reached full opacity. Clamp to 1.0 instead and detect the target plate by GUID comparison only, removing the alpha-based fallback that required the headroom.
2026-10-25 20:00:50 -05:00
Brues df21f1f26c stable: capture per-iteration button in Enable/Disable closures
Lua 5.0 shares the generic-for loop variable across iterations, so the
closures all saw the final (nil) value.
v9.0.29
2026-10-25 12:12:05 -05:00
Brues bd7bf3f39f Size aura cooldown text to its laid-out icon
Unit frame aura icons only get their size from the layout pass, but
RefreshUnit started their timers before it ran. A cooldown text created
on a never-laid-out icon saw a height of 0 and fell back to a 16pt font,
so some buff and debuff timers overflowed their icons. (Closes #64)

- RefreshUnit stores each aura's timer and starts them after
  LayoutAuras, once every icon has its final size.
- With dynamic size on, the cooldown text re-sizes its font whenever
  its frame's height changed since the last SetTimer, so icons that
  switch between the normal and own aura size keep a matching font.
2026-10-25 11:48:24 -05:00
Brues 987c337709 Revert "Remove CLINK parsing"
This reverts commit c03b74c3d1.
2026-10-25 11:39:39 -05:00
Brues cdaf9336a3 nameplates: skip destroyed plates on PLAYER_LOGOUT
Leaving the world destroys the units before PLAYER_LOGOUT fires, so some
plates in the registry are already dead: their overlay buttons dropped
their events and lost their methods, and UnregisterAllEvents errored as a
nil method. Only silence the plates that are still alive.
2026-10-25 11:33:51 -05:00
Brues e4f0849816 Pass the draw layer as CreateTexture's second argument
CreateTexture("OVERLAY") names the texture "OVERLAY" and leaves it on
the default ARTWORK layer. Pass nil for the name so the layer applies.
2026-10-25 11:21:01 -05:00
Brues c03b74c3d1 Remove CLINK parsing 2026-10-24 23:23:16 -05:00
Brues e583ac1e83 Drive mapreveal from MAP_EXPLORATION_UPDATED and C_MapExplorationInfo 2026-10-24 21:33:12 -05:00
Brues 964c316cdc Replace Nampower combat events with ClassicAPI events
Read casts from UNIT_SPELLCAST_* and heal amounts from
COMBAT_LOG_EVENT_UNFILTERED in libpredict, swingtimer and the prowl
page switch. Drop libdebuff's AURA_CAST/DEBUFF_* bookkeeping and hook
tables, which nothing read: its aura readers already use C_UnitAuras.
Drop the unitframe BUFF_ADDED_OTHER start-time tracker, since
C_UnitAuras stamps an expiration for auras seen being applied.
v9.0.28
2026-10-23 21:27:28 -05:00
Brues b73ed88346 Split chat faction and race icons into separate options 2026-10-23 19:33:08 -05:00
Brues b374a0914a Color equipment flyout borders by item quality 2026-10-23 17:27:37 -05:00
Brues aaddeb120a Drive innervate callout from the combat log
Read Innervate casts from COMBAT_LOG_EVENT_UNFILTERED instead of
Nampower's AURA_CAST events, taking the target name from the event.
Schedule the ready callout once Innervate's own cooldown appears on
SPELL_UPDATE_COOLDOWN; at cast time GetSpellCooldown reports only the GCD.
2026-10-23 17:03:23 -05:00
Brues 1ad78d43e9 nil 2026-10-23 16:21:05 -05:00
Brues dde4a5aa2d Merge chat class color and player level passes into one loop 2026-10-23 12:51:04 -05:00
Brues e7e1382693 Port unitframe and actionbar performance fixes from Duciel/pfUI@45f8ca6
Unitframes: only set the unit attribute when it changes, poll group frame indicators every 3s since events already cover them, and limit full refreshes on eventless frames to unit changes or once a second.

Actionbar: handle UNIT_INVENTORY_CHANGED with a light count/cooldown/usable pass instead of a full update of every button, and skip hidden buttons in the cached passes, catching them up once they become visible.
2026-10-23 12:39:07 -05:00
Brues 6aaf4f2047 Read chat sender and channel from GetCurrentChatEvent
Pull the CHAT_MSG payload once per line instead of decoding it from the
rendered text. The sender match uses arg2 rather than the name resolved
from the GUID, and channel shortening only runs on CHAT_MSG_CHANNEL with
a single anchored replacement in place of the backtracking pattern.
2026-10-23 03:12:42 -05:00
Brues 233d0dafc0 one more bump 2026-10-23 03:09:07 -05:00
Brues 95e832835e Color chat senders by GUID and drop the who-search option
The engine name-queries a chat sender before the CHAT_MSG event fires,
so GetPlayerInfoByGUID(GetCurrentChatGUID()) resolves every player
sender, including strangers in world channels. Other names in the text
still fall back to C_PlayerCache.GetPlayerInfoByName and libunitscan.

This makes the silent /who lookup for unknown classes obsolete; remove
it along with its FriendsFrame_OnEvent wrapper, config default, GUI
entry and translations.
2026-10-23 02:40:08 -05:00
Brues cae7c2d68a Guard unusable bag refresh against the bank frame not existing yet 2026-10-23 02:39:42 -05:00
Brues 8abde7beba Classify nameplate units with UnitSelectionType instead of bar color 2026-10-23 02:06:43 -05:00
Brues fbb0c4c254 Refresh unusable bag tint when item requirements change 2026-10-23 02:00:27 -05:00
Brues 42e950639f Rotate bar textures on vertical XP, rep and nameplate health bars
Vertical StatusBars stretched the bar texture's shading along the wrong axis. ClassicAPI's SetRotatesTexture turns it with the bar.
2026-10-22 23:56:51 -05:00
Brues e70c8025c2 Draw the ranged swing timer as a native center-fill StatusBar
The ranged bar faked its fills with three textures resized and re-texcoorded every frame. A StatusBar with ClassicAPI's SetFillStyle covers all of it: CENTER for hunters (reload drains to the middle, the deadzone grows back out in the warn color), STANDARD otherwise.
2026-10-22 23:43:44 -05:00
Brues 8f1322d71c Skin ClassicAPI's Interface Options frame and its option controls
SkinCollapseButton's icon no longer takes the mouse, so clicks reach the button under it.
2026-10-22 23:34:08 -05:00
Brues 935b854073 Remove dead buffdetect setting 2026-10-22 23:25:59 -05:00
Brues df16988d3f Flow unit frame auras: debuffs first on enemies, own size, spacing
Unit frame aura icons are placed by a layout pass after each aura
refresh instead of a fixed grid set at setup. Rows are as tall as
their largest icon, and the debuff block no longer uses the debuff
size to step past buff rows. (Closes #25)

- When buffs and debuffs share a corner, debuffs come first on
  neutral and hostile units.
- New Own Buff Size / Own Debuff Size (-1 = normal size) enlarge the
  player's auras, which C_UnitAuras already lists first.
- New Buff/Debuff X-Spacing and Y-Spacing set the gaps between icons
  and rows; the default of 1 keeps the old look.
- The selfdebuff tooltip remap is gone from unit frames and buffwatch:
  own auras lead the list, so the HARMFUL|PLAYER index is the HARMFUL
  index.
2026-10-22 23:24:15 -05:00
Brues 627ab8b437 Use ClassicAPI's native Cooldown frame for cooldown sweeps
ClassicAPI 1.17.1 draws the Cooldown sweep natively, as 4.3.4's
CGCooldown, so pfUI's cooldowns no longer need the indicator Model.

- Action buttons, bank slots, totems, unit frame auras and icons, and
  nameplate debuffs are Cooldown frames with CooldownFrameTemplate.
- The plain-Frame fallbacks for disabled animations are gone; the hook
  already hides the sweep with alpha 0.
- The 36px scale-and-inset realign only runs on stock indicator Models.
2026-10-22 22:47:18 -05:00
Brues c36184081a Bump min ClassicAPI to 1.17.1 2026-10-22 22:19:35 -05:00
Brues d881d73246 Use region:IsMouseOver instead of the MouseIsOver global 2026-10-22 21:37:50 -05:00