WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Wish List (https://www.wowinterface.com/forums/forumdisplay.php?f=15)
-   -   Is Spell Usable in Current Form (https://www.wowinterface.com/forums/showthread.php?t=57671)

LBXZero 11-11-19 12:50 PM

Is Spell Usable in Current Form
 
The function(s) I wish were in the UI:

IsUsableInForm(spellID, [x])

Input:
spellID = spellID of Spell being checked
x = Index based on class's available forms (Use GetShapeshiftFormInfo index). Optional, if omitted then uses current form.

Output:
usable = boolean
true = Spell can be cast in selected form, disregarding other reasons why it can't be cast
false = Spell can't be cast in selected form, (can return false if not learned)

Detail:
Parallel to "IsUsable", this function takes in a spellID and optionally a form and returns true if the spell can be cast in current form or false if it can't be cast in form.

My intention for function:
I want to highlight spells in the Spellbook based on if the spell is usable in the form. Some basic research shows the only real test if a spell can be cast in the current form is by casting the spell and looking for the UI_ERROR_MESSAGE event. Even then, target and range errors take priority before stance/form errors.

My current alternative is parsing tooltip data for the "Requires" lines, which I have an idea of a workaround for language localization.


All times are GMT -6. The time now is 01:01 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI