webaverse / app

Web metaverse client
https://app.webaverse.com
MIT License
338 stars 211 forks source link

Lazy load inventory #3686

Closed NPatel10 closed 1 year ago

NPatel10 commented 1 year ago

Describe your changes

In this PR Below changes are added

  1. Inventory, Season, Land and Account panels will load lazily. Background of these panels will load at the start but the items of these panels will only load upon opening those panels. Reason for this is to keep the opening animation of these panels. Caching mechanism was already there and no changes have been done to it.
  2. [Optional] Currently all the items in the inventory, Season and Account panels are being load simultaneously so in the second commit this behavior has been changed. Now only predefined number of items will load at the same time and rest will wait in the queue for previous ones to complete their loading process.

Further Improvements

  1. Currently upon receiving SpriteSheet an interval starts to render those sprite into the canvas. When the amount of items increases these intervals keeps adding up and disturbs the main rendering because they are not in sync. Maybe a system can be develop keep all these canvases and render them on certain tick.
  2. Character Selection and Character Panel also has same behavior of loading at the start so it can be altered.
  3. Inventory does not has scrolling currently.

What are the steps for a QA tester to test this pull request?

  1. Open the scene https://local.webaverse.com/
  2. Press Tab and load the inventory. Inventory will start to load. previously it will be loaded from start.
  3. Press Tab to close the inventory.
  4. Press Tab again to open inventory and check that items are already loaded from cache and do not load second time.
  5. If there are more then 5 items in the inventory then first 5 will load first then next 5 then another 5 and so on.

Issue ticket number and link

N/A

Screenshots and/or video

Checklist before requesting a review