GetSpellInfo changes in WOD beta
It seems Blizzard changed the return values for GetSpellInfo.
It used to be: Code:
name, rank, icon, powerCost, isFunnel, powerType, castingTime, minRange, maxRange = GetSpellInfo(...) Code:
name, rank, icon, castingTime, minRange, maxRange = GetSpellInfo(...) |
You can use tooltip scanning. Set the spell to a tooltip, and then look at the text in the tooltip. Do a forum search if you need examples; I know there are tons, but I'm too lazy to find them for you right now.
Strange, though, that they'd remove information that's actually relevant, but leave the rank return, when spells haven't had ranks in years... |
I noticed another oddity with GetSpellInfo. When you call it in WoD with an invalid Spell ID it returns a table of 3 empty strings, while the current live (5.4) returns nil.
|
Quote:
https://github.com/tekkub/wow-ui-sou...rnal.lua#L2291 Oddly enough, the old return values are still present in some code in the latest build, although not used (shaman totem bar): https://github.com/tekkub/wow-ui-sou...Frame.lua#L963 |
Quote:
|
Quote:
|
Quote:
|
That's a lot of unnecessary overhead...
Code:
local name, some, other, vars, here = GetSpellInfo(12345) |
Quote:
|
The common texts in tooltips (X mana, Y rage, Z energy, etc.) all use strings from GlobalStrings.lua, so you can just pick out the strings (Blizzard uses them with string.format) and convert them for use with string.match.
For example, the "X mana" string is contained in the global variable MANA_COST, and I use the following code to make spell tooltips show the mana costs of spells as a percent of my total mana pool instead of as a raw number; the lines I highlighted in green will be the most relevant for you. Code:
local MANA_COST_PATTERN = gsub(MANA_COST, "%%d", "([%%d%.,]+)") |
Ah, having GlobalStrings.lua for all locales will make this easier. Thanks for the link.
|
All times are GMT -6. The time now is 12:22 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI