Colorize command references in chat output

This commit is contained in:
sfan5
2024-04-20 14:21:28 +02:00
parent 602f175cc0
commit 41d53180b1
7 changed files with 24 additions and 20 deletions

View File

@ -296,9 +296,9 @@ worldedit.register_command("about", {
description = S("Get information about the WorldEdit mod"),
func = function(name)
worldedit.player_notify(name, S("WorldEdit @1"..
" is available on this server. Type //help to get a list of "..
"commands, or get more information at @2",
worldedit.version_string,
" is available on this server. Type @2 to get a list of "..
"commands, or find more information at @3",
worldedit.version_string, minetest.colorize("#00ffff", "//help"),
"https://github.com/Uberi/Minetest-WorldEdit"
))
end,
@ -335,9 +335,11 @@ worldedit.register_command("help", {
end
end
table.sort(cmds)
local help = minetest.colorize("#00ffff", "//help")
return true, S("Available commands: @1@n"
.. "Use '//help <cmd>' to get more information,"
.. " or '//help all' to list everything.", table.concat(cmds, " "))
.. "Use '@2' to get more information,"
.. " or '@3' to list everything.",
table.concat(cmds, " "), help .. " <cmd>", help .. " all")
elseif param == "all" then
local cmds = {}
for cmd, def in pairs(worldedit.registered_commands) do