Added basic policy backend for modules. Also added confirmation in CLI to call a module. At that confirmation, the relevant policies are shown. Still need to create a module for changing policies and to add more configuration options to existing policies.

This commit is contained in:
Nathan Schneider
2022-02-05 23:49:23 -07:00
parent fc8cd20e7f
commit b92272afa2
4 changed files with 70 additions and 13 deletions

View File

@ -237,7 +237,9 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
pname,
module.name..":\n"..
module.desc.."\n"..
"Proceed?",
modpol.interactions.get_policy_string(
org.name, module.slug, ", ")..
"\n".."Proceed?",
function(input)
if input == "Yes" then
org:call_module(module.slug, pname)
@ -570,10 +572,10 @@ function modpol.interactions.binary_poll_user(user, question, func)
-- set up formspec
local formspec = {
"formspec_version[4]",
"size[8,4]",
"size[8,6]",
"label[0.375,0.5;",minetest.formspec_escape(question), "]",
"button[1,2.5;1,0.8;yes;Yes]",
"button[2,2.5;1,0.8;no;No]",
"button[1,5;1,0.8;yes;Yes]",
"button[2,5;1,0.8;no;No]",
--TODO can we enable text wrapping?
--TODO we could use scroll boxes to contain the text
}