Quantcast
WoWInterface - View Single Post - Problem getting accurate spell descriptions
View Single Post
08-06-19, 07:52 PM   #1
merlecorey
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 9
Problem getting accurate spell descriptions

Here's another headscratcher I've run into.

I am trying to figure out the amount of healing or damage a spell does. In the past, I used a tooltip scanner, but that approach doesn't seem to work now... or if it does, I don't know how to code it correctly because I can no longer call GetText() on tooltip's font strings and get the actual text back (I get nil instead).

So I am trying to use Spell:CreateFromSpellID / ContinueOnSpellLoad / GetSpellDescription, which seems to be the intended way of getting spell descriptions now. So, here's the scenario:

* I get the description of a healing spell. It has the correct healing amount.
* I get a buff that increases all healing done by 15%.
* My UNIT_AURA callback is called and I get the spell description again. It has the old -- incorrect -- healing numbers.
* Several hundred milliseconds later, the string returned by GetSpellDescription() finally changes to reflect the correct healing amount. There doesn't seem to be an event associated with this description change.
* The buff expires. Several hundred milliseconds later, the text reverts to the original healing amount.

Now, the long delay itself isn't a problem. The problem is that I can't find a way to detect the moment of change via an event. Sure, I can poll for changes, but that sucks because it's much less inefficient.

So, two questions.

1. Is there a better way to handle this aside from polling?

2. Is tooltip scanning still a thing? (If so, a working code sample would have been awesome)

Thanks!
  Reply With Quote