move 'key:escape' handler to Lua

This commit is contained in:
MihailRis
2025-01-16 23:11:00 +03:00
parent 2adfbdb192
commit a45487b3c7
2 changed files with 9 additions and 11 deletions
+9
View File
@@ -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"