Commit Graph

139 Commits

Author SHA1 Message Date
brues-code 6b458c9e27 Modernize cast bars, unit-frame clicks, and mark tracking with ClassicAPI (#32)
* Migrate player castbar to ClassicAPI UNIT_SPELLCAST_* events

Drive the player cast path off ClassicAPI's synthesized, player-only
UNIT_SPELLCAST_* events instead of the vanilla SPELLCAST_* plus nampower
SPELL_{START,GO,DELAYED}_SELF mix. START/CHANNEL_START poll UnitCastingInfo/
UnitChannelInfo and stamp; STOP/CHANNEL_STOP/FAILED/INTERRUPTED clear;
SUCCEEDED drives tradeskill craft counting; DELAYED/CHANNEL_UPDATE re-poll.
Since UNIT_SPELLCAST_START fires for chained same-spell recasts, the nampower
SELF deps and their RunNextFrame co-hook-ordering workarounds are gone.
Remote target/focus bars keep SPELL_*_OTHER (the new events are player-only).

Fix the cast-start flash: StampBar now primes the fill on the stamp frame,
and ClearBar no longer snaps the bar to full (that snap lingered in the fade
tail and flashed when the next cast stamped).

Add a red flash on a cancelled cast: new appearance.castbar.failcolor,
flashed by ClearBar only when a cast was actually in progress.

Handle pushback Quartz-style: DELAYED/CHANNEL_UPDATE re-poll just the times
and accumulate the endMs shift into this.delay for the +/- indicator (cast
+X, channel -X), rather than a full restamp.

* Route target/focus castbars through remote UNIT_SPELLCAST_*

ClassicAPI now fires UNIT_SPELLCAST_* for remote tokens (target/focus/...)
via PollRemote, so drop the nampower SPELL_*_OTHER path and drive all three
bars off one event model. The gate is now token-based (arg1 == this.unitstr,
plus the arg1=="player" + UnitIsUnit case for target=self); the RunNextFrame
defer is gone since the remote poll fires after UnitCastingInfo is readable.
Cast detection is now nampower-free across every bar.

Use the event's rank payload (arg5): thread it through RefreshBar into
StampBar, which now only calls C_Spell.GetSpellSubtext as a fallback on the
retarget re-poll (PLAYER_TARGET/FOCUS_CHANGED) where no event is in hand.

* Drive nameplate castbars off UNIT_SPELLCAST_*

ClassicAPI now fires UNIT_SPELLCAST_* for nameplate tokens, so populate the
per-GUID castState cache from UNIT_SPELLCAST_{START,CHANNEL_START} (poll
PollCastInfo for the timing the payload omits) and clear it on
{STOP,CHANNEL_STOP} -- the remote poll fires STOP for natural end, interrupt,
and cancel alike. Replaces the nampower SPELL_{START,FAILED}_OTHER path; the
^nameplate arg1 gate ignores the target/focus/party fires of the same events,
and the NAME_PLATE_UNIT_ADDED seed still catches a plate spawning mid-cast.
Nameplate cast detection is now nampower-free.

* We no longer use these features from SuperWoW/Nampower

* Use secure unit attributes; remove mouseover scripts

Switch unitframes to attribute-driven clicks and remove mouseover tooltip handlers. Adds SetAttribute("unit") in UpdateVisibility and sets frame attributes (unit and type1='target') when creating frames. Removes OnEnter/OnLeave functions and their SetScript registrations and eliminates direct TargetUnit calls in ClickAction

* Use SetShown and simplify component default

Replace explicit Show/Hide conditionals in api/unitframes.lua with SetShown(...) for ressIcon, leaderIcon, lootIcon, pvpIcon, and restIcon to reduce branching and improve readability. Also remove the local shadowing of the parameter 'component' by using assignment (component = component or ""). No intended behavior changes.

* Drive unit-frame clicks via secure attributes

Replace the Lua OnClick dispatch (OnClick/ClickAction/RightClickAction) with
secure frame attributes: default type1=target / type2=menu, and EnableClickCast
now writes type/spell/macrotext/menu/target/focus attributes per button+modifier
instead of caching a clickactions table read at click time. Drops the now-dead
clickactions table and buttons list.

Also set a "unit" attribute on each frame (at creation and re-synced in
UpdateVisibility to the live token, so a party shown on the raid grid reports
partyN, not raidN) so the hovered unit resolves from the frame.

Match the target/focus/menu click keywords exactly rather than by prefix, so a
spell whose name starts with "focus"/"target"/"menu" (e.g. Focus Magic) casts
instead of being swallowed as the keyword action.

* Simplify marktracking colors and refresh per mark

Replace the hand-rolled ParseColor plus its default-color table with
GetStringColor -- the raidmarkercolor_* config keys already carry those same
defaults, so the fallback was dead code.

Restructure the refresh off observed mark tokens: UNIT_HEALTH/UNIT_MAXHEALTH
now arrive as arg1 == "markN", so refresh just that one row (UpdateRow) instead
of rescanning all eight on every nearby unit's health tick. A visibility flip
(into range / death / hp crossing 0) re-packs the rows, so UpdateRow hands off
to a full UpdateDisplay; RAID_TARGET_UPDATE / PLAYER_ENTERING_WORLD stay full
refreshes, with the 1s poll as the range-change backstop.

* not true anymore

* Poll marktracking fallback via C_Timer instead of OnUpdate

The 1s range-change safety net ran a per-frame OnUpdate that no-oped ~59 of
every 60 frames. Replace it with C_Timer.NewTicker(FALLBACK_INTERVAL,
UpdateDisplay) -- one wakeup per second off the shared timer driver -- and drop
the elapsed accumulator. The scanner frame is now purely event-driven.

* SuperWoW is now optional

* Update README feature list

Add 'Mouseover Unit Frames' and 'Click-casting' to the main features list. Update the SuperWoW entry to reflect that it tracks party/raid units on the minimap (replacing the prior SetMouseoverUnit note).

* Replace fixed-interval OnUpdate polls with C_Timer/RunNextFrame

Swap hand-rolled per-frame throttles for the modern timer primitives:

- turtle-wow: one-shot next-frame defer (self-hiding OnUpdate frame) -> RunNextFrame
- panel: clock, combat, and fps widgets -> NewTicker(1); guild roster -> NewTicker(60)
- minimap: coordinates text -> NewTicker(0.1)
- addonbuttons: one-shot init -> RunNextFrame; 5s button rescan -> NewTicker(5),
  guarded by IsShown() to preserve the old "paused while hidden" behavior

Ticker callbacks reference frames via upvalue since 'this' is unbound outside
OnUpdate. Genuine per-frame work (bar fills, fades, drag) and polls already
coordinated through pfUI.throttle are left as-is.

* update pfQuest link

* Use SetShown/SetSize in panel module

Replace manual Show/Hide toggles with SetShown(not ... ) and replace SetWidth/SetHeight with SetSize in modules/panel.lua. Changes simplify toggle logic (timer, WorldMap, chat hide buttons) and unify sizing calls for timer, frames, textures, and microbutton. No behavior changes intended; purely refactor for conciseness and consistency.

* Bump ClassicAPI min version to 1.9.0

* Drive reagent counter from events instead of a polling OnUpdate

The pfReagentCounter frame ran an OnUpdate that (1) progressively rescanned
all 120 action slots one-per-100ms on any slot change and (2) recounted
reagent inventory on a 1s throttle. Replace both with direct event handling:

- ACTIONBAR_SLOT_CHANGED updates just the changed slot (arg1), full-scanning
  only when arg1 is 0/nil, instead of restarting a ~12s rescan on every edit
- BAG_UPDATE_DELAYED recounts tracked reagents directly (it is already
  Blizzard's coalesced bag event, so the extra 1s throttle was redundant)
- PLAYER_ENTERING_WORLD seeds the full reagent map once

UpdateSlot now seeds a new reagent's real count via GetItemCount so a freshly
placed reagent spell shows the correct number immediately. The updatecache ->
BarsUpdate render path and the IsReagentAction/GetReagentCount accessors are
unchanged.
2026-08-04 14:27:15 -05:00
Brues a4ceb8ba53 utilize HEARTHSTONE_BOUND 2026-07-06 17:07:51 -05:00
Brues 9706a74d16 UNIT_INVENTORY_CHANGED -> PLAYER_EQUIPMENT_CHANGED 2026-07-05 14:32:25 -05:00
Brues d1e51e5202 durability panel shows your collective durability 2026-05-30 00:10:12 -05:00
Brues 23cc286a0c Fixed issue where item durability tooltip was missing items 2026-05-29 23:15:04 -05:00
Brues 1fd7895ca7 move away from RAID_CLASS_COLORS dependency 2026-05-28 13:06:00 -05:00
Brues 710be52f35 phase 3 removing tbc
Drop the now-vestigial expansion plumbing.

- Delete modules/thirdparty-tbc.lua + its xml Include
- Strip 10 tbc-tagged CreateConfig calls in modules/gui.lua
- Drop the expansion arg from CreateConfig() signature + the disabled-
  entry rendering path that depended on it
- Drop the showdisabled GUI toggle + its default
- Simplify pfUI:RegisterModule / pfUI:RegisterSkin to (name, func) only
- Strip the leading version arg ("vanilla:tbc", etc.) from all 114
  Register call sites
- Delete the pfUI.expansion variable
2026-05-25 18:50:53 -05:00
Brues 67146ef3a4 begin utilizing ClassicAPI 2026-05-16 13:02:38 -05:00
Meow ae8dc71bb8 fixed more NaN checks 2026-03-11 05:18:51 +01:00
Meow 34f5c3eb02 Version 6.1.0 - Raid/Party Frame Fixes
Bugfixes:
- Fixed 40-yard range check not working for raid/party frames
- Fixed aggro indicator not displaying properly on raid/party frames
- Improved aggro cache to only cache positive results for instant detection
- Fixed HP/Mana not updating with "Use Raid Frames for group" enabled
- Added SuperWoW nil-check for SpellInfo
- Added missing events: PARTY_MEMBER_ENABLE, PARTY_MEMBER_DISABLE, PLAYER_UPDATE_RESTING

UI Improvements:
- Share/Hoverbind buttons now show warning when module is disabled
2026-01-08 12:25:18 +01:00
Meow 5d0e195d1e performance update
performance update
2026-01-03 12:58:31 +01:00
shagu 35f3706e6d panel: resize button sizes to empty slots 2025-08-16 11:30:58 +02:00
shagu c2ee470749 panel: expand minimap text to max size 2025-07-20 20:42:01 +02:00
shagu bce793e837 panel: use dynamic panel entry max width 2025-07-20 20:41:24 +02:00
Ben 8ad04f2b49 time: handle 24-hour to 12-hour clock conversion edge cases 2025-06-08 08:57:28 +02:00
shagu 55296b5225 panel: add shift shortcut to reset all gold totals 2025-05-30 19:32:02 +02:00
shagu a3e5c7a219 panel: localize item names of inventory counters 2025-03-03 17:40:13 +01:00
jmgibson1981 92d3eebf10 panel: combine similar ui code into functions
also add new panel options for Hearth, Thistle Tea and Flash Powder.
2025-03-03 09:19:04 +01:00
shagu 3351b7fd00 panel: revert pull request for ui code reduction
This reverts commit 1933219712.
2025-02-16 00:39:27 +01:00
jmgibson1981 1933219712 panel: combine similar ui code into functions
also add new panel options for Hearth, Thistle Tea and Flash Powder.
2025-02-14 22:54:04 +01:00
jmgibson1981 9514a535d7 panel: add option to hide seconds on clock 2025-02-14 22:44:40 +01:00
jmgibson1981 03a2ed6502 panel: add support for stackable soulshards count 2025-01-22 09:04:01 +01:00
shagu c524a205aa panel: set panel width for undocked frames 2024-11-07 18:55:28 +01:00
shagu aeddcad06a panel: align minimap panel size to minimap 2024-11-07 13:35:58 +01:00
shagu 073bf5ec42 panel: refresh ammo slots on bag update 2024-11-02 14:40:51 +01:00
bhhandley d466fdd2db panel: add total line to gold info panel 2024-10-06 10:03:24 +02:00
shagu 76e8804741 panel: hide chat buttons if chat is disabled 2022-12-22 11:20:01 +01:00
shagu 360f9a5d51 panel: turn chat hide buttons into proper buttons 2022-09-29 15:52:11 +02:00
shagu fff8dcf578 panel: update guild roster only once a minute 2022-06-14 19:06:32 +02:00
shagu 671bca94a0 panel: show online guild members on mouse over 2020-12-01 17:26:19 +01:00
shagu b89f7e3d51 panel: only show tooltip when friends are online 2020-12-01 17:18:00 +01:00
shagu b041d981ef panel: show online friends on mouse over 2020-12-01 16:36:35 +01:00
shagu 7ea4fa8521 panel: add colors to the fps and latency display 2020-06-30 20:08:09 +02:00
shagu 11e7cb4bec panel: only show addons if component is enabled 2020-04-29 11:19:02 +02:00
shagu 43d3ab85e1 skins: integrate blizzard timemanager properly 2020-03-05 22:38:40 +01:00
shagu 59995900c3 panel: listen to tbc durability events 2019-12-21 09:13:32 +01:00
shagu 3334c7469f modules: make all modules aware of the new borders 2019-12-18 18:54:09 +01:00
shagu 2bcced95ca panel: check guild before using query functions 2019-07-16 19:35:51 +02:00
Artur Morozov 5082a7deb3 panel: add tbc compatibility for minimap zone text 2019-06-16 14:55:59 +02:00
Artur Morozov 08533849c5 tbc: fix micro menu 2019-06-13 18:40:50 +02:00
shagu e9237b59b2 core: use concrete string based client checks 2019-06-10 17:06:31 +02:00
shagu 7632f92dd1 core: use new media mechanism for all textures 2019-06-10 13:35:48 +02:00
shagu 545be99fd7 api: only add shadow to specific frames 2019-06-02 20:43:56 +02:00
shagu 78b492836e panel: use same height calculation as for castbars 2019-06-02 19:17:59 +02:00
shagu 181ba436c2 panel: use api call to generate gold string 2019-05-01 15:55:59 +02:00
shagu 7cc8bb3db8 panel: initialize positions before movable 2019-04-20 14:44:27 +02:00
shagu d3ef6c3aaa panel: add option to hide panels 2019-04-19 22:50:03 +02:00
shagu 7bc60e723d core: whitelist a bunch of modules for tbc 2019-04-07 14:48:58 +02:00
Road-block 06494be3b6 panel: option to use server time instead of local 2019-03-31 14:59:21 +02:00
Road-block e50fabfff9 core: global environment cleanup 2019-03-31 14:59:21 +02:00