Skip to content

Core: Add compatibility shims for Spell and SpellBook functions - #88

Open
PatTheMav wants to merge 3 commits into
GoldpawsStuff:mainfrom
PatTheMav:usablespell-fix-wow11
Open

Core: Add compatibility shims for Spell and SpellBook functions#88
PatTheMav wants to merge 3 commits into
GoldpawsStuff:mainfrom
PatTheMav:usablespell-fix-wow11

Conversation

@PatTheMav

@PatTheMav PatTheMav commented Sep 25, 2024

Copy link
Copy Markdown
Contributor

Many Spell- and SpellBook-related functions were deprecated in Dragonflight and removed in The War Within (as expected).

Those functions have been moved out of the global namespace and into the C_Spell and C_SpellBook namespaces respectively and have also been split up into specific functions interacting with spells or the spell book.

Shims for the old functions thus need to use different function calls depending on the call signature (probably a reason why this was split up).

This will fix a whole lot of issues related with spell flyout menus, as LibActionButton is severely outdated and still uses the long-deprecated old global functions.

Note

This is a band-aid over the fact that LibActionButton has not been updated in years and should ideally replaced entirely.

This PR is based on #86 and should be merged before this PR. A rebase-merge should eliminate the superfluous two commits automatically then.

Lua does not support mixing of function calls that return multiple
values and logical expressions.

The original call would have only ever yielded the "name" value,
as all other return values would have been truncated.
@PatTheMav
PatTheMav force-pushed the usablespell-fix-wow11 branch 2 times, most recently from ac19d38 to 1d28a12 Compare September 29, 2024 12:09
@PatTheMav PatTheMav changed the title Core: Add compatibility shim for IsUsableSpell Core: Add compatibility shims for Spell and SpellBook functions Sep 29, 2024
@PatTheMav
PatTheMav force-pushed the usablespell-fix-wow11 branch from 1d28a12 to 9f6dd16 Compare September 29, 2024 12:17
The IsUsableSpell method has been renamed to C_Spell.IsSpellUsable,
the call and return signatures have not changed however, so a simple
alias is sufficient.
@PatTheMav
PatTheMav force-pushed the usablespell-fix-wow11 branch from 9f6dd16 to ea4b2c4 Compare September 30, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant