Added modpol.menu() functions modpol and modpol_minetest. Not sure if latter works.
This commit is contained in:
@ -7,6 +7,18 @@ local regchat -- Chat-command registration function
|
||||
|
||||
regchat = minetest.register_chatcommand
|
||||
|
||||
-- ===================================================================
|
||||
-- /menu
|
||||
-- Presents a menu of options to users
|
||||
minetest.register_chatcommand(
|
||||
"menu", {
|
||||
privs = {},
|
||||
func = function(user)
|
||||
local result = modpol.menu(user)
|
||||
return true, result
|
||||
end,
|
||||
})
|
||||
|
||||
-- ===================================================================
|
||||
-- /addorg /add_org
|
||||
-- This code defines a chat command which creates a new
|
||||
|
@ -1,4 +1,17 @@
|
||||
|
||||
-- ===================================================================
|
||||
-- Function: modpol.menu(user)
|
||||
-- Params: user (string)
|
||||
-- Q: Should this return a menu of commands relevant to the specific user?
|
||||
-- Output: Displays a menu of commands to the user
|
||||
-- TKTK currently a manually curated list---needs major improvement
|
||||
modpol.menu = function(user)
|
||||
local output = "Command list:"
|
||||
for key,value in pairs(chat_table) do
|
||||
output = output .. "/" .. key .. "\n"
|
||||
end
|
||||
return output
|
||||
end
|
||||
|
||||
-- ===================================================================
|
||||
-- Function: modpol.binary_poll_user(user, question)
|
||||
@ -41,4 +54,4 @@ modpol.binary_poll_user = function(user, question)
|
||||
else -- if the form is not a recognized name
|
||||
return
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user