question

MoonHeonYoung avatar image
MoonHeonYoung asked

how to know container's content in client code?

I want to know the contents of the container item in my inventory through GetUserInventory.

Its contents should be displayed in the client's ui.

However, in the ItemInstance class obtained from GetUserInventory, there is no property to know the contents of Container.

In other words, there is 500 VC in the container, but I need to display this in the UI,

but I don't know how.

I've seen in other posts that i should use the GetCatalogItem function,

but this method has the inconvenience of having to call the function once more.

Is there a way to know the contents of container and quantity of contents through getUserInventory function?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

The is by design, containers will remain as an item in the inventory until opened, therefore GetUserInventory won’t return it contents. And, the most straightforward way would be using GetCatalogItems to retrieve such info, to avoid the inconvenience of calling this function again, you might consider caching the results in the client side for later retrieval.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.