Commit Graph

3736 Commits

Author SHA1 Message Date
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 314d89e30d librange.GetRangeSlot via GetActionInfo + GetMacroSpell
Replaces the texture-from-action + "no macro text" heuristic with a
proper resolve-to-spellID step. Macros that cast a 40y heal but
display a non-spell icon (custom macro icon, /castsequence wrappers,
etc.) now match correctly — the previous code missed them because
GetActionTexture returns the macro's icon, not the underlying spell's.

C_Spell.GetSpellTexture(spellID) returns the spell's intrinsic icon
path, which is what the class-spell table is keyed on, so the
texture-comparison logic is unchanged.
2026-05-21 16:48:02 -05:00
Brues 2f17546c1a UseAction hooks: GetActionInfo + GetMacroSpell, drop tooltip scans
The three UseAction hooks in libtotem / libpredict / libcast all did
the same dance: filter out macros via GetActionText, then tooltip-scan
the action to recover the spell name + rank. ClassicAPI's
GetActionInfo + GetMacroSpell make both steps unnecessary:

- GetActionInfo returns ("spell", spellID) or ("macro", macroSlot)
- GetMacroSpell resolves a macroSlot to (name, rank, spellID) at the
  highest known rank, parsed engine-side at macro save time

So macros are no longer skipped — they resolve to their cast spell
just like a raw spell action. libtotem queue gains a real spellID
(the previous "no spellId available, icon-based fallback" comment is
obsolete). libcast also wins: it can feed the resolved spellID
through FindSpellBookSlotByID + libspell.GetSpellInfo(slot, "spell")
without the name-with-rank-suffix string concat round-trip.

Drops libtipscan:GetScanner("prediction") usage in libtotem and
libpredict, and libtipscan:GetScanner("libcast") in libcast.
2026-05-21 16:45:57 -05:00
Brues 8e635afeed GetItemCount via C_Item, reagents via C_Spell.GetSpellReagents
Drops the legacy pfUI.api.GetItemCount wrapper (name-based bag walk +
GetItemInfo per slot) entirely — both call sites switch to direct
C_Item.GetItemCount(itemID) calls.

actionbar reagent counter: drops the SPELL_REAGENTS tooltip-scan +
libtipscan dependency. UpdateSlot now does GetActionInfo(slot) →
spellID → C_Spell.GetSpellReagents → reagent itemID, stored per slot.
Counts update via C_Item.GetItemCount(itemID). reagent_counts is
keyed by itemID instead of localized name string. Multi-reagent
spells now resolve cleanly (only first reagent counted, matching old
single-name behavior). Macro and bag-item actions skip cleanly.

questitem: switches to hooksecurefunc("SetItemRef", ...) + the
modern GameTooltip:HasItem / :GetItem pair instead of monkey-patching
_G.SetItemRef and string.find-parsing the "item:NNN" out of the link.
Drops the libtooltip indirection for the regular tooltip path —
GameTooltip:GetItem returns name + itemID directly. AddTooltip
extended to accept the itemID (both callers already had it and were
discarding it).
2026-05-21 16:20:19 -05:00
Brues 1012a67865 librange: rely on SuperWoW UnitPosition
Drops the three other range-check paths and the target-juggling
machinery they required:

- Nampower IsSpellInRange branch + spellbook-scan to find the spell name
- UnitXP_SP3 distance check (api.lua's UnitInRange wrapper still owns
  the UnitXP precise mode independently)
- Vanilla IsActionInRange fallback that briefly retargeted via
  TargetUnit / TargetLastTarget

With target-juggling gone, this also deletes the support scaffolding it
required: PlaySound override, TargetFrame_OnEvent swap, ReAttack /
lastattack restoration, the wand and combo-points detection frames
(both were suspension guards for target-juggling), the loot/inspect/
trade/combat skip-checks, librange's pfScanActive set/clear (focus.lua
still uses its own), and the librange_isLoggingOut crash workaround
the target-flip path needed.

Target case still uses IsActionInRange (vanilla-native, works for
hostile targets too); friendly party/raid/pet scan uses UnitPosition.
The friendly-only restriction on UnitPosition isn't an issue because
the scan list contains only friendlies anyway.

DPS classes (no 40y healing spell in `spells[class]`) now also get
party/raid range coloring; they only miss the target case, which is
unchanged from before.

328 → 166 lines.
2026-05-21 15:41:33 -05:00
Brues e1cd1ef179 mount cancel via Dismount
Replaces the Phase 1 buff-slot loop + tooltip-scanned mount-string match
with a single Dismount() call. The implementation in ClassicAPI scans
for SPELL_AURA_MOUNTED on the player's auras and sends the cancel
packet itself, so we don't have to maintain a localized list of mount
tooltip patterns ("Increases speed by X%", "Erhöht Tempo um X%", etc.).

Drops pfUI.autoshift.mounts (the 20-line localized-string table) and
pfUI.autoshift.scanner (its only consumer). Module is down to ~50 lines
from ~150 at session start.
2026-05-21 10:40:42 -05:00
Brues 0e0a3f3688 shapeshift cancel via CancelShapeshiftForm
Replaces autoshift's Phase 2 (form-ID → texture lookup → buff iteration →
CancelPlayerBuff(bid)) with a single CancelShapeshiftForm() call. The
implementation in ClassicAPI walks the buff slots and matches via
Spell.dbc effect arrays itself, so we don't have to maintain a form-ID
→ texture map on the Lua side.

Drops pfUI.autoshift.shapeshifts entirely (no longer consulted) and the
turtle-wow.lua block that conditionally appended Tree of Life / Stag
Form textures — Turtle's added DBC rows (form IDs 9 and 11) are handled
natively by the same scan.
2026-05-21 10:31:25 -05:00
Brues 0fead7d696 shapeshift detection via GetShapeshiftFormID + UPDATE_SHAPESHIFT_FORM
actionbar.lua: pageswitch now listens to UPDATE_SHAPESHIFT_FORM as the
authoritative form-change signal. PLAYER_AURAS_CHANGED becomes a
narrowly-scoped prowl-detection trigger that runs after form state is
already known. The Nampower SPELL_GO_SELF hook drops its Cat Form
(spellID 768) branch — UPDATE_SHAPESHIFT_FORM covers form changes
without per-spellID watchlists. Prowl IDs stay hooked for zero-latency
detection that PLAYER_AURAS_CHANGED can't match.

autoshift.lua: the texture-list shapeshift detection becomes a form-ID-
keyed map. GetShapeshiftFormID returns the active form directly so we
don't have to texture-match against every possible form pattern. The
moonkin_scan frame disappears entirely — its talent-conditional was a
workaround for the agility buff sharing Moonkin's icon, which form ID
makes irrelevant (form 31 is only reported when the player is genuinely
in Moonkin Form). Loop also splits into two phases for clarity: mount
priority pass, then form cancel.
2026-05-21 04:25:50 -05:00
Brues 6be11baf29 HasCatForm via GetShapeshiftFormID
Drops the C_UnitAuras helpful-aura iteration in favor of a direct engine
state read. GetShapeshiftFormID returns vanilla 1.12.1's stable per-form
DBC ID (Cat = 1), so the helper collapses to a one-liner that's
locale-independent, talent-independent, and works without scanning any
buff list.
2026-05-21 04:04:31 -05:00
Brues 8818d68aea druid prowl detection via IsStealthed
FullScan/HasProwlBuff stop iterating GetPlayerBuffTexture(0..31) for the
prowl buff — that's exactly what ClassicAPI's IsStealthed() returns,
locale-independent and zero allocations. Cat-form detection still needs
the icon (GetShapeshiftForm's index varies by talents/learned forms) but
moves to one C_UnitAuras.GetUnitAuras iteration over populated auras via
the new HasCatForm helper.

The inline cat-form recheck after a prowl ends collapses to one
HasCatForm() call. HasProwlBuff is inlined to IsStealthed() at its
single call site.
2026-05-21 03:39:20 -05:00
Brues 8ad932b529 removed some hardcoded strings 2026-05-21 03:32:18 -05:00
Brues 8c416ae713 indicator system via C_UnitAuras
Both indicator scan loops (preset HoT indicators + custom name-based
indicators) now iterate the populated aura array from
C_UnitAuras.GetUnitAuras instead of brute-forcing UnitBuff(1..32). The
Rejuvenation/Renew/Regrowth disambiguation that previously required
scanner:SetUnitBuff + Line(1) tooltip scans now reads aura.name natively.

HoT-icon → name+predict mappings lifted into a HOT_INDICATORS table at
file scope so future additions are one-line edits.

The custom-debuff loop still defers to libdebuff for caster correlation
when available; C_UnitAuras provides the texture/name backstop. Also
unifies the non-selfdebuff debuff display branches through one
GetDebuffDataByIndex call.

Local `scanner` declaration removed (no remaining tooltip-scan uses in
this file).
2026-05-21 03:26:02 -05:00
Brues 9b2001114d dedup shot-haste loops behind libcast.ApplyShotHaste
The three customcast handlers (Aimed Shot, Multi-Shot, Steady Shot) each
iterated 1..32 UnitBuff slots checking the same four icon paths for
haste-providing buffs. Lifted into libcast.ApplyShotHaste which iterates
the populated auras once via C_UnitAuras.GetUnitAuras and reads from a
single SHOT_HASTE lookup table. Three loop copies collapse to one helper.

Kept texture-keyed matching (rather than spellID) because the Naxx
trinket and Quick Shots procs have spell-ID variants across server
flavors but stable icons.
2026-05-21 03:20:20 -05:00
Brues 2d67781c6f unit-frame tooltip/click handlers via SetUnitAura
BuffOnClick/DebuffOnClick switch to lazy bid lookup before CancelPlayerBuff
(matching the pattern in buff.lua/buffwatch.lua). DebuffOnEnter unifies its
player and non-player branches through GameTooltip:SetUnitAura — the only
divergent path is the selfdebuff caster-correlation lookup that still
needs libdebuff.
2026-05-21 03:20:08 -05:00
Brues 9ba4b3e408 buffwatch via C_UnitAuras
Player branch in GetBuffData now reads from C_UnitAuras.GetAuraDataByIndex
directly, dropping the GetPlayerBuff chain plus the tooltip-scan for the
buff name. Lazy bid resolution for CancelPlayerBuff. All four tooltip
calls (SetPlayerBuff/SetUnitBuff/SetUnitDebuff x2) collapse to the unified
GameTooltip:SetUnitAura. UnitDebuff dispel-color lookup at line 312 reads
aura.dispelName instead. libdebuff path preserved for non-player units
that still need caster correlation.
2026-05-21 03:10:59 -05:00
Brues c733d1b868 use GetItemInfoInstant 2026-05-21 03:10:37 -05:00
Brues 0fe0a64121 libspell uses ClassicAPI GetSpellInfo
GetSpellInfo internals now delegate to ClassicAPI's GetSpellInfo for the
DBC metadata read instead of scraping castTime/range out of the tooltip.
Drops the libtipscan dependency from libspell and the regex-based parsing
of SPELL_CAST_TIME_SEC/MIN/SPELL_RANGE. Same 8-value return shape so all
call sites (libtotem, libpredict, libcast, actionbar) continue working.
2026-05-21 02:56:58 -05:00
Brues 432ed546f5 debuff display via C_UnitAuras
Mirror the buff-side cleanup: drop the legacy DebuffOnUpdate poller from
player debuff frames, swap the player branch to GetDebuffDataByIndex with
the same future-start cap, and switch the dispel-indicator scan to
AuraData. libdebuff still owns non-player timers. Deletes the now-orphaned
BuffOnUpdate/DebuffOnUpdate/maxdurations.
2026-05-21 02:38:48 -05:00
Brues b18e6ffa67 refresh buff durations on player 2026-05-21 02:35:46 -05:00
Brues b7a0912e07 fixed target buffs not showing 2026-05-21 01:18:01 -05:00
Brues 8b04c53621 cleanup 2026-05-21 01:17:46 -05:00
Brues 2eb7506f3c dont need to scan tooltip 2026-05-21 00:55:22 -05:00
Brues 82743b0f9a UnitAUra cleanup 2026-05-18 23:42:51 -05:00
Brues b9343ec601 utilize SetUnitAura 2026-05-18 22:43:50 -05:00
Brues bcb71c8cca swpping to GetActionInfo 2026-05-18 13:20:09 -05:00
Brues 29e841d9c4 libtooltip can just use GetItem from ClassicAPI 2026-05-18 13:19:59 -05:00
Brues 67146ef3a4 begin utilizing ClassicAPI 2026-05-16 13:02:38 -05:00
Meow a8ee751b42 adjusted readme text 2026-04-11 23:22:47 +02:00
Meow 0ef3bd0148 fixed a bug where targeting an offline player predicted heals on them 2026-04-11 21:49:54 +02:00
Meow 93c4166052 possible fix for raid frames not showing up when pfui raid frames are hidden 2026-04-11 21:35:22 +02:00
Meow f49bf4f1a9 Skip firstrun if importing shared profile 2026-04-11 21:24:36 +02:00
Meow 164582fb82 Innervatecall module 2026-04-11 21:18:29 +02:00
Meow 5ef01174d6 New module - InnervateCall (only for druids)
- This module will call in group/raid and battleground if you innervated yourself or someone else.
- The module will inform your group/raid/battleground if innervate is ready again.
2026-04-11 21:10:57 +02:00
Meow 85dce25804 added slam and hammer of wrath to swingtimer 2026-04-11 20:46:38 +02:00
Meow f0963c4e99 small fix for marktracking display 2026-04-10 17:31:02 +02:00
Meow 9128f02133 Add fill order option for actionbars
- "Row-first" fills buttons left-to-right, top-to-bottom (1,2,3 / 4,5,6)
- "Column-first" fills top-to-bottom, left-to-right (1,3,5 / 2,4,6)
- "Auto" preserves the original behavior based on uneven orientation
2026-04-10 16:33:06 +02:00
Meow 5f9e69933f Revert "Added a fillmode variant to actionbars"
This reverts commit 0838c6ec3a.
2026-04-10 15:26:18 +02:00
Meow 0838c6ec3a Added a fillmode variant to actionbars 2026-04-10 15:24:39 +02:00
Meow 9b97414beb small fix for actionbars to allign properly on uneven numbers. 2026-04-09 20:34:11 +02:00
Meow 56e9dcb8c0 Update config.lua
Added config migration to reset removed 'Show Only Own Debuffs' setting for Unit Frames and Nameplates
2026-04-04 00:50:37 +02:00
Meow 6fb45b3971 nameplate fixes
- fixed raidicon to bug out if nameplates for specific unit types are hidden
- fixed raidicon to NOT be behind the nameplate when nameplates are shown
2026-04-04 00:28:11 +02:00
Meow 10dee38b0f libpredict
Fixed heal prediction showing on hostile targets when healing friendly units via mouseover or click-to-cast
2026-04-03 05:32:55 +02:00
Meow d1692288f4 raid icon fix 2026-04-03 01:15:25 +02:00
Meow fbb1b9df46 Refactor: Tracking spell detection
Improved tracking spell detection to use SpellID + icon path matching (case-insensitive) for more accurate and locale-independent results
2026-04-02 19:32:00 +02:00
Meow 1b04754a30 fix for libdebuff
Fixed ownDebuffs being empty during AURA_CAST on first cast, preventing downrank detection from working correctly
2026-04-02 15:42:12 +02:00
Meow ca337259d1 removed duplicated debug 2026-04-02 14:55:21 +02:00
Meow a0a3ef09aa fix for wrong copied hook 2026-04-02 14:35:17 +02:00
Meow 442d4c7be7 hook for Downrank protection 2026-04-02 14:28:14 +02:00
Meow 0abb7b9929 Revert "added downrank check for hooks"
This reverts commit 79d0a401c9.
2026-04-02 14:24:01 +02:00
Meow 79d0a401c9 added downrank check for hooks 2026-04-02 14:03:46 +02:00