1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-16 18:05:22 +02:00

Add hotbar Lua HUD element and replace hardcoded hotbar

This commit is contained in:
cx384
2024-01-29 16:43:37 +01:00
parent efd7792add
commit 52376fd87a
11 changed files with 165 additions and 31 deletions

View File

@@ -259,3 +259,18 @@ register_builtin_hud_element("minimap", {
core.get_player_information(player:get_player_name()).protocol_version >= 44
end,
})
--- Hotbar
register_builtin_hud_element("hotbar", {
elem_def = {
type = "hotbar",
position = {x = 0.5, y = 1},
direction = 0,
alignment = {x = 0, y = -1},
offset = {x = 0, y = -4}, -- Extra padding below.
},
show_elem = function(player, flags)
return flags.hotbar
end,
})