Skip to content

Conversation

@cx384
Copy link
Member

@cx384 cx384 commented Mar 20, 2025

  • Add a feature to the hotbar HUD element, to specify which parts of the hotbar_source it uses.
  • With this you can split your hotbar into multiple parts and display them, e.g. in two columns. So it is more flexible than using the hud_hotbar_max_width setting.
  • Successor of Replace hotbar_itemcount by hotbar_source #15905

I decided to use the world_pos parameter 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. If world_pos is too confusing, an alias inventory_pos which just overlaps with world_pos could be added.
However, feel free to complain if you would like it to work differently.

Screenshot (click me)

hotbars

To do

Ready for Review.

How to test

  • Read the lua_api.md changes regarding the hotbar element
  • Start devtest
  • Execute /hudhotbars three times and notice that the hotbars behave like specified in lua_api.md
  • Change your window size and test if the hud_hotbar_max_width setting still works as expected.

@cx384 cx384 added @ Script API Feature ✨ PRs that add or enhance a feature UI/UX Waiting (on dependency) Waiting on another PR or external circumstances (not for rebases/changes requested) labels Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature ✨ PRs that add or enhance a feature @ Script API UI/UX Waiting (on dependency) Waiting on another PR or external circumstances (not for rebases/changes requested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant