Skip to content

Show loading overlay on inventory slots until their contents arrive - #3555

Open
yel0h wants to merge 2 commits into
PixelGuys:masterfrom
yel0h:chests-look-empty
Open

Show loading overlay on inventory slots until their contents arrive#3555
yel0h wants to merge 2 commits into
PixelGuys:masterfrom
yel0h:chests-look-empty

Conversation

@yel0h

@yel0h yel0h commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

The server now also sends the number of items to expect, and the client counts them down as they arrive. Slots for an inventory that isn't loaded yet render with a dark overlay. All .serverShared inventories are tracked.

image

Fixes #2700

@Wunka Wunka moved this to High Priority in PRs to review Aug 25, 2026
@Wunka
Wunka self-requested a review August 25, 2026 15:15
Comment thread src/Inventory.zig Outdated
Comment on lines +90 to +91
if (count == 0) {
_ = loadingInventories.remove(clientId);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should never happen right?
(the remove not the == 0, so I would either do an assert that nothing was removed or just do an early return

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well if the client receives that the inventory is empty, I immediately remove it from the inventories being loaded since there's nothing to wait for

@IntegratedQuantum

Copy link
Copy Markdown
Member

I think the best solution is to make chest opening server initiated.
Then opening the GUI and receiving its contents happens at once, and there is no gap in the timeline.

@IntegratedQuantum IntegratedQuantum moved this from High Priority to In review in PRs to review Aug 26, 2026
@yel0h

yel0h commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Ok, I added a chestOpen protocol; now the client sends a request and opens the GUI once a response is received

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

No way to know whether a chest is empty or just hasn't finished loading

3 participants