View Single Post
07/16/17, 01:35 AM   #1
manavortex
 
manavortex's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 138
[outdated] Bagtracking (or "where on Nirn are my Nirnroots?")

Hey there,

I know that I could in theory just iterate over bags (except for BAG_VIRTUAL), but I have two issues currently when it comes to finding stuff in bags. I'll outline my use cases again.

"Stack all" isn't working for ESO+ subscribers

That's probably easiest to fix for you, but being an AddOn dev, of course I'm thinking "how to make an AddOn for this", and it includes a lot of iterating. I bet there are more performant ways to do that from your side?

I would love a function to get the bag control's data entry in a single query, because that contains pretty much all I would ever need to access for my AddOn. Basically

Lua Code:
  1. GetItemLinkInventoryData(itemLink)
  2. GetItemInventoryData(bagId, slotId)

that just returns an empty table if it doesn't find anything. (returning an empty table assures that if I do result.key I don't get an exception, but just nil, and that I'd just have to nil-check on nested. Of course that's just my suggestion, and all this is open for discussion).

Reason behind that is that I find myself avaricious when it comes to loops and API calls, and since that table is lying around anyway, I figured I might as well ask for a convenient way to utilise it.


Item tracking upon bag movement - use case: Split stack
Again, I'm talking performance. When I move an item, I can easily lose track of it and its stack sizes. Again, I could solve that by listening for the event that fires when moving an item and iterating over BAG_BACKPACK, BAG_BANK and BAG_SUBSCRIBER_BANK on the tooltip's current item link, thus using up about a gazillion API calls.
I remember AssemblerManiac and silvereyes both investing significant brain power into this and not coming up with a brilliant solution, so I'm asking you - could you maybe have an event being fired upon item move that includes itemlink or -ID, sourceBag, sourceSlot, destBag and destSlot? Basically, the whole stuff I'm required to stick into RequestMoveItem.

Thanks for your time and consideration!