Changed Minetest module listing to remove slugs, retain only names
This commit is contained in:
		
										
											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 |    if org.modules then | ||||||
|       for k,v in pairs(org.modules) do |       for k,v in pairs(org.modules) do | ||||||
|          if not v.hide then -- hide utility modules |          if not v.hide then -- hide utility modules | ||||||
|             local module_entry = v.name.. |             local module_entry = v.name | ||||||
|                " ["..v.slug.."]" |  | ||||||
|             table.insert(modules, module_entry) |             table.insert(modules, module_entry) | ||||||
|          end |          end | ||||||
|       end |       end | ||||||
| @@ -204,18 +203,23 @@ minetest.register_on_player_receive_fields(function (player, formname, fields) | |||||||
|          -- Receiving modules |          -- Receiving modules | ||||||
|          elseif fields.modules |          elseif fields.modules | ||||||
|             and fields.modules ~= "View..." then |             and fields.modules ~= "View..." then | ||||||
|             local module = string.match( |             local module = nil | ||||||
|                fields.modules,"%[(.*)%]") |             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( |                modpol.interactions.binary_poll_user( | ||||||
|                   pname, |                   pname, | ||||||
|                modpol.modules[module].name..":\n".. |                   module.name..":\n".. | ||||||
|                modpol.modules[module].desc.."\n".. |                   module.desc.."\n".. | ||||||
|                   "Proceed?", |                   "Proceed?", | ||||||
|                   function(input) |                   function(input) | ||||||
|                      if input == "Yes" then |                      if input == "Yes" then | ||||||
|                      org:call_module(module, pname) |                         org:call_module(module.slug, pname) | ||||||
|                      end |                      end | ||||||
|                end) |                end) | ||||||
|  |             end | ||||||
|              |              | ||||||
|          -- Receiving pending |          -- Receiving pending | ||||||
|          elseif fields.pending |          elseif fields.pending | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user