ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Wish List (https://www.esoui.com/forums/forumdisplay.php?f=177)
-   -   [open] Ability to iterate set ids / names (https://www.esoui.com/forums/showthread.php?t=8460)

silvereyes 04/13/19 01:53 PM

[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().

Dolgubon 04/13/19 05:11 PM

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.

ziggr 04/13/19 07:54 PM

Baertram's LibSets seems perfect for this.

silvereyes 04/13/19 09:00 PM

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.

Baertram 04/14/19 07:02 AM

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

silvereyes 04/15/19 08:39 PM

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 :D.

Baertram 05/13/19 08:29 AM

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_



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

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