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:
parent
9e00584730
commit
69bf964241
3 changed files with 146 additions and 7 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue