add 'core:chat' event

This commit is contained in:
MihailRis 2025-01-18 05:06:22 +03:00
parent 88ed15c6d8
commit b0a8e8e001
2 changed files with 6 additions and 1 deletions

View File

@ -260,7 +260,7 @@ console.add_command(
"chat text:str",
"Send chat message",
function (args, kwargs)
console.log("[you] "..args[1])
console.chat("[you] "..args[1])
end
)

View File

@ -225,6 +225,11 @@ function console.log(...)
log_element:paste(text)
end
function console.chat(...)
console.log(...)
events.emit("core:chat", ...)
end
function gui.template(name, params)
local text = file.read(file.find("layouts/templates/"..name..".xml"))
for k,v in pairs(params) do