Added display of custom item sources in InventoryHud #4747
+227
−32
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.
Type of change
Description
Added ability to display items not only from inventory or container in hand, but also from custom sources in InventoryHud. Added incomplete support for inventories of arbitrary size (Texture and Outline backgrounds cannot be used for inventories with size other than 9x3).
To add a new source, you have to add code to enum SupportedSources to handle it.
As an example, the functionality was implemented for the Nametags module. When selecting the source Nametags, items in the rendering distance are displayed as a table, the size of which can be customized. The
getItems()
function was added, and a filter was also added to filter out items such as mushrooms, which are often a false indication of player activity.Related issues
Mention any issues that this pr relates to.
How Has This Been Tested?
Checklist: