Thread Tools Display Modes
09-04-14, 03:21 PM   #21
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
I tested this myself yesterday ( with index numbers not names ) and there are 2 '1' values on addons that are loadable and enabled. The values listed in wowpedia for GetAddOnInfo function are still valid from my tests and in the order listed.

On my lowbies I don't have DBM enabled and those addons only listed the name, title and notes values.

reason showed as nil for all my addons that I could see, I even tried enabling addons that had missing requirements.

security showed as INSECURE for all addons whether enabled or not. there may be values after that but when checked manually they always appeared as nil.
__________________
 
09-04-14, 11:47 PM   #22
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by gizmo28 View Post
I personally would use name because some people use different titles from the addon folder in their .toc files.
Not only that, but an addon can have different titles for different languages, and some authors include the version number in the title (though they really shouldn't do that). Nobody should ever use the Title field as a means of detecting particular addons. If you've seen some resource recommending this practice, or an addon doing it, please tell me what it is so I can go yell at its author.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
09-05-14, 03:42 AM   #23
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Ugh, the change to GetAddOnInfo and related APIs (dropping support for querying by name) is so obnoxious... is there some official forum where Blizzard might actually see complaints about beta API changes? Having to loop over every single addon, query GetAddOnInfo, check the name, and then separately query GetAddOnEnableState is ridiculous.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 11-07-14 at 08:30 PM. Reason: Spelling.
 
09-05-14, 04:52 AM   #24
Coote
A Scalebane Royal Guard
 
Coote's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 440
Originally Posted by Phanx View Post
Ugh, the change to GetAddOnInfo and related APIs (dropping support for querying by name) is so obnoxious... is there some official forum where Blizzard might actually see complaints about beta API changes? Having to loop over every single addon, query GetAddOnInfo, check the name, and then separately query GetAddOnEnableState is riduclous.
I think every patch they flip a coin to decide if they're going to screw with people and make random changes. If it comes up heads, they do, if tails, they don't. When it comes up heads, they spin a wheel to decide what kind of random archaic changes they should do.

I joke about it all the time, but I wouldn't be surprised if I were to find out this is exactly what they do.
__________________

"This is the fifteen-thousandth four hundredth and ninety-eighth occurence".
 
09-05-14, 05:04 AM   #25
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
This also has the implication that one can't call GetAddOnInfo and the like on Blizzard addons, not that I know of a reason why one would want that. I also don't find GetAddOnEnableState particularly useful. You could get this info from GetAddOnInfo's fifth return (named "reason" in previous posts in this thread). If reason is not "DISABLED" then the addon is enabled.

Apart from that the old behavior of GetAddOnInfo is easily achieved by creating an addon_name = addon_index dictionary, isn't it? I do believe this is just like how GetSpellInfo used to return empty strings instead of nil for non-existent spells - they'll change it back.
 
09-05-14, 07:26 AM   #26
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Rainrider View Post
I also don't find GetAddOnEnableState particularly useful. You could get this info from GetAddOnInfo's fifth return (named "reason" in previous posts in this thread). If reason is not "DISABLED" then the addon is enabled.
GetAddOnEnableState is theoretically useful; while GetAddOnInfo only tells you whether the addon is enabled on the currect character, with GetAddOnEnableState you can get a bit more detail:

Addon is enabled on all characters:
GetAddOnEnableState(nil, index) => 2
GetAddOnEnableState("Charname", index) => 2

Addon is only enabled on some characters, including the current one:
GetAddOnEnableState(nil, index) => 1
GetAddOnEnableState("Charname", index) => 2

Addon is only enabled on some characters, but not on the current one:
GetAddOnEnableState(nil, index) => 1
GetAddOnEnableState("Charname", index) => 0

Addon is not enabled on any characters:
GetAddOnEnableState(nil, index) => 0
GetAddOnEnableState("Charname", index) => 0

The only real use I can think of for this information is in addon managers; the new in-game Blizzard addon manager is the same one that you can use at the character screen, including the "all/character" dropdown, though you can only choose "All" or the current character when using it in-game.

Originally Posted by Rainrider View Post
Apart from that the old behavior of GetAddOnInfo is easily achieved by creating an addon_name = addon_index dictionary, isn't it?
Yeah, but that's still annoying, and requires a significant increase in code clutter and complexity for no apparent reason. LoadAddOn can still handle names, so it's not like they just decided to remove the ability to identify addons by name on the C side. They just disabled the functionality for certain API functions because ... well, because.

If all they wanted was to stop people from being able to disable the Blizzard_* addons, they should have just done that instead of breaking the whole API.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
09-05-14, 07:21 PM   #27
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Was IsAddonLoaded's usage changed as well?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

 
09-05-14, 08:02 PM   #28
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Originally Posted by Seerah View Post
Was IsAddonLoaded's usage changed as well?
Still working the same as is LoadAddOn but you never know what the next build will bring.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 09-05-14 at 08:05 PM.
 
09-05-14, 09:28 PM   #29
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Fizzlemizz View Post
Still working the same as is LoadAddOn but you never know what the next build will bring.
I don't think they can change LoadAddOn to require an index, since they use it to load their own addons, which cannot be accessed by index.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
09-05-14, 09:41 PM   #30
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
It was more to emphasize that they're not getting rid of using addon names so changing to index seems eeerr, pointless.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
 
09-06-14, 12:03 AM   #31
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Originally Posted by Phanx View Post
I don't think they can change LoadAddOn to require an index, since they use it to load their own addons, which cannot be accessed by index.
And what if thats the reason for this change? I mean loading those addons in the wrong order often causes trouble. What if we're no longer supposed to load system addons?
__________________
The cataclysm broke the world ... and the pandas could not fix it!
 
09-06-14, 01:29 AM   #32
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Rilgamon View Post
And what if thats the reason for this change? I mean loading those addons in the wrong order often causes trouble. What if we're no longer supposed to load system addons?
As I said in an earlier post, if their goal was to prevent third-party addons from doing anything with Blizzard addons, they could have just made third-party addons unable to do anything with Blizzard addons, rather than screwing up an entire category of API functions.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
09-06-14, 08:52 PM   #33
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
From my experience tonight with Ackis Recipe List on the latest beta build (18833) the return values for GetAddOnInfo() are actually:

Lua Code:
  1. name, title, notes, isLoaded, reason, security, newVersion = _G.GetAddOnInfo(index)

Though I didn't actually check that newVersion or anything beyond existed.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
 
09-07-14, 01:11 PM   #34
OttoDeFe
A Chromatic Dragonspawn
 
OttoDeFe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 178
Ahh... I see why AddonLoader (among others) is now broken.
__________________
"They say
the pen is mightier than any saber -
any sword -
but if there's a war
I just don't know if a Bic will save ya..."

-- Last Offence
 
09-07-14, 07:27 PM   #35
jaliborc
A Chromatic Dragonspawn
 
jaliborc's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 196
I want to be able to check if an addon is enabled without having to mess my code with loops on all my addons, so I made a library for this: https://github.com/Jaliborc/AddonList-1.0 (yeah, feels stupid to have such a small lib, but crappy APIs lead to crappy solutions). Just in case someone is interested.
 
09-07-14, 10:09 PM   #36
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by jaliborc View Post
I want to be able to check if an addon is enabled without having to mess my code with loops on all my addons, so I made a library for this: https://github.com/Jaliborc/AddonList-1.0 (yeah, feels stupid to have such a small lib, but crappy APIs lead to crappy solutions). Just in case someone is interested.
Since the list of addons cannot change during a session, you should just create a static name->index table, and use a simple table lookup to get the index for the requested name, instead of calling a function that loops over all addons and calls more functions every time.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
09-09-14, 10:30 AM   #37
jaliborc
A Chromatic Dragonspawn
 
jaliborc's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 196
Originally Posted by Phanx View Post
Since the list of addons cannot change during a session, you should just create a static name->index table, and use a simple table lookup to get the index for the requested name, instead of calling a function that loops over all addons and calls more functions every time.
Yeah, you're right. Though about it, but I never seen anyone checking an addon information on performant critical situations (just checking if it is enabled to react accordingly, for example), so I did not worry about it. But caching the indexes certainly scales better. I'll change it.
 
09-10-14, 09:57 AM   #38
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Changes in 18837:

Code:
Old: GetAddOnInfo(index)
New: GetAddOnInfo(index or "name")
Basically reverting their change.
 
09-10-14, 01:55 PM   #39
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Victory! \o/
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
09-10-14, 03:20 PM   #40
humfras
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 131
Originally Posted by Phanx View Post
Victory! \o/
Victory for common sense.

Blizz' still in desperate need of more of that...
__________________
Author of VuhDo CursorCastBar OptiTaunt Poisoner RaidMobMarker
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » API Changes

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off