dillydill123 / inventory-setups

Plugin for RuneLite, an open source game client for the MMO Old School RuneScape
https://runelite.net/plugin-hub/dillydill123
BSD 2-Clause "Simplified" License
51 stars 29 forks source link

Search for inventory setup via setup name or contents #238

Closed rbbi closed 7 months ago

rbbi commented 7 months ago

As discussed in #235, search using the "item:" prefix to search for specific inventory/equipment/bolt pouch/rune pouch items by name.

image

rbbi commented 7 months ago

Do we want to automatically reperform the current search whenever an item is removed/added from a setup? Otherwise it becomes out-of-date.

dillydill123 commented 7 months ago

Do we want to automatically reperform the current search whenever an item is removed/added from a setup? Otherwise it becomes out-of-date.

I don't think so. What are the ways a user can update the setup without going into the setup itself?

rbbi commented 7 months ago

Do we want to automatically reperform the current search whenever an item is removed/added from a setup? Otherwise it becomes out-of-date.

I don't think so. What are the ways a user can update the setup without going into the setup itself?

  • Adding an additional filtered item That's all I can think of. Every other situation would cause them to go into the setup, and then back out which would cause a reload. I don't think it's worth redrawing the panel
  1. Search for an item using item:X
  2. Open a setup containing the item
  3. Remove that item from the setup
  4. Click the "Return to setups" button - the search is now no longer up to date as that item has been removed
dillydill123 commented 7 months ago

Do we want to automatically reperform the current search whenever an item is removed/added from a setup? Otherwise it becomes out-of-date.

I don't think so. What are the ways a user can update the setup without going into the setup itself?

  • Adding an additional filtered item That's all I can think of. Every other situation would cause them to go into the setup, and then back out which would cause a reload. I don't think it's worth redrawing the panel
  1. Search for an item using item:X
  2. Open a setup containing the item
  3. Remove that item from the setup
  4. Click the "Return to setups" button - the search is now no longer up to date as that item has been removed

I see, I don't call redrawOverviewPanel in returnToOverviewPanel. Try adding this in, ideally before we try to set the scrollbar position. Hopefully this doesn't have any flickering affect. If there is, maybe we need to change the order of calls in returnToOverviewPanel. And performance should be ok I think.

rbbi commented 7 months ago

Do we want to automatically reperform the current search whenever an item is removed/added from a setup? Otherwise it becomes out-of-date.

I don't think so. What are the ways a user can update the setup without going into the setup itself?

  • Adding an additional filtered item That's all I can think of. Every other situation would cause them to go into the setup, and then back out which would cause a reload. I don't think it's worth redrawing the panel
  1. Search for an item using item:X
  2. Open a setup containing the item
  3. Remove that item from the setup
  4. Click the "Return to setups" button - the search is now no longer up to date as that item has been removed

I see, I don't call redrawOverviewPanel in returnToOverviewPanel. Try adding this in, ideally before we try to set the scrollbar position. Hopefully this doesn't have any flickering affect. If there is, maybe we need to change the order of calls in returnToOverviewPanel. And performance should be ok I think.

Will take a look when I get a moment

dillydill123 commented 7 months ago

Everything looks good besides the redraw part. Let me know how that behaves and I can check it out after March 2nd (out of town)

rbbi commented 7 months ago

Hi, calling redrawOverviewPanel instead of returnToOverviewPanel in the mouse listener causes a slight flickering for me when I return to setups. Moving the returnToOverviewPanel call to after the filtering call within redrawOverviewPanel seems to fix the flickering for me.

dillydill123 commented 7 months ago

Hi, calling redrawOverviewPanel instead of returnToOverviewPanel in the mouse listener causes a slight flickering for me when I return to setups. Moving the returnToOverviewPanel call to after the filtering call within redrawOverviewPanel seems to fix the flickering for me.

So far I've noticed that this kills the saved scrollbar position. I'm testing it to see how we can preserve it so hitting the back arrow doesn't cause it to go to the top

dillydill123 commented 7 months ago

Hi, calling redrawOverviewPanel instead of returnToOverviewPanel in the mouse listener causes a slight flickering for me when I return to setups. Moving the returnToOverviewPanel call to after the filtering call within redrawOverviewPanel seems to fix the flickering for me.

So far I've noticed that this kills the saved scrollbar position. I'm testing it to see how we can preserve it so hitting the back arrow doesn't cause it to go to the top

I've swapped your lines in redrawOverviewPanel. Laying out the setups first must be done otherwise trying to set a long scrollbar position doesn't make sense since no setups are there and the window is very short. Given I can just add this commit after I will do so. Nice work