WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   I know that API Changed Just trying to make it work... (https://www.wowinterface.com/forums/showthread.php?t=59478)

TransformedBG 01-19-23 11:35 PM

I know that API Changed Just trying to make it work...
 
So classic addons crashed obviously since the API updated. one of the functions I was using was using.
GetCurrencyListSize() which simply changed to C_CurrencyInfo.GetCurrencyListSize()

however now no matter what I try it it's now returning nil

from my understanding it sould be returning a number

C_CurrencyInfo.GetCurrencyListSize()
Return values
# Name Type
1 currencyListSize number

even doing something similiar in game like
/script local zebra = C_CurrencyInfo.GetCurrencyListSize()
/print(zebra)

returns a nil value.

just looking for any thoughts or ideas. thanks

TransformedBG 01-22-23 12:22 AM

anyone? just bumping looking for answers..

Xrystal 01-22-23 05:51 AM

The only thing I could think of was that maybe you had to have the addon Blizzard_TokenUI active and the currency page open for it to work.

But, looking at https://github.com/Gethe/wow-ui-sour...okenUI.lua#L66 the 3.4.1 version of the file doesn't seem to have the C_CurrencyInfo. portion of the function.

So, maybe that isn't the problem you are having.

Rilgamon 01-22-23 01:03 PM

Not sure. Never tried this. But when you declare zebra local in the first line then the second line dont know about it? So working as intended?

Vecamia 02-06-23 03:35 PM

In Wrath Classic it should still be GetCurrencyListSize()
Try /dump GetCurrencyListSize() and see if returns anything.

Or, all on one line:
/script local zebra = GetCurrencyListSize() print(zebra)


Being a local variable, in your /script /or macro it wont be available after the first line is executed and will return as nil since its not saved anywhere if call the print(zebra) on another line.
But if do the print function and variable setting on the same line, it should work.



I think this list is whats current on wrath/classic api wise:

https://wowpedia.fandom.com/wiki/Glo...ctions/Classic


All times are GMT -6. The time now is 08:25 PM.

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