Commit Graph
198 Commits
Author SHA1 Message Date
Brues 9cd79d682d Adopt ClassicAPI C_Item item reads in Conditionals.lua
Replace GetInventoryItemLink/GetContainerItemLink link-scraping with
direct ClassicAPI reads across the item conditionals:

- [equipped] cache build: GetInventoryItemID + C_Item.GetItemName
  (decorated name replaces the old bracket-name / GetItemInfo two-step)
- slot-number -> item name resolves ([cd], [usable]/[nousable]):
  C_Item.GetItemName location form
- HasItem / GetItemCooldown substring fallbacks: match the decorated
  name instead of the raw link string
- numeric-slot presence check: GetInventoryItemID

Suffix decoration is preserved via the location form, so partial/
suffixed [equipped:...] matches behave as before.
2026-07-15 19:17:00 -05:00
Brues ae09b23afd Resolve item sets via ClassicAPI; drop Reliquary dependency
Item-set membership and set info now read ItemSet.dbc directly through
ClassicAPI instead of the nampower/Reliquary glue, so set features no
longer require the Reliquary DLL to be installed.

- ClassicAPI.lua: add GetItemSetIDByID and GetItemSetInfo wrappers.
- Utility.lua: repoint ResolveSetItems, CountEquippedSetItemsBySetId,
  GetEquippedItemSetInfo, and GetEquippedSetPieceCount at the ClassicAPI
  accessors. Set-name matching now uses the DBC name (localized; identical
  to the old enUS path on English clients).
- NampowerAPI.lua: remove the now-unused GetItemSet/GetItemSetId/
  GetItemSetItems/GetItemSetBonuses, the dead GetSpellEffectRadius (no
  callers, only radius source was Reliquary), and the orphaned RQ_SafeCall.
- Init.lua: drop hasReliquary detection and its startup feature line.
- Conditionals.lua: update the [set:] comment (no longer Reliquary-gated).
2026-06-21 14:29:28 -05:00
Brues a8bf7fbc0f Identify equipped weapon type by item subclass, not localized name
HasWeaponEquipped matched the localized GetItemInfo subtype string, which
required a hand-maintained translation of all 13 weapon/shield subtypes per
locale plus brittle "^Fist"/last-word string parsing.

Use the locale-independent class/subclass IDs from C_Item.GetItemInfoInstant
instead:
- Init.lua: WeaponTypeNames entries now carry numeric class + subClass set
  (Axes/Swords/Maces span their 1H+2H subclasses; Shields are armor class 4).
- Conditionals.lua: HasWeaponEquipped resolves the slot's itemID via
  ClassicAPI GetInventoryItemID, then compares classID/subClassID -- no link
  parsing, no string munging.
- Localization.lua: drop the now-unused weapon-subtype strings from every
  locale block (112 lines).
2026-06-21 14:16:56 -05:00
Brues f21f90d0f1 Adopt ClassicAPI accessors: cursor, item IDs, spell mechanic
Lean on ClassicAPI's backported readers instead of link-string parsing
and a hand-maintained mechanic table.

- ClassicAPI.lua: add wrappers GetCursorInfo/CursorHoldsItemID,
  GetContainerItemID, GetInventoryItemID, and GetSpellMechanicByID.
- Core.lua: in the manual equip fallback, verify the cursor holds the
  intended item (CursorHoldsItemID) before EquipCursorItem, aborting only
  on a definitive mismatch so empty/unknown cursors behave as before.
- NampowerAPI.lua / Utility.lua: replace GetContainerItemLink /
  GetInventoryItemLink + "item:(%d+)" parsing with direct C_Container/
  inventory ID lookups at the sites that only need the itemID; route the
  equipped-set scans through the GetEquippedItemID helper.
- Conditionals.lua / Utility.lua: replace the 785-entry CCSpellMechanics
  fallback table with C_Spell.GetSpellMechanicByID in GetSpellMechanic and
  GetSpellCCType (BuffLib / nampower paths unchanged); delete the table.
2026-06-21 14:02:49 -05:00
Brues 9f10dab560 Use ClassicAPI CastSpellNoToggle for the ! anti-toggle prefix
Unify both ! mechanisms (bare !spell gate-injection and bracketed
[cond] !spell dispatch skip) on ClassicAPI's CastSpellNoToggle, which
no-ops auto-repeat (Shoot/Auto Shot/Wand) and toggle auras
(forms/stances/aspects/seals) instead of toggling them off.

- Bare !spell now just sets conditionals.noSpam (no injected gate
  conditional); removed spamConditions and GetSpammableConditional.
- Dispatch: melee Attack still uses AttackTarget (CastSpellNoToggle
  doesn't cover the melee swing). For everything else under !, keep the
  ValidatePlayerBuff anti-refresh skip (CastSpellNoToggle only covers
  true toggle auras, not regular self-buffs like Mark of the Wild),
  otherwise CastSpellNoToggle. This is more reliable for auto-repeat
  than the old CheckChanneled path.

CheckChanneled is retained (still used by the [channeled]/[checkchanneled]
conditionals).
2026-06-21 02:55:40 -05:00
Brues a220dbd003 [swimming] via ClassicAPI IsSwimming; drop nampower 2.36 gate
Add ClassicAPI.IsSwimming wrapper and route [swimming]/[noswimming] and
the swim/noswim aliases through it. Removes the Nampower v2.36
hasPlayerIsSwimming version gate and the "requires Nampower 2.36"
warning (ClassicAPI's IsSwimming is always available). Same semantics.
2026-06-21 02:17:19 -05:00
Brues d4df0a3b26 CancelAura via C_Spell.CancelSpellByID; stop [focus] no-focus warning
- CancelAura: cancel matched buffs through ClassicAPI's
  C_Spell.CancelSpellByID instead of nampower CancelPlayerAuraSpellId
  and the legacy slot-based CancelPlayerBuff + tooltip-scan path. The
  buff scan (SuperWoW GetPlayerBuffID / nampower raw GetPlayerAuraDuration
  + overflow tracking) and the boolean return are preserved, so the
  ~spell cancel-vs-cast toggle still works. CancelSpellByName isn't usable
  here because it reports no match.
- Focus: GetFocusUnitId no longer warns when no focus is set. In a
  fallback macro ([@focus] as one alternative) that's a normal state;
  the clause now silently falls through like any unresolved @unit.
  Dropped the unused warn parameter and updated both callers.
2026-06-21 02:10:52 -05:00
Brues f926ac5521 Replace custom/UnitXP timers with ClassicAPI C_Timer
- ScheduleTimer now wraps C_Timer.After, removing the dedicated timer
  frame + per-frame OnUpdate loop + timers queue.
- Aura-tracking cleanup -> C_Timer.NewTicker(5) (_auraCleanupTicker);
  drop the UnitXP arm, the named global CleveRoids_AuraTrackingCleanupTimer,
  and the inline "not hasUnitXP" fallback in OnAuraCastOther.
- Libdebuff cleanup -> C_Timer.NewTicker(30) (_cleanupTicker); drop the
  UnitXP arm and CleveRoids_LibDebuffCleanupTimer.
- Shutdown cancels the tickers instead of UnitXP timer disarm.

Cleanup now always runs (was gated on hasUnitXP) and no longer depends
on UnitXP threaded timers or named global callbacks. Tickers self-guard
on isShuttingDown and are cancelled on shutdown.
2026-06-21 01:59:54 -05:00
Brues 75a6371f52 keep active local 2026-06-21 01:57:29 -05:00
Brues a9c031538b Use native ClassicAPI focus token; add [focus]/[nofocus]
ClassicAPI exposes a native "focus" unit token (set via its own /focus
/ FOCUSTARGET keybind), accepted by every UnitX call.

- GetFocusUnitId falls back to the native "focus" token after the pfUI
  emulated-focus check, so @focus / [cond:focus] / focus range checks
  now work for non-pfUI users (previously focus only worked via pfUI).
- TryTargetFocus uses TargetUnit("focus") for an exact switch before the
  fragile name-based TargetByName path.
- Add [focus]/[nofocus] conditionals (GetFocusUnitId ~= nil), covering
  both pfUI and native focus; registered as boolean conditionals.

No addon /focus command is needed: ClassicAPI's companion addon already
registers /focus and /clearfocus.
2026-06-21 01:50:34 -05:00
Brues 5d5b46b0a6 Adopt ClassicAPI in Conditionals: item cooldown, stealth, nameplates
- GetItemCooldownCached: resolve via ClassicAPI GetItemCooldown (by item
  id/name) instead of FindItemLocation + nampower GetItemIdCooldown +
  link parsing; equipment slots (1-19) still query the inventory slot.
- [stealth]/[nostealth] and [stl]/[nostl], and the Rogue branch of
  GetCurrentShapeshiftIndex, now use ClassicAPI IsStealthed() (covers
  Rogue Stealth + Druid Prowl) instead of class-gated localized buff
  lookups. Note: [nostealth] is now true for non-stealth classes.
- CountEnemiesMatching nameplate scan uses C_NamePlate.GetNamePlateGUIDs()
  instead of walking WorldFrame children and extracting GUIDs via
  pcall(frame.GetName).
- Add ClassicAPI.IsStealthed / GetNamePlateGUIDs wrappers.
2026-06-21 01:05:28 -05:00
Brues af38410249 use GetItemCooldown from classicapi 2026-06-21 00:56:52 -05:00
Brues 73e8938d76 Use ClassicAPI for action-bar mapping, spell IDs, and dynamic pfUI icons
GetActionInfo:
- Add ClassicAPI.GetActionInfo wrapper; rewrite GetActionButtonInfo
  (Generic.lua) to use it and resolve names via GetSpellRecField /
  GetItem / GetMacroInfo, replacing the per-slot GameTooltip scan +
  texture heuristic. Powers reactive-ability slot detection.
- Delete the dead SuperWoW-GetActionText copy of GetActionButtonInfo.

Spell IDs in the index:
- IndexSpells now uses ClassicAPI GetSpellInfo(slot, bookType), whose
  10th return is the spellID, so every Spells entry carries .id (one
  call also replaces GetSpellName + GetSpellTexture).

Dynamic pfUI action-button icons (pairs with the pfUI fork change):
- GameTooltip.SetAction hook renders spells via ClassicAPI
  SetSpellByID(spell.id) instead of SetSpell(spellSlot, bookType) +
  manual rank text. Items stay location-based (instance data).
- Drop the redundant GetActionSpellSlot -> GetSpellCooldown cooldown
  shim in the pfUI handler; pfUI now routes through the hooked
  GetActionCooldown when it defers macro scanning to us.
2026-06-21 00:11:46 -05:00
Brues b28f4452b9 Make ClassicAPI a hard requirement; remove movement fallbacks
ClassicAPI is now required, not optional. The load-time requirement
check warns when it's missing (Core.lua), the same as Nampower/UnitXP,
and ClassicAPI-backed code calls the API directly with no fallbacks.

- ClassicAPI.lua: drop the HasUnitAuras/HasUnitSpeed/HasIsFalling
  capability gates and pcall hedging; wrappers call C_UnitAuras /
  GetUnitSpeed / IsFalling directly. Keep IsAvailable (used by the
  requirement check) and the version helpers.
- [moving]: ClassicAPI GetUnitSpeed is the only source. Removed the
  MonkeySpeed integration, the Nampower PlayerIsMoving branch, and the
  100 Hz position-tracking buffer in Core.lua's OnUpdate (with its
  POS_TRACK_INTERVAL constant and UnitPosition upvalue). Removed the
  now-dead speed==nil guards and WarnNoSpeedSource.
- README: ClassicAPI moved to Required; MonkeySpeed dropped from
  Supported Addons.
- docs/CLASSICAPI-TODO.md: record the mandatory/no-fallbacks policy.
2026-06-20 23:47:23 -05:00
Brues c05fc754e6 Add ClassicAPI dispel-type conditionals via C_UnitAuras
Introduce ClassicAPI.lua, a feature-detection layer for the ClassicAPI
client mod that mirrors NampowerAPI's HasMinimumVersion pattern
(IsAvailable / HasMinimumVersion / HasUnitAuras). UnitHasDispelType
scans a unit's auras via C_UnitAuras and reports the dispel type,
scanning debuffs or buffs based on a helpful flag.

Add conditionals backed by it:
- Debuff side (defensive cleanse): [magic] [curse] [disease] [poison]
  [dispellable] + negations
- Buff side (offensive dispel/strip): [magicbuff] [dispellablebuff]
  + negations

All are no-arg booleans, default to @target (honor @unit), and degrade
gracefully without ClassicAPI: positive checks return false, negated
return true, since vanilla cannot read aura dispel types. The existing
ValidateAura path is untouched. MacroErrorChecker auto-accepts them via
the Keywords table; they're registered in BOOLEAN_CONDITIONALS so they
parse as flags. Loaded after NampowerAPI in the TOC.
2026-06-20 23:03:23 -05:00
Josh Sachs d863387bce add [bg]/[nobg] conditional for battleground detection
Uses GetBattlefieldStatus to check whether any battlefield queue
slot is in the "active" state, which indicates the player is
currently inside a battleground instance.
2026-04-06 21:05:03 -04:00
Jrc13245 e51c4f7136 fix pfui libdebuff and extra overflowframe tracking 2026-04-02 15:02:50 -04:00
Jrc13245 fbbbb1fcce updates for unified tracking 2026-04-01 16:11:47 -04:00
Jrc13245 95bf408ed7 fix pet, focus, and add new conditional playercontrolled 2026-04-01 14:41:24 -04:00
Jrc13245 809b04b9de fix debuff tracking alongside pfui 2026-04-01 14:18:08 -04:00
Jrc13245 765256642a update immunity of cc spells not mistaken for immunity to dmg type 2026-03-31 20:04:13 -04:00
Jrc13245 25b689f5cb fix non standard token usage like focustarget 2026-03-30 16:25:01 -04:00
Jrc13245 ae6f4105c2 add new shorter aliases 2026-03-28 17:54:28 -04:00
Jrc13245 719021ff65 Add set conditional, rmarkorder, Reliquary DBC integration, and fix immunity tracking false positives 2026-03-27 16:01:34 -04:00
Jrc13245 aea93b14bf filter player when using multiscan help 2026-03-24 08:20:15 -04:00
Jrc13245 58974de765 no more forced addon disable, just warnings about required dlls, and also multiscan + help conditional works on friendlies 2026-03-24 07:50:13 -04:00
Jrc13245 223edb6cfb add conditional rangetimer and rtimer and their noable versions 2026-03-23 16:08:16 -04:00
Jrc13245 5bb8ebe9b7 add item count support for inbag/noinbag conditional, fix macro frame whitelist and error log on macro frame 2026-03-21 12:03:46 -04:00
Jrc13245 cc87fac66f fix table error 2026-03-19 13:49:09 -04:00
Jrc13245 137e08a209 fix target overflowframe and possible immunity system fix 2026-03-17 18:25:20 -04:00
Jrc13245 11e33fc0d3 fix match error 2026-03-15 14:18:21 -04:00
Jrc13245 9b2c0d2191 fix nodebuff returning false on broken cc, fix multiscan nearest + class filter 2026-03-15 13:01:23 -04:00
Jrc13245 4ddac30726 fix inrange distance measuring, add distance range count threshold for enemy count, add filters for count mode, fix stopattack 2026-03-15 11:11:40 -04:00
Jrc13245 de8760f872 fix item counts on actionbars and new conditional addition facing and nofacing 2026-03-14 09:02:11 -04:00
Jrc13245 6ab3f7a157 fix debuff bug, reformat pfui hooks, add rangedclip and norangedclip conditionals 2026-03-13 08:25:23 -04:00
Jrc13245 efdcde3eca performance updates, meleerange conditional checks if unit is alive 2026-03-11 19:57:33 -04:00
Jrc13245 8bc3dc76e1 fix charge buffs 2026-03-09 16:27:56 -04:00
Jrc13245 ff73210d2d some debug 2026-03-09 15:37:51 -04:00
Jrc13245 69b9c08a2b fix meleerange and count mode 2026-03-08 16:38:57 -04:00
Jrc13245 8dbedfa90b meleerange fix and player buff timer fix 2026-03-08 11:53:46 -04:00
Jrc13245 2976729c9b make distance checks more accurate 2026-03-07 19:15:57 -05:00
Jrc13245 8a70a896f5 fix meleerange conditional checks 2026-03-07 18:27:39 -05:00
Jrc13245 13cde9d2ef fix buff tracking for the player 2026-03-07 10:36:24 -05:00
Jrc13245 34190ccbd8 fix debuff and buff tracking 2026-03-06 18:55:39 -05:00
Jrc13245 2f698403e5 fix showtooltip icon for multiple evaluation keywords 2026-03-06 17:35:44 -05:00
Jrc13245 4ccd0f81aa fix player buff stacks count and all unit stack count off by one 2026-03-06 16:44:36 -05:00
Jrc13245 7f6c1dbdbc fix stale debuffs 2026-03-06 13:57:43 -05:00
Jrc13245 6d3fb05c1e get correct debuff aura durations 2026-03-05 17:11:03 -05:00
Jrc13245 9b140ad56c fix target and player overflowframe checking visible buffs before verifying overflow buff exists 2026-03-04 18:23:26 -05:00
Jrc13245 9c05a6fc6a fix pfui loading objects without superwow 2026-03-03 11:10:55 -05:00