Very rough Inventory Menu prototype#355
Draft
dyc3 wants to merge 5 commits into
Draft
Conversation
…ndle those in a new system
Member
|
I still believe it should be possible to implement menus from userspace without using raw packets. If users have the ability to reliably undo inventory actions (which they should), then it follows that menus are doable. We should then move this menu plugin to a separate crate ( Regarding refactoring,
|
rj00a
pushed a commit
that referenced
this pull request
Jun 7, 2023
## Description This moves the `held_item_slot` field in `ClientInventoryState` to a new component: `HeldItem` related: pr #355
Merged
dyc3
added a commit
that referenced
this pull request
Oct 11, 2024
# Objective - ability to make inventories read only (player should be able to click things in the inventory and still emit a click event, this can be useful for creating inventory menus. - closes #427 - related #307 #355 # Solution - adds a public ``readonly: bool`` field to the ``Inventory`` component, that will make any interactions with this item impossible (includes: moving, shift moving, hotbar moving, dropping) if a player inventory is readonly, then the player will also not be able to drop items (even when not in the inventory), so the drop event will not be emitted (this could be changed if requested) - when implementing this i discovered a bug where a player is not able to put a item from a open inventory in the offhand (by hitting F) that will cause a desync. On the client the item will be in the offhand, but if you try to interact with that it dissapears. (unrelated to this PR and will not be fixed in this PR) --------- Co-authored-by: Carson McManus <dyc3@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
related: #307
This PR makes it possible to do inventory menus. I don't particularly like the approach so far, and it doesn't quite cover all the use cases. I think I'll need to do some refactoring of how inventories work before continuing work on this.
Playground