Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bank improvements #1873

Merged
merged 18 commits into from
Jan 31, 2025
Merged

Bank improvements #1873

merged 18 commits into from
Jan 31, 2025

Conversation

Zoinkwiz
Copy link
Owner

@Zoinkwiz Zoinkwiz commented Nov 27, 2024

This PR allows for the potion storage to be considered for requirements, as well as for the bank filtering for removing/adding potions from it. The bank work is based on the way the core Bank Tags plugin has done it for Layouts.

In tandem based on this, this also moves the Quest Helper filter for the bank from moving real bank items around to instead just making items into the items we're interested in, now that it's an allowed method due to implementation in the core client. This generally means quite a lot less processing per bank event.

Widgets which are still made (section headers and dividers, numbers for quantities needed) will now be trimmed off the size of the bank. From across my accounts the max element in BANK_ITEM_CONTAINER is always 1248, BUT this is a bit sketchy as it's possible that 1. this might change, making quest helper cut stuff off improperly, or 2. It's already wrong for some people (maybe more possible with more bank extension things?). Maybe looking at capturing the size on load before doing anything may be a better play here to ensure it's correct in more scenarios.

  • I've updated this now to be dynamic based on initial load.

Finally, to help further with performance, I've removed the non-bank items from being part of quest filtered bank.

Across these changes I'm seeing a massive performance improvement when adding/removing items, so hopefully this is a good step in the right direction, in addition to it being good to support a new container.

Note: The quest bank can wiggle a little bit when removing items, hopefully not a big change needed to fix this but would be good to before releasing.

@Zoinkwiz
Copy link
Owner Author

Main thing is I need to work out the best way to handle the scrolling when at the bottom of a section, as it always seems to jump up a bit.

Copy link
Collaborator

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small documentation/naming things, I have not tested this in-game (I don't have potion storage 😢 )

This now only considers 1. The script running to update the UI of the potion storage, and 2. The vial quantity changing. This hopefully should catch all scenarios for knowing to change the known state.
Items are removed first from the bank then potion storage, so worth having both shown in total quantity.
This was fairly redundant to do with the new way of simply replacing widgets rather than finding matching widgets, and messed with the scrollbar.
@Zoinkwiz Zoinkwiz merged commit bafec37 into master Jan 31, 2025
2 checks passed
@Zoinkwiz Zoinkwiz deleted the bank-improvements branch January 31, 2025 09:45
PsycloneTM pushed a commit to PsycloneTM/quest-helper that referenced this pull request Feb 3, 2025
* feat: Added Potion Storage as container

* feat: Filter non helper items on bank filter

* feat: Potion Storage works with sidebar

* feat: Potion storage works for bank

Also adds performance improvements by making all items rather than finding items in the bank, like the core tags Layouts now do.

Additionally, only renders the quest items and not the entire bank to further speed things up.

* fix: Added more dynamic bank trimming

* fix: Add null check for quest bank trimming

* fix: Remove duplicate code in QuestHelperBankTagService

* fix: Use right bank item name and details

* fix: Apply item finding to all items for bank

* feat: Added vial support for potion storage

* fix: Set Interface to null on potionStorage unregistering

* feat: Update potion storage caching

This now only considers 1. The script running to update the UI of the potion storage, and 2. The vial quantity changing. This hopefully should catch all scenarios for knowing to change the known state.

* fix: Ensure potion storage properly closed when entering quest bank tab

* fix: Count both bank and potion storage for quest tab

Items are removed first from the bank then potion storage, so worth having both shown in total quantity.

* fix: checkWithBank -> checkWithAllContainers

* fix: Removed redundant function for item check

* Updated copyright on PotionStorage

* feat: Remove item filtering for quest bank tab

This was fairly redundant to do with the new way of simply replacing widgets rather than finding matching widgets, and messed with the scrollbar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants