Add /s chat-command alias for /summary
This commit is contained in:
parent
4a1764983e
commit
ffdb5dd799
1 changed files with 16 additions and 8 deletions
|
@ -51,20 +51,28 @@ local function return_as_chat_result(to, target)
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function summary_func(name)
|
||||||
|
local fs = ctf_stats.get_formspec_match_summary(ctf_stats.current,
|
||||||
|
ctf_stats.winner_team, ctf_stats.winner_player, os.time() - ctf_stats.start)
|
||||||
|
|
||||||
|
fs = fs .. "button[6,7.5;4,1;b_prev;<< Previous match]"
|
||||||
|
|
||||||
|
minetest.log("action", name .. " requested match summary formspec")
|
||||||
|
minetest.show_formspec(name, "ctf_stats:match_summary", fs)
|
||||||
|
end
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
-- Chat-commands --
|
-- Chat-commands --
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
minetest.register_chatcommand("summary", {
|
minetest.register_chatcommand("summary", {
|
||||||
func = function(name)
|
description = "Display the match summary",
|
||||||
local fs = ctf_stats.get_formspec_match_summary(ctf_stats.current,
|
func = summary_func
|
||||||
ctf_stats.winner_team, ctf_stats.winner_player, os.time() - ctf_stats.start)
|
})
|
||||||
|
|
||||||
fs = fs .. "button[6,7.5;4,1;b_prev;<< Previous match]"
|
minetest.register_chatcommand("s", {
|
||||||
|
description = "Display the match summary",
|
||||||
minetest.log("action", name .. " requested match summary formspec")
|
func = summary_func
|
||||||
minetest.show_formspec(name, "ctf_stats:match_summary", fs)
|
|
||||||
end
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("r", {
|
minetest.register_chatcommand("r", {
|
||||||
|
|
Loading…
Reference in a new issue