What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

CurrentTabInventory

Nepthys

Community Developer
Joined
Oct 13, 2014
Messages
89
Reaction score
1
Hey all :)

Has anyone figured out how to use the new 'CurrentTabInventory'?

Trying to convert the following code. This makes a list of all the items in the stash


var CombinedStashItems = LokiPoe.InGameState.StashPanel.CurrentTabItems;

while (Loki.Game.LokiPoe.InGameState.StashPanel.NextTab() )
{
await Coroutine.Sleep(50);
CombinedStashItems = CombinedStashItems.Union(LokiPoe.InGameState.StashPanel.CurrentTabItems).ToList();
}


Thanks!
 
Its
Code:
LokiPoe.InGameState.StashPanel.CurrentTabInventory.Items

p.s. You can't really gather all stash items because references will be lost after tab switch. You can save names and locations instead.
 
The old API provided functions to read the "cached" client data for inventory contents, but that design was dropped in favor of the current system. The old API also allowed performing actions on the stash that were not human like (e.g., being able to withdraw/stash items to tabs that weren't visible) so all of that was changed with the 1.2 rewrite.

Now, you need to go tab by tab and process the items on the current page as needed. You should make your own lightweight item wrapper and store the data you need from each Item. The client only requests the stash tab contents once upon the first access, so there's no issue with going though the stash multiple times, aside from the time it takes if you have a bunch of tabs.

Code wise, what ExVault mentioned is right, the CurrentTabItems property was made internal to avoid an issue where location data was not present in those items because of how the client works. Instead, you need to get items from the current tab's inventory.
 
Back
Top