Originally Posted by Mikord
GetSpellInfo exists before addons are loaded. You don't need to wait for any events.
Tested the following and it prints Mortal Strike as expected:
TestGSI.toc
Code:
## Interface: 20400
TestGSI.lua
TestGSI.lua
Code:
ChatFrame1:AddMessage(GetSpellInfo(12294))
|
You see that's VERY interesting in itself - because any attempt I make to write to ChatFrames directly in the .LUA (e.g. not in a function) or even on the VL event fails (no error - but nothing written into chatframes either) - if I do it in PL and PEW is works MOST (but not all) of the time.
I this a lot of the problems I'm having here relate to my PC - it's not amazingly quick (it's 2 years old and wasn't state-of-the-art then!!) - but things like this and the issues I raised with 'losing' macros etc. (in another thread) would be explained by my PC just being a bit slow...
Not a problem for you guys I'm guessing BUT you might want to bear-in-mind that some of our USERS may have simiarly slow PCs
Example
My NowCarrying addon wants to ignore all the initial BAG_UPDATE events that people are spammed with on login - so I put in a manual delay of 0.5 sec before it starts to check them.
Worked fine for me - (a test suggested I only needed to wait about 0.2sec but I added a bit anyway) but a few people said they were seeing the 'spam' caused by those events so I increased it to 1sec
Then I get WOTLK and I started to see the spam myself so I increased it to 2 secs!!
So far so good - no-one has reported the spam since that change - but it just shows that your addons can behave differently on slower PCs/newer builds of WoW in ways you don't expect
p.s. Mik - thanks for the Frame example code - I've nicked it wholesale