Commit Graph

55 Commits

Author SHA1 Message Date
Brues 06768c985a Merge classicapi-next: friend list and spell fields on ClassicAPI
Squashed from the classicapi-next branch:
- Read spell fields through ClassicAPI instead of nampower (libdebuff, swingtimer)
- Read friend and who-list class tokens from C_FriendList (socialmod, libunitscan)
- Count online friends with C_FriendList.GetNumOnlineFriends
- Add a friend notes module (modules/friendnotes.lua)
- Bump ClassicAPI minimum version to 10906
2026-08-09 19:14:40 -05:00
Brues 6d1bfe805e Use UnitClassBase for class detection 2026-07-30 01:26:29 -05:00
Brues b5277ea457 These modules aren't new anymore 2026-07-11 16:04:58 -05:00
Brues 7389c241a4 using GetSpellInfo with just a spell id is dangerous
Handful of addons will polyfill their own GetSpellInfo that only accept (bookSlot, bookType) so it's only safe to use C_Spell.GetSpellInfo with just a spell id
2026-07-11 09:47:46 -05:00
Brues 61c2f996fa Revert on-swing queue color when the ability is cancelled
Pressing Esc (or re-pressing) to cancel a queued Heroic Strike / Cleave /
Maul left the swing bar stuck in its queued color. The color is set on the
on-swing press and only cleared on nampower's ON_SWING_QUEUE_POPPED, which
fires solely when a queued-behind on-swing resolves; nampower's cancel path
touches no on-swing state and emits no event, so the flag never cleared.

Reconcile the event flag against the client's IsCurrentAction, which it does
clear on cancel: ReconcileQueued drops the flag once the client has confirmed
the ability as current and then stops showing it (the true->false transition).
It only acts once current has been seen, so a nampower-initiated cast the
client never flags as current keeps its color until its own pop/resolve --
preserving the reason the event-driven path exists.

RebuildQueueSlotCache now caches Maul slots and runs for druids, and no longer
bails in event mode so the caches stay fresh for reconciliation.
2026-07-09 19:45:17 -05:00
Brues ab11096b01 Show on-swing queue color on every HS/Cleave/Maul press
The SPELL_CAST_EVENT hook only called SetQueuedKind, but the queued
color path is gated behind S.useSpellQueueEvent. Nampower fires
SPELL_CAST_EVENT on the actual HS/Cleave/Maul press (not just the
rarer ON_SWING_QUEUED), so flip the event-driven flag there. The
queued color now shows even when the client IsCurrentAction state
does not reflect a natively-queued on-swing ability.
2026-07-08 10:34:45 -05:00
Brues 9706a74d16 UNIT_INVENTORY_CHANGED -> PLAYER_EQUIPMENT_CHANGED 2026-07-05 14:32:25 -05:00
Brues f9b0b5983a Don't need to worry about caching player guid anymore 2026-07-04 22:46:55 -05:00
Brues deeec89955 predict + libdebuff + swingtimer: drop hardcoded spell data
Replace per-locale name tables and per-rank ID lists with single
canonical-rank lookups through C_Spell. Spell.dbc bits hoisted to
named constants at module top.

libpredict:
- Four 7-locale tables (PRAYER_OF_HEALING / REJUVENATION / RENEW /
  REGROWTH) collapsed to one C_Spell.GetSpellName(rank1id) call each.
- 25-entry SPELL_IDS (all ranks of Rejuv + Renew) for SPELL_GO_SELF
  HoT detection replaced by name comparison against REJUVENATION /
  RENEW. No per-rank ID maintenance.

libdebuff:
- GetSpellRecField(id, "name") → C_Spell.GetSpellName(id) at all call
  sites; the presence-guard pattern is gone (ClassicAPI is a hard
  dep, per memory).
- GetSpellRecField(id, "rank") → C_Spell.GetSpellSubtext(id).

swingtimer:
- Hoist FLAG_AUTOATTACK / ATTR_KEEP_SWINGS / ATTR_ON_NEXT_SWING to
  module-top constants via tonumber("0xNN", 16) so the SPELL_GO_SELF
  hot path stops re-parsing them on every call. Lua 5.0 has no hex
  number literals; strtoul-backed tonumber handles the "0x" prefix.
2026-06-27 18:22:03 -05:00
Brues cca9771ef0 swingtimer: derive spell categories from Spell.dbc attributes
Drop four hardcoded spell-ID tables (swingDelaySpells, hsSpellIDs,
cleaveSpellIDs, maulSpellIDs) and the broad interruptFlags > 0 reset
heuristic in favor of server-parity checks against Spell.dbc bits via
nampower's GetSpellRecField:

- "Resets the swing on cast complete" gated on InterruptFlags's
  SPELL_INTERRUPT_FLAG_AUTOATTACK (0x08) and AttributesEx2's lack of
  SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS (0x20000) — mirrors the server's
  Spell::IsMeleeAttackResetSpell. Reset OH alongside MH to match.

- "Slam-style delay" derived from absent 0x08 + a cast time existing
  (implicit since SPELL_START_SELF only fires for cast-time spells).
  Freezes the swing timer at SPELL_START and adds cast duration on
  SPELL_GO instead of resetting.

- HS / Cleave / Maul classification via IsOnSwingSpell (ATTR_ON_NEXT_
  SWING bit 0x04) + name comparison against rank-1 canonical names,
  centralized into ClassifyOnSwingSpell + SetQueuedKind helpers.

Switch the lone GetSpellRec table-allocator call to GetSpellRecField for
consistency (single-field hash lookup, no shared-table reuse caveat).
2026-06-27 17:52:31 -05:00
Brues 371872bb90 swingtimer: route wand Shoot to ranged bar without resetting MH
Wand Shoot (spellID 5019) wasn't recognized as ranged anywhere, so it
fell through every branch of the SPELL_GO_SELF dispatch and hit the
catch-all interruptFlags > 0 reset, wiping the mainhand swing on every
shot. Casters melee-weaving between MH swings and wand fires lost their
swing visualization.

Replace the hardcoded RANGED_SPELLIDS / WAND_SHOOT_SPELLIDS tables with
C_Spell.IsRangedAutoAttackSpell (Spell.dbc AUTO_REPEAT bit) — catches
both Auto Shot and Shoot today, plus any future auto-repeat ranged
spell. ResetRanged now takes a replaceMH flag: true for Auto Shot /
Throw (Hunter ranged replaces melee), false for wand (independent
timers, both tick concurrently).

Closes #5.
2026-06-27 17:14:48 -05:00
Brues 841399a0c7 classicapi migration 2026-05-29 22:56:12 -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 554c447514 swingtimer HS/Cleave detection via spell name compare
GetActionInfo + GetMacroSpell resolve each action slot to a spell name
(or skip if it's an item / empty / non-resolvable macro). The names to
match against come from C_Spell.GetSpellName on the canonical rank-1
spellIDs (78 = Heroic Strike, 845 = Cleave) so the comparison is
locale-independent without hardcoding all ranks: every rank of Heroic
Strike returns the same localized name.

Replaces the old two-path scan (texture string match + hardcoded
English name match against "heroic strike" / "hs" / "cleave"). Closes
two correctness holes the old logic had: macros that cast HS/Cleave
with a custom icon now match correctly, and macros merely *named* "HS"
without actually casting HS no longer false-match.
2026-05-21 16:53:26 -05:00
Brues b18e6ffa67 refresh buff durations on player 2026-05-21 02:35:46 -05:00
Meow 85dce25804 added slam and hammer of wrath to swingtimer 2026-04-11 20:46:38 +02:00
FLORIAN GUSTIN 38c7feeed7 changing maul color 2026-03-24 13:20:41 +01:00
FLORIAN GUSTIN 74e4ddab6f fix on maul queue 2026-03-24 13:15:17 +01:00
FLORIAN GUSTIN fc73812baa adding maul queue 2026-03-24 02:37:08 +01:00
Meow a95aeeb637 new module registry to warn players about new modules 2026-03-23 14:41:40 +01:00
Meow e3803aa35f swingtimer hook for scrm 2026-03-13 13:40:38 +01:00
Meow f9f0c8f2e9 Revert "Added swing timer hook for scrm"
This reverts commit 99dbd168a2.
2026-03-13 13:39:19 +01:00
Meow 99dbd168a2 Added swing timer hook for scrm 2026-03-13 13:37:13 +01:00
Meow 80062535d9 update for swing timer on miss/dodge/parry 2026-03-06 03:47:54 +01:00
Meow 0337347cef added hunter check for glowing line 2026-03-05 22:08:13 +01:00
Meow 48c5d50f51 Fix swing timer not resetting on resisted/missed spells
The swing timer now correctly resets when your spell is resisted or misses. Previously, a resisted Moonfire (for example) would not reset the swing timer bar even though the server had already reset your actual swing — causing the bar to desync until the next auto-attack.
2026-03-05 04:09:56 +01:00
Meow c0bd8cb4cf swingtimer update 2026-03-04 22:40:08 +01:00
Meow d3a851b7ed swingtimer change
Swing timer now hides naturally after the timer expires instead of using a fixed 5-second out-of-combat delay
2026-03-04 21:09:05 +01:00
Meow 31ac469812 added speed for ranged and offhand 2026-03-04 19:27:56 +01:00
Meow dbadbc9a18 forgot some cleanups 2026-03-04 19:23:43 +01:00
Meow 81aa00821e removed debug messages 2026-03-04 19:18:55 +01:00
Meow bdfc13bb08 swingtimer rework 2026-03-04 19:18:01 +01:00
Meow c9468e4033 fix: swing timer reset bugs (extra attacks, parry, slam)
Extra attacks (Sword Specialization, Windfury, Hand of Justice) no longer double the swing timer. Added fallback detection for servers that don't set HITINFO_NOACTION correctly: if AUTO_ATTACK_SELF fires while more than 20% of the current swing remains, it's treated as an extra attack and ignored.
Parry reset now uses correct Vanilla mechanic: resets timer to exactly 60% of weapon speed instead of incorrectly subtracting 40% from remaining time.
Slam now hard-resets the swing timer from now instead of chaining from the previous nextSwing, which caused inflated swing times (e.g. 3.76s showing as 4.3s).
2026-03-04 00:13:37 +01:00
Meow fd79a7e776 possible fix for swingtimer.lua
- Added slam and more check mechanics for swing timer.
2026-03-03 23:41:36 +01:00
Meow c7aca0de99 GUID replacements
* Replace all `local _, guid = UnitExists(unit)` with `GetUnitGUID(unit)` (Nampower 3.0.0+)
* Bump minimum required Nampower version to 3.0.0
2026-03-02 10:41:49 +01:00
Meow b11deceb26 Fixed ResetSwingTimers scope error causing nil call in OnUpdate
Fixed ResetSwingTimers scope error causing nil call in OnUpdate
2026-02-26 20:14:25 +01:00
Meow 73caedb9ff possible fix for swing timer vanishing sometimes
possible fix for swing timer vanishing sometimes
2026-02-26 16:18:46 +01:00
Meow 52f212d329 swingtimer fix for warriors
Heoric strike now is shown within the swing timer.
2026-02-23 18:40:16 +01:00
Meow 8c9aa84f91 fixed swing timer to show bar fader for warrior and rogues again 2026-02-21 20:46:10 +01:00
Meow 50daec8b61 added throttle of 60fps update rate for swing timer 2026-02-21 15:23:19 +01:00
Meow 1f2ded45c5 Swingtimer adjustments
- With nampower we have now real timers for offhand, main hand and ranged!
- changed the ranged frame to have it's own moveable bar.
2026-02-21 15:16:10 +01:00
Meow 570ba05a93 possible fix to NOT detect windfury procs as offhand swing 2026-02-21 05:32:55 +01:00
Meow 6f28fb3730 Added warn color for hunters ranged swing timers (hunters only)
Added warn color for hunters ranged swing timers (hunters only)
2026-02-20 16:01:01 +01:00
Meow 92e22becce Added very accurate ranged swing timer.
Added very accurate ranged swing timer.
2026-02-20 15:14:16 +01:00
Meow 1f3991d004 fix for swing timer.
- Fixed swing timer hiding when you switched the target or had no target. Timer now always runs out showing you when the next swing is available even if you swap targets.
2026-02-19 18:04:23 +01:00
Meow 9e25bf6d2b Revert "fixed swing timer vanishing"
This reverts commit b422a01039.
2026-02-19 17:53:26 +01:00
Meow b422a01039 fixed swing timer vanishing
- Fixed swing timer hiding when you switched the target or had no target. Timer now always runs out showing you when the next swing is available even if you swap targets.
2026-02-19 17:51:32 +01:00
Meow fe93577825 working swingtimer re-written - no errors on load
working swingtimer re-written - no errors on load >.<
2026-02-19 17:16:48 +01:00
Meow ff277d15ad reverted swingtimer changes to old stable version until bugs are fixed...
reverted swingtimer changes to old stable version until bugs are fixed...
2026-02-19 14:48:18 +01:00
Meow a2cdaeb73c reverting last commit since it caused conflicts.
reverting last commit since it caused conflicts.
2026-02-19 07:31:39 +01:00