1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add /help formspec for commands and privileges (#8385)

* Trigger for 'all' as well
* Add description textarea, double-click to copy
This commit is contained in:
SmallJoker 2019-07-20 18:22:32 +02:00 committed by GitHub
parent 9e00584730
commit 69bf964241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 146 additions and 7 deletions

View file

@ -77,13 +77,6 @@ local function do_help_cmd(name, param)
end
table.sort(cmds)
return true, gettext("Available commands:").."\n"..table.concat(cmds, "\n")
elseif INIT == "game" and param == "privs" then
local privs = {}
for priv, def in pairs(core.registered_privileges) do
privs[#privs + 1] = priv .. ": " .. def.description
end
table.sort(privs)
return true, "Available privileges:\n"..table.concat(privs, "\n")
else
local cmd = param
local def = core.registered_chatcommands[cmd]