10-23-15, 06:43 AM | #1 |
Need help with SpellBook taint
I'm currently working on an addon that interracts with the SpellBook but I seem to taint it which causes errors when trying to cast a spell from the book (because CastSpell() is protected).
The idea is that I have a button showing a spell, and when clicked it opens the SpellBook to the page where the spell is located. As far as I've seen there's no function for this so I basically go through all the tabs, pages and slots to find the correct spell. The issue is that this, and even just toggling the SpellBook, will taint it. So I'm trying to figure out if there's a way I can fix it. Full code can be found on my GitHub Once the button is pressed the only relevant code is the following: (line 122- 141) It get the name of the spell, then calls the function to scout through the spellbook for that name. If it's found it plays a highlight animation, else it just opens on the default page. And then it opens the SpellBook if it's not open yet. Lua Code:
The function to scout works like this: (line 47 - 105) It simply starts at the first tab, checks all the slots until it reaches an empty one or the last one. Goes through the different pages on that tab until it's done and goes to the second tab. if it finds the spell it stays on that page and returns success and the slot (to archor the highlight to) Lua Code:
The template for the buttons are in the XML file. Template lines 15 to 136 Actual buttons at 242 - 300 So I'm trying to figure out if there is a way to prevent the taint, or if there's just no way to do it correctly. Last edited by LanceDH : 10-23-15 at 07:05 AM. |
|
WoWInterface » Developer Discussions » Lua/XML Help » Need help with SpellBook taint |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Switch to Hybrid Mode |
Threaded Mode |
|
|