elgbar / instant-inventory

Runelite plugin to instantly do inventory actions
https://runelite.net/plugin-hub/show/instant-inventory
BSD 2-Clause "Simplified" License
7 stars 0 forks source link

No preview when depositing an item without an existing bank slot #11

Open elgbar opened 6 months ago

elgbar commented 6 months ago

Describe the bug

The bank interface does not display the deposited item if there is no existing item in the bank

To Reproduce Steps to reproduce the behaviour:

  1. Have an item in your inventory which your bank does not contain (nor exist a placeholder)
  2. Deposit the item
  3. The item will appear as if the plugin is not enabled after a tick.

Expected behaviour

The deposited item should be shown with change opacity where it will be placed the next tick

Screenshots

deposit_bug.webm

Additional context

We must be able to identify which tab is active in the bank. This should be possible with the CURRENT_BANK_TAB (4150) varbit

elgbar commented 6 months ago

Well, this turned out to be harder than expected. The bank widgets are ordered by the tab, except the View all items tab, which is last. The client script responsible (nr 277) will hide all items except for the ones in the current tab. This was a small hurdle, we can calculate the next empty slot.

And yeah, that works, except for a small problem. The position of the widget might not be set up correctly yet! And by reading the client script, it should be possible to figure out how this is calculated. But that's way harder than just setting the widget itemid and quantity!