mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-22 02:19:44 +00:00
make hotbar size and layout configurable
Add hotbar-size, hotbar-layout and inventory-layout to config/defaults.toml, player.get_hotbar_size / player.set_hotbar_size and hud.is_hotbar_visible / hud.set_hotbar_visible.
This commit is contained in:
parent
2e2233a489
commit
aa670f3c9d
16 changed files with 188 additions and 20 deletions
|
|
@ -142,7 +142,14 @@ Switches the player's camera. See [cameras](libcameras.md).
|
|||
player.set_selected_slot(playerid: int, slotid: int)
|
||||
```
|
||||
|
||||
Sets the selected slot index
|
||||
Sets the selected slot index. The index wraps around the hotbar size.
|
||||
|
||||
```lua
|
||||
player.get_hotbar_size(playerid: int) -> int
|
||||
player.set_hotbar_size(playerid: int, size: int)
|
||||
```
|
||||
|
||||
Hotbar size getter and setter: the number of first inventory slots selected with the mouse wheel and number keys. Default value is `hotbar-size` from `config/defaults.toml` (10). The value is not saved with the world.
|
||||
|
||||
```lua
|
||||
player.get_selected_block(playerid: int) -> x,y,z
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue