cartographer/init.lua

47 lines
2.3 KiB
Lua
Raw Normal View History

-- The path to this mod, for including files
local modpath = minetest.get_modpath("cartographer");
2020-06-13 22:21:34 +02:00
local settings = {
default_size = tonumber(minetest.settings:get("default_size")) or 40,
autofill_freq = tonumber(minetest.settings:get("autofill_freq")) or 5,
autosave_freq = tonumber(minetest.settings:get("autosave_freq")) or 60,
backup_scan_freq = tonumber(minetest.settings:get("backup_scan_freq")) or 5,
2020-06-13 22:50:34 +02:00
backup_scan_count = tonumber(minetest.settings:get("backup_scan_count")) or 20,
2020-06-13 22:21:34 +02:00
};
2020-02-16 18:55:07 +01:00
-- Includes
2020-06-13 22:21:34 +02:00
local map_data = loadfile(modpath .. "/storage.lua") (settings);
local chunk = loadfile(modpath .. "/chunk_api.lua") ();
local gui = loadfile(modpath .. "/formspec.lua") ();
2020-06-13 14:50:36 +02:00
local skin = loadfile(modpath .. "/skin_api.lua") ();
local util = loadfile(modpath .. "/util.lua") ();
2020-06-13 14:50:36 +02:00
local audio = loadfile(modpath .. "/audio.lua") ();
local biomes = loadfile(modpath .. "/biome_api.lua") (util);
2020-06-13 14:50:36 +02:00
local markers = loadfile(modpath .. "/marker_api.lua") ();
2020-06-13 22:21:34 +02:00
local scanner = loadfile(modpath .. "/scanner.lua") (map_data, chunk, settings);
2020-06-11 02:54:00 +02:00
local maps = loadfile(modpath .. "/map_api.lua") (map_data, chunk);
local materials = loadfile(modpath .. "/material_api.lua") ();
local map_formspec = loadfile(modpath .. "/map_formspec.lua") (map_data, gui, skin, util, biomes, markers);
2020-06-13 22:21:34 +02:00
local map_item = loadfile(modpath .. "/items.lua") (chunk, gui, skin, audio, maps, markers, map_formspec, settings);
loadfile(modpath .. "/commands.lua") (chunk, audio, map_formspec, settings);
loadfile(modpath .. "/table.lua") (gui, skin, audio, maps, materials, map_item, settings);
loadfile(modpath .. "/autofill.lua") (chunk, scanner, maps, settings);
2020-06-11 02:10:15 +02:00
-- The API object
cartographer = {
-- skin_api.lua: Allows the visual customization of formspecs
2020-06-13 22:21:34 +02:00
skin = skin,
-- biome_api.lua: Allows biome data to be registered for display in maps
2020-06-13 22:21:34 +02:00
biomes = biomes,
-- marker_api.lua: Allows markers to be registered for placement on maps
2020-06-13 22:21:34 +02:00
markers = markers,
-- map_api.lua: Allows the creation, lookup, and management of map objects
2020-06-13 22:21:34 +02:00
maps = maps,
-- items.lua: Allows the creation of map items with proper metadata
2020-06-13 22:21:34 +02:00
map_item = map_item,
-- materials.lua: Allows items to be registered as mapmaking materials
2020-06-13 22:21:34 +02:00
materials = materials,
-- scanner.lua: Exposes functions for queuing and performing terrain scans
scanner = scanner,
2020-06-11 02:10:15 +02:00
};