mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
move 'key:escape' handler to Lua
This commit is contained in:
parent
2adfbdb192
commit
a45487b3c7
2 changed files with 9 additions and 11 deletions
|
|
@ -385,6 +385,15 @@ function __vc_on_hud_open()
|
|||
hud.show_overlay("core:console", false, {"chat"})
|
||||
end)
|
||||
end)
|
||||
input.add_callback("key:escape", function()
|
||||
if hud.is_paused() then
|
||||
hud.resume()
|
||||
elseif hud.is_inventory_open() then
|
||||
hud.close_inventory()
|
||||
else
|
||||
hud.pause()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local RULES_FILE = "world:rules.toml"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue