add hud.hand_controller

This commit is contained in:
MihailRis 2025-07-27 22:30:30 +03:00
parent 93c922be99
commit ecf3b94d53
3 changed files with 12 additions and 2 deletions

View File

@ -65,4 +65,7 @@ hud.is_inventory_open() -> bool
-- Sets whether to allow pausing. If false, the pause menu will not pause the game.
hud.set_allow_pause(flag: bool)
-- Function that controls the named skeleton 'hand' (see gfx.skeletons)
hud.hand_controller: function()
```

View File

@ -68,4 +68,7 @@ hud.is_inventory_open() -> bool
-- Устанавливает разрешение на паузу. При значении false меню паузы не приостанавливает игру.
hud.set_allow_pause(flag: bool)
-- Функция, управляющая именованным скелетом 'hand' (см. gfx.skeletons)
hud.hand_controller: function()
```

View File

@ -83,7 +83,7 @@ function on_hud_open()
configure_SSAO()
end
function update_hand()
local function update_hand()
local skeleton = gfx.skeletons
local pid = hud.get_player()
local invid, slot = player.get_inventory(pid)
@ -117,5 +117,9 @@ function update_hand()
end
function on_hud_render()
timeit(1, update_hand)
if hud.hand_controller then
hud.hand_controller()
else
update_hand()
end
end