Add hud element hotbar partitioning #15924
Open
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.
hotbar_sourceit uses.hud_hotbar_max_widthsetting.I decided to use the
world_posparameter of the HUD element def, since it consists of three numbers, which is exactly what we need, a hotbar doesn't relate to a world position anyway, and the other possible fields (number,item,scale) can be used for something else in the future, e.g. if we add multiple hotbar sources for different purposes, e.g. a second hotbar which is only active/changes the selected item when you hold/press a specific key. Ifworld_posis too confusing, an aliasinventory_poswhich just overlaps withworld_poscould be added.However, feel free to complain if you would like it to work differently.
Screenshot (click me)
To do
Ready for Review.
How to test
/hudhotbarsthree times and notice that the hotbars behave like specified in lua_api.mdhud_hotbar_max_widthsetting still works as expected.