aboutsummaryrefslogtreecommitdiff
path: root/assets/lyx_img/route_ex1.png
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-07-19 22:57:29 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-07-19 22:57:29 +0200
commit7de2a9142f0b27f2b03235a6a47d9e2f02245852 (patch)
treed921fa94887d8fac215b929c912940a92f7dbf8e /assets/lyx_img/route_ex1.png
parent3040c53413a5ddb7e0e84f02f85de7868510c889 (diff)
parent19509acf56aef4b6e5f45023ee5603e95822fe69 (diff)
downloadadvtrains-7de2a9142f0b27f2b03235a6a47d9e2f02245852.tar.gz
advtrains-7de2a9142f0b27f2b03235a6a47d9e2f02245852.tar.bz2
advtrains-7de2a9142f0b27f2b03235a6a47d9e2f02245852.zip
Merge branch 'master' of bananach.space:advtrains
Diffstat (limited to 'assets/lyx_img/route_ex1.png')
0 files changed, 0 insertions, 0 deletions
pt">= core.get_current_modname() or "??" core.registered_chatcommands[cmd] = def end function core.unregister_chatcommand(name) if core.registered_chatcommands[name] then core.registered_chatcommands[name] = nil else core.log("warning", "Not unregistering chatcommand " ..name.. " because it doesn't exist.") end end function core.override_chatcommand(name, redefinition) local chatcommand = core.registered_chatcommands[name] assert(chatcommand, "Attempt to override non-existent chatcommand "..name) for k, v in pairs(redefinition) do rawset(chatcommand, k, v) end core.registered_chatcommands[name] = chatcommand end local cmd_marker = "/" local function gettext(...) return ... end local function gettext_replace(text, replace) return text:gsub("$1", replace) end if INIT == "client" then cmd_marker = "." gettext = core.gettext gettext_replace = fgettext_ne end local function do_help_cmd(name, param) local function format_help_line(cmd, def) local msg = core.colorize("#00ffff", cmd_marker .. cmd) if def.params and def.params ~= "" then msg = msg .. " " .. def.params end if def.description and def.description ~= "" then msg = msg .. ": " .. def.description end return msg end if param == "" then local cmds = {} for cmd, def in pairs(core.registered_chatcommands) do if INIT == "client" or core.check_player_privs(name, def.privs) then cmds[#cmds + 1] = cmd end end table.sort(cmds) return true, gettext("Available commands: ") .. table.concat(cmds, " ") .. "\n" .. gettext_replace("Use '$1help <cmd>' to get more information," .. " or '$1help all' to list everything.", cmd_marker) elseif param == "all" then local cmds = {} for cmd, def in pairs(core.registered_chatcommands) do if INIT == "client" or core.check_player_privs(name, def.privs) then cmds[#cmds + 1] = format_help_line(cmd, def) end 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