Commit Graph
7 Commits
Author SHA1 Message Date
Brues 8a065481b4 Consolidate all Spell.dbc record offsets into Offsets.h
Extend the single-source-of-truth cleanup to the whole Spell.dbc record
layout. 40 local constexpr offset copies across 16 files (spell/, totem/,
lossofcontrol/, macro/, aura/) redefined field offsets that belong in
Offsets.h: name (0x1E0), icon (0x1D4), effect (0xF4), rank (0x204),
effect implicit targets (0x148/0x154), powerType (0x7C), manaCost (0x80),
rangeIndex (0x90), castingTimeIndex (0x48), maxLevel (0x6C), spellLevel
(0x74), manaCostPercent (0x270).

Add the ones Offsets.h lacked as OFF_SPELL_RECORD_* and repoint every
local use to the Offsets:: constant, deleting the duplicates. Purely
mechanical and behavior-preserving -- every local value already matched
the canonical (verified before repointing). SpellIcon.dbc / SpellRange.dbc
sub-record offsets (0x04/0x08) stay local; they are different structs.
2026-08-07 17:44:01 -05:00
Brues d9102bae3b Relicense source headers from LGPL to GPL v3
The repo was internally inconsistent: the LICENSE file is GPL v3 but every
src/ header carried the LGPL v3 notice and the README said "LGPL v3 or
later". LGPL was also the wrong fit — this is an injected mod plus a
bundled addon, not a library other code links against, so LGPL's linking
exception buys nothing.

It's also required: src/voicechat/Tts.cpp is ported from awesome_wotlk's
VoiceChat.cpp, which is GPL v3, and a derivative of GPL code cannot be
relicensed under more permissive terms. Dependencies stay compatible —
MinHook (BSD-2) and the nampower-mirrored packet shapes (BSD) are
GPL-compatible, and SAPI is covered by the system-library exception.

Swept "GNU Lesser General Public License" -> "GNU General Public License"
across all 257 src/ headers and changed the README license line to match
the GPL v3 LICENSE file. Comment-only; no build impact.
2026-06-29 16:38:16 -05:00
Brues 999a5846c4 Macro tagging: extract dispatch hub, add C_Spell.CastAtCursor pattern
Hoists the macro-parser hook + long-line guard + per-line walk out
of Spell::CastNoToggle into a new Spell::MacroPrimarySpell module
that dispatches to (prefix, extractor) pairs registered by feature
modules. The body walk now visits each line once and checks every
registered prefix at each position; extractors only parse args
after a matched prefix.

Registers a pattern for C_Spell.CastAtCursor(<spellID>) so macros
like `/run C_Spell.CastAtCursor(10)` get tagged with the spellID
the same way `/cast Blizzard` does, driving action-bar cooldown
overlays and auto-repeat highlight in pfUI etc.
2026-06-04 02:29:58 -05:00
Brues 8e790e9221 Extract Spell::Arg, mirroring Item::Arg
Two callers were duplicating the spellIdentifier-resolution pattern
(number / hyperlink / name) and the NameToSpellID_t typedef:

  src/spell/Cooldown.cpp      → full pipeline via SpellIDFromLink +
                                 ResolveSpellID + NameToSpellID_t
  src/spell/CastNoToggle.cpp  → NameToSpellID_t + ResolveNameViaEngine
                                 helper for the macro-parser hook

Consolidated into Spell::Arg (new spell/Arg.h + Arg.cpp), parallel
to Item::Arg. Same `Resolved { spellID, name }` shape, same
strstr("spell:") link-parse approach. Three exports:

  Spell::Arg::Resolve(L, idx)         → Resolved
  Spell::Arg::ResolveSpellID(L, idx)  → int (auto-name-lookup)
  Spell::Arg::NameToSpellID(name)     → int (standalone)

C_Spell.GetSpellCooldown sheds the local SpellIDFromLink /
ResolveSpellID helpers; CastNoToggle sheds the duplicate typedef
plus its ResolveNameViaEngine wrapper. Net -50 lines, single place
to extend when we want to add link/name parsing to other C_Spell.*
endpoints later.

Verified: GetSpellCooldown still works for number, link, and name
inputs; CastSpellNoToggle macro-tag path still works.
2026-05-21 14:06:34 -05:00
Brues 85e036e2ec Prevent CastNoToggle parsing for very long macros 2026-05-21 02:03:23 -05:00
Brues ab85a54423 remove debug logging from CastNoToggle 2026-05-17 17:38:23 -05:00
Brues ca4294492e CastSpellNoToggle 2026-05-17 02:03:51 -05:00