aboutsummaryrefslogtreecommitdiff
path: root/doc/menu_lua_api.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/menu_lua_api.txt')
-rw-r--r--doc/menu_lua_api.txt38
1 files changed, 32 insertions, 6 deletions
diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.txt
index 9bc0c46bd..4d495f21e 100644
--- a/doc/menu_lua_api.txt
+++ b/doc/menu_lua_api.txt
@@ -1,4 +1,4 @@
-Minetest Lua Mainmenu API Reference 5.5.0
+Minetest Lua Mainmenu API Reference 5.6.0
=========================================
Introduction
@@ -46,6 +46,8 @@ core.open_url(url)
core.open_dir(path)
^ opens the path in the system file browser/explorer, returns false on failure.
^ Must be an existing directory.
+core.share_file(path)
+^ Android only. Shares file using the share popup
core.get_version() (possible in async calls)
^ returns current core version
@@ -221,13 +223,24 @@ Package - content which is downloadable from the content db, may or may not be i
* returns path to global user data,
the directory that contains user-provided mods, worlds, games, and texture packs.
* core.get_modpath() (possible in async calls)
- * returns path to global modpath, where mods can be installed
+ * returns path to global modpath in the user path, where mods can be installed
* core.get_modpaths() (possible in async calls)
- * returns list of paths to global modpaths, where mods have been installed
-
+ * returns table of virtual path to global modpaths, where mods have been installed
The difference with "core.get_modpath" is that no mods should be installed in these
directories by Minetest -- they might be read-only.
+ Ex:
+
+ ```
+ {
+ mods = "/home/user/.minetest/mods",
+ share = "/usr/share/minetest/mods",
+
+ -- Custom dirs can be specified by the MINETEST_MOD_DIR env variable
+ ["/path/to/custom/dir"] = "/path/to/custom/dir",
+ }
+ ```
+
* core.get_clientmodpath() (possible in async calls)
* returns path to global client-side modpath
* core.get_gamepath() (possible in async calls)
@@ -235,13 +248,14 @@ Package - content which is downloadable from the content db, may or may not be i
* core.get_texturepath() (possible in async calls)
* returns path to default textures
* core.get_game(index)
+ * `name` in return value is deprecated, use `title` instead.
* returns:
{
id = <id>,
path = <full path to game>,
gamemods_path = <path>,
- name = <name of game>,
+ title = <title of game>,
menuicon_path = <full path to menuicon>,
author = "author",
DEPRECATED:
@@ -253,15 +267,27 @@ Package - content which is downloadable from the content db, may or may not be i
* returns
{
- name = "name of content",
+ name = "technical_id",
type = "mod" or "modpack" or "game" or "txp",
+ title = "Human readable title",
description = "description",
author = "author",
path = "path/to/content",
depends = {"mod", "names"}, -- mods only
optional_depends = {"mod", "names"}, -- mods only
}
+* core.check_mod_configuration(world_path, mod_paths)
+ * Checks whether configuration is valid.
+ * `world_path`: path to the world
+ * `mod_paths`: list of enabled mod paths
+ * returns:
+ {
+ is_consistent = true, -- true is consistent, false otherwise
+ unsatisfied_mods = {}, -- list of mod specs
+ satisfied_mods = {}, -- list of mod specs
+ error_message = "", -- message or nil
+ }
Logging
-------