A minetest mod for mapmaking
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.4KB

  1. -- The path to this mod, for including files
  2. local modpath = minetest.get_modpath("cartographer");
  3. local settings = {
  4. default_size = tonumber(minetest.settings:get("default_size")) or 40,
  5. autofill_freq = tonumber(minetest.settings:get("autofill_freq")) or 5,
  6. autosave_freq = tonumber(minetest.settings:get("autosave_freq")) or 60,
  7. backup_scan_freq = tonumber(minetest.settings:get("backup_scan_freq")) or 5,
  8. backup_scan_count = tonumber(minetest.settings:get("backup_scan_count")) or 20,
  9. };
  10. -- Includes
  11. local map_data = loadfile(modpath .. "/storage.lua") (settings);
  12. local chunk = loadfile(modpath .. "/chunk_api.lua") ();
  13. local gui = loadfile(modpath .. "/formspec.lua") ();
  14. local skin = loadfile(modpath .. "/skin_api.lua") ();
  15. local util = loadfile(modpath .. "/util.lua") ();
  16. local audio = loadfile(modpath .. "/audio.lua") ();
  17. local biomes = loadfile(modpath .. "/biome_api.lua") (util);
  18. local markers = loadfile(modpath .. "/marker_api.lua") ();
  19. local scanner = loadfile(modpath .. "/scanner.lua") (map_data, chunk, settings);
  20. local maps = loadfile(modpath .. "/map_api.lua") (map_data, chunk);
  21. local materials = loadfile(modpath .. "/material_api.lua") ();
  22. local map_formspec = loadfile(modpath .. "/map_formspec.lua") (map_data, gui, skin, util, biomes, markers);
  23. local map_item = loadfile(modpath .. "/items.lua") (chunk, gui, skin, audio, maps, markers, map_formspec, settings);
  24. loadfile(modpath .. "/commands.lua") (chunk, audio, map_formspec, settings);
  25. loadfile(modpath .. "/table.lua") (gui, skin, audio, maps, materials, map_item, settings);
  26. loadfile(modpath .. "/autofill.lua") (chunk, scanner, maps, settings);
  27. -- The API object
  28. cartographer = {
  29. -- skin_api.lua: Allows the visual customization of formspecs
  30. skin = skin,
  31. -- biome_api.lua: Allows biome data to be registered for display in maps
  32. biomes = biomes,
  33. -- marker_api.lua: Allows markers to be registered for placement on maps
  34. markers = markers,
  35. -- map_api.lua: Allows the creation, lookup, and management of map objects
  36. maps = maps,
  37. -- items.lua: Allows the creation of map items with proper metadata
  38. map_item = map_item,
  39. -- materials.lua: Allows items to be registered as mapmaking materials
  40. materials = materials,
  41. -- scanner.lua: Exposes functions for queuing and performing terrain scans
  42. scanner = scanner,
  43. };
  44. minetest.log("action", "[cartographer] loaded.")