Changed Minetest module listing to remove slugs, retain only names
This commit is contained in:
parent
b9317490fb
commit
645cc6f690
Binary file not shown.
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 114 KiB |
@ -134,8 +134,7 @@ function modpol.interactions.org_dashboard(user, org_string)
|
||||
if org.modules then
|
||||
for k,v in pairs(org.modules) do
|
||||
if not v.hide then -- hide utility modules
|
||||
local module_entry = v.name..
|
||||
" ["..v.slug.."]"
|
||||
local module_entry = v.name
|
||||
table.insert(modules, module_entry)
|
||||
end
|
||||
end
|
||||
@ -204,18 +203,23 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
-- Receiving modules
|
||||
elseif fields.modules
|
||||
and fields.modules ~= "View..." then
|
||||
local module = string.match(
|
||||
fields.modules,"%[(.*)%]")
|
||||
modpol.interactions.binary_poll_user(
|
||||
pname,
|
||||
modpol.modules[module].name..":\n"..
|
||||
modpol.modules[module].desc.."\n"..
|
||||
"Proceed?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
org:call_module(module, pname)
|
||||
end
|
||||
end)
|
||||
local module = nil
|
||||
for k,v in pairs(org.modules) do
|
||||
if fields.modules == v.name then
|
||||
module = v
|
||||
end end
|
||||
if module then
|
||||
modpol.interactions.binary_poll_user(
|
||||
pname,
|
||||
module.name..":\n"..
|
||||
module.desc.."\n"..
|
||||
"Proceed?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
org:call_module(module.slug, pname)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- Receiving pending
|
||||
elseif fields.pending
|
||||
|
Loading…
x
Reference in New Issue
Block a user