add 'cheat-commands' rule

This commit is contained in:
MihailRis
2024-11-06 18:01:00 +03:00
parent 2e24d60404
commit 5e9b290aea
3 changed files with 37 additions and 5 deletions
+8 -2
View File
@@ -103,6 +103,9 @@ function time.post_runnable(runnable)
table.insert(__post_runnables, runnable)
end
--- Console library extension ---
console.cheats = {}
local log_element = Document.new("core:console").log
function console.log(...)
local args = {...}
@@ -205,9 +208,10 @@ function _rules.listen(name, handler)
end
function _rules.create(name, value, handler)
print(name, value, handler)
_rules.set(name, value)
return _rules.listen(name, handler)
if handler ~= nil then
return _rules.listen(name, handler)
end
end
function _rules.unlisten(name, id)
@@ -218,6 +222,8 @@ end
function _rules.clear()
_rules.rules = {}
_rules.nextid = 1
_rules.create("cheat-commands", true)
end
function __vc_create_hud_rules()