ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Tutorials & Other Helpful Info (https://www.esoui.com/forums/forumdisplay.php?f=172)
-   -   Get equipped item id (https://www.esoui.com/forums/showthread.php?t=9591)

mamol27 02/22/21 11:10 AM

Get equipped item id
 
Hi!
Is there a way to get itemId from equipped like https://wiki.esoui.com/GetItemId
Thank you.

Scootworks 02/22/21 12:17 PM

have a look at this function: ZO_Inventory_EnumerateEquipSlots or/and ZO_Character_EnumerateOrderedEquipSlots

mamol27 02/22/21 12:37 PM

Sorry, I'm new here. Where can I read specs about this function?

Rhyono 02/22/21 03:56 PM

Iterating over the BAG_WORN and doing something like GetItemLinkItemId(GetItemLink(BAG_WORN, <index>)) would also probably be fine.

Baertram 02/23/21 02:52 AM

Quote:

Originally Posted by mamol27 (Post 43269)
Sorry, I'm new here. Where can I read specs about this function?

Search for it in the esoui source code and check how ZOs uses i does the trick most of the time:
https://github.com/esoui/esoui/searc...eredEquipSlots

The eso inventories are using a bagId for the inventory bagTyp like BAG_BAGPACK, BAG_BANK, BAG_WORN (these are constants just providing a name to a number. BAG_WORN = 0 e.g.).
The function ZO_Character_EnumerateOrderedEquipSlots should do the same like Ryhono said. Iterates over the equipmentslots
(where equipmentslot's slotId is one of the following ones:
https://github.com/esoui/esoui/blob/...ntory.lua#L791
)
.
The itemLink functions use the bagId and the equipSlotId then to create the itemLink for the equipped item.

GetItemLinkItemId provides the itemId from the itemLink created than.

In normal inventory this would be GetItemLink(BAG_BAGPACK, slotIndexOfTheInventoryItem).

mamol27 02/23/21 05:53 AM

Quote:

Originally Posted by Rhyono (Post 43270)
Iterating over the BAG_WORN and doing something like GetItemLinkItemId(GetItemLink(BAG_WORN, <index>)) would also probably be fine.

Thanks! It works as I needed.


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

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