Change colors for /r output (#759)
* Change stats color when type /r Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
parent
6fc6c8e871
commit
b49909fc50
1 changed files with 17 additions and 9 deletions
|
@ -31,8 +31,9 @@ local function return_as_chat_result(to, target)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Build return string
|
-- Build return string
|
||||||
local result = (to == name and "You are in " or name .. " is in ") ..
|
local result = minetest.colorize("#63d437", (to == name and "You are in " or name .. " is in ")) ..
|
||||||
place .. " place.\n"
|
minetest.colorize("#ffea00", place ..
|
||||||
|
minetest.colorize("#63d437", " place.\n"))
|
||||||
|
|
||||||
if stat then
|
if stat then
|
||||||
local kd = stat.kills
|
local kd = stat.kills
|
||||||
|
@ -40,13 +41,20 @@ local function return_as_chat_result(to, target)
|
||||||
kd = kd / stat.deaths
|
kd = kd / stat.deaths
|
||||||
end
|
end
|
||||||
result = result ..
|
result = result ..
|
||||||
"Kills: " .. stat.kills ..
|
minetest.colorize("#63d437", "Kills: ") ..
|
||||||
" | Deaths: " .. stat.deaths ..
|
minetest.colorize("#ffea00", stat.kills ..
|
||||||
" | K/D: " .. math.floor(kd * 10) / 10 ..
|
minetest.colorize("#63d437", " | Deaths: ")) ..
|
||||||
"\nBounty kills: " .. stat.bounty_kills ..
|
minetest.colorize("#ffea00", stat.deaths ..
|
||||||
" | Captures: " .. stat.captures ..
|
minetest.colorize("#63d437", " | K/D: ")) ..
|
||||||
" | Attempts: " .. stat.attempts ..
|
minetest.colorize("#ffea00", math.floor(kd * 10) / 10 ..
|
||||||
"\nScore: " .. math.floor(stat.score)
|
minetest.colorize("#63d437", "\nBounty kills: ")) ..
|
||||||
|
minetest.colorize("#ffea00", stat.bounty_kills ..
|
||||||
|
minetest.colorize("#63d437", " | Captures: ") ..
|
||||||
|
minetest.colorize("#ffea00", stat.captures ..
|
||||||
|
minetest.colorize("#63d437", " | Attempts: ")) ..
|
||||||
|
minetest.colorize("#ffea00", stat.attempts ..
|
||||||
|
minetest.colorize("#63d437", "\nScore: ")) ..
|
||||||
|
minetest.colorize("#ffea00", math.floor(stat.score)))
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue