Thread Tools Display Modes
04/13/19, 01:53 PM   #1
silvereyes
 
silvereyes's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2015
Posts: 66
[open] Ability to iterate set ids / names

It would be very nice to have the ability to enumerate all item set ids and then look up set name and set item bonus information by id, similar to how styles can be iterated with GetNumValidItemStyles(), GetValidItemStyleId(), GetItemStyleName() and GetSmithingStyleItemInfo().
  Reply With Quote
04/13/19, 05:11 PM   #2
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
For craftable sets, I've implemented something like that in LibLazyCrafting. It's hardcoded, only craftable sets, and only a few itemIds.

It would be awesome to have something like that for all sets though.
  Reply With Quote
04/13/19, 07:54 PM   #3
ziggr
 
ziggr's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 27
Baertram's LibSets seems perfect for this.
  Reply With Quote
04/13/19, 09:00 PM   #4
silvereyes
 
silvereyes's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2015
Posts: 66
LibSets looks interesting, but having every player do their own complete item id scan seems like a bit of a sledgehammer for the problem.

A pregenerated mapping table of setIds to example item links that could be passed to GetItemLinkSetInfo() would be a lot more efficient, and bypass localization issues with set names, but then it requires someone to maintain it every patch.

Neither solution is really ideal, especially since the client already has access to all the information needed. Thus, the request for an API.
  Reply With Quote
04/14/19, 07:02 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Hardcoded is always bad if you got the way to determine it dynamically. imo
So LibSets is scanning the setIds once every API change. This shouldn't be a problem.
It also tells the users that it is doing this and forces them to do a simple reloadui afterwards. Takes 1 minute at all where you are even able to do whatever you want beside.
You could add ALL setIds to a list and update it manually so players don't have to do a scan. But seroiously: Who is going to maintain and update this if you can have it automated? I don't see any benefit in a hardcoded list.

And about localization: The SavedVars store the localized set names once they got scanned. If you change the client language the scan with this language will be done again and added to your SavedVars.
Within LibZone I've added the localization to the library so everyone got a base localization. One could implement this for LibSets as well, but currently I have not planned to do so.

Edit:
Currently working on LibSets to distinguish overland, dungeon and monster sets

Last edited by Baertram : 04/14/19 at 07:59 AM.
  Reply With Quote
04/15/19, 08:39 PM   #6
silvereyes
 
silvereyes's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2015
Posts: 66
Oh, I'm not criticizing LibSets at all. It's the best technique available with the current API limitations. I wholeheartedly agree with you about nobody wanting to maintain a hardcoded list.

It's just my humble opinion that if addons have to resort to a full item database scan just to fill out a relatively small enumerable list, then there's definitely an opportunity here for an API improvement .
  Reply With Quote
05/13/19, 08:29 AM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Not quite sure if silvereyes meant this to be added as well but we would be very glad if you could add an API function which is able to provide the set's information without having to use and itemlink.

As the given game's API function

Current
Code:
* GetItemLinkSetInfo(*string* _itemLink_, *bool* _equipped_)
** _Returns:_ *bool* _hasSet_, *string* _setName_, *integer* _numBonuses_, *integer* _numEquipped_, *integer* _maxEquipped_, *integer* _setId_
provides the unique setId already it would be great if we could get all other information this function returns today (set name, bonus, etc.) by just having to use the unique setId
e.g.


New added
Code:
* GetSetInfo(*number* _setId_, *bool* _equipped_)
** _Returns:_ *string* _setName_, *integer* _numBonuses_, *integer* _numEquipped_, *integer* _maxEquipped_, *table* itemIdsOfThisSetId
The last return value "itemIdsOfThisSetId" would be cool but I guess nice 2 have


And for the setBonus info as well:

Current
Code:
* GetItemLinkSetBonusInfo(*string* _itemLink_, *bool* _equipped_, *luaindex* _index_)
** _Returns:_ *integer* _numRequired_, *string* _bonusDescription_
New added
Code:
* GetSetBonusInfo(*number* _setId_, *bool* _equipped_, *luaindex* _index_)
** _Returns:_ *integer* _numRequired_, *string* _bonusDescription_
  Reply With Quote

ESOUI » Developer Discussions » Wish List » [open] Ability to iterate set ids / names

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