mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Add hotbar Lua HUD element and replace hardcoded hotbar
This commit is contained in:
parent
efd7792add
commit
52376fd87a
11 changed files with 165 additions and 31 deletions
|
@ -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,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue