mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-29 07:21:54 +00:00
Updated colouring scheme of debug module
* colours now also used in console (check non-legacymod servers whether this works correctly) * slightly different colouring scheme for console to increase readibility
This commit is contained in:
parent
f3eab54330
commit
164e1a4569
1 changed files with 13 additions and 5 deletions
|
@ -17,7 +17,7 @@
|
|||
|
||||
local settings = require (wolfa_getLuaPath()..".util.settings")
|
||||
|
||||
local SEVERITY_LEVELS = {
|
||||
local COLOURS_CHAT = {
|
||||
[1] = "^_", -- termination
|
||||
[2] = "^1", -- error
|
||||
[3] = "^8", -- warning
|
||||
|
@ -25,17 +25,25 @@ local SEVERITY_LEVELS = {
|
|||
[5] = "^7", -- information
|
||||
}
|
||||
|
||||
local COLOURS_CONSOLE = {
|
||||
[1] = "^_", -- termination
|
||||
[2] = "^1", -- error
|
||||
[3] = "^3", -- warning
|
||||
[4] = "^2", -- success
|
||||
[5] = "^7", -- information
|
||||
}
|
||||
|
||||
local neededSeverity = 5
|
||||
|
||||
function outputDebug(msg, severity)
|
||||
local severity = severity or 5
|
||||
|
||||
if severity <= neededSeverity then
|
||||
et.G_Print("[WolfAdmin] "..msg.."\n")
|
||||
et.G_Print("[WolfAdmin] "..COLOURS_CONSOLE[severity]..msg.."\n")
|
||||
|
||||
for playerId = 0, et.trap_Cvar_Get("sv_maxclients") - 1 do
|
||||
if settings.get("g_debugWolfAdmin") ~= 0 then
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..playerId.." \"^:[WolfAdmin DEBUG] "..SEVERITY_LEVELS[severity]..msg.."\";")
|
||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..playerId.." \"^:[WolfAdmin DEBUG] "..COLOURS_CHAT[severity]..msg.."\";")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue