From f30c158fb3c6fc0df8bb3bb40b8eda9b298bea9b Mon Sep 17 00:00:00 2001 From: bi Date: Mon, 28 May 2018 22:43:31 +0300 Subject: [PATCH] Logging: fixed not showing mod name and msg type in chat --- vmf/scripts/mods/vmf/modules/core/core_functions.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmf/scripts/mods/vmf/modules/core/core_functions.lua b/vmf/scripts/mods/vmf/modules/core/core_functions.lua index 51da0f6..834ce31 100644 --- a/vmf/scripts/mods/vmf/modules/core/core_functions.lua +++ b/vmf/scripts/mods/vmf/modules/core/core_functions.lua @@ -22,7 +22,11 @@ local function safe_format(mod, str, ...) end -local function send_to_chat(message) +local function send_to_chat(self, msg_type, message) + + if msg_type ~= "echo" then + message = string.format("[%s][%s] %s", self:get_name(), string.upper(msg_type), message) + end if Managers.chat and Managers.chat:has_channel(1) then Managers.chat:add_local_system_message(1, message, true) @@ -43,7 +47,7 @@ local function log_message(self, msg_type, message, ...) if message then if _LOGGING_SETTINGS[msg_type].send_to_chat then - send_to_chat(message) + send_to_chat(self, msg_type, message) end if _LOGGING_SETTINGS[msg_type].send_to_log then