move 'devtools:console' binding handler to __vc_on_hud_open

This commit is contained in:
MihailRis
2024-11-20 12:15:09 +03:00
parent e842b217da
commit f4f479d389
4 changed files with 10 additions and 11 deletions
+9 -1
View File
@@ -269,7 +269,7 @@ function _rules.clear()
_rules.create("allow-cheats", true)
end
function __vc_create_hud_rules()
function __vc_on_hud_open()
_rules.create("allow-content-access", hud._is_content_access(), function(value)
hud._set_content_access(value)
input.set_enabled("player.pick", value)
@@ -295,6 +295,14 @@ function __vc_create_hud_rules()
_rules.create("allow-debug-cheats", true, function(value)
hud._set_debug_cheats(value)
end)
input.add_callback("devtools.console", function()
if hud.is_paused() then
return
end
time.post_runnable(function()
hud.show_overlay("core:console", false, {"console"})
end)
end)
end
local RULES_FILE = "world:rules.toml"