summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAndrew Ward <rw@rubenwardy.com>2018-03-28 22:14:16 +0100
committerGitHub <noreply@github.com>2018-03-28 22:14:16 +0100
commit71b2570f0919d3bb5575c9ec694ecd004222fcea (patch)
treef3f85d185dde66ab294abb1c15e349ad3b33e818 /doc
parentdfc81983491417c5cd1c99d7db05e421c409379d (diff)
downloadminetest-71b2570f0919d3bb5575c9ec694ecd004222fcea.tar.gz
minetest-71b2570f0919d3bb5575c9ec694ecd004222fcea.tar.bz2
minetest-71b2570f0919d3bb5575c9ec694ecd004222fcea.zip
Load dependencies and description from mod.conf
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt33
-rw-r--r--doc/menu_lua_api.txt11
2 files changed, 36 insertions, 8 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 413990f61..15036848b 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -130,9 +130,8 @@ Mod directory structure
mods
|-- modname
- | |-- depends.txt
+ | |-- mod.conf
| |-- screenshot.png
- | |-- description.txt
| |-- settingtypes.txt
| |-- init.lua
| |-- models
@@ -145,12 +144,32 @@ Mod directory structure
| `-- <custom data>
`-- another
-
### modname
The location of this directory can be fetched by using
`minetest.get_modpath(modname)`.
+### mod.conf
+A key-value store of mod details.
+
+* `name` - the mod name. Allows Minetest to determine the mod name even if the
+ folder is wrongly named.
+* `description` - Description of mod to be shown in the Mods tab of the mainmenu.
+* `depends` - A comma separated list of dependencies. These are mods that must
+ be loaded before this mod.
+* `optional_depends` - A comma separated list of optional dependencies.
+ Like a dependency, but no error if the mod doesn't exist.
+
+Note: to support 0.4.x, please also provide depends.txt.
+
+### `screenshot.png`
+A screenshot shown in the mod manager within the main menu. It should
+have an aspect ratio of 3:2 and a minimum size of 300×200 pixels.
+
### `depends.txt`
+**Deprecated:** you should use mod.conf instead.
+
+This file is used if there are no dependencies in mod.conf.
+
List of mods that have to be loaded before loading this mod.
A single line contains a single modname.
@@ -159,11 +178,11 @@ Optional dependencies can be defined by appending a question mark
to a single modname. This means that if the specified mod
is missing, it does not prevent this mod from being loaded.
-### `screenshot.png`
-A screenshot shown in the mod manager within the main menu. It should
-have an aspect ratio of 3:2 and a minimum size of 300×200 pixels.
-
### `description.txt`
+**Deprecated:** you should use mod.conf instead.
+
+This file is used if there is no description in mod.conf.
+
A file containing a description to be shown in the Mods tab of the mainmenu.
### `settingtypes.txt`
diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.txt
index 1d158f304..49c6fbef0 100644
--- a/doc/menu_lua_api.txt
+++ b/doc/menu_lua_api.txt
@@ -111,7 +111,7 @@ core.get_screen_info()
window_height = <current window height>
}
-Games:
+Packages:
core.get_game(index)
^ returns {
id = <id>,
@@ -125,6 +125,15 @@ core.get_game(index)
core.get_games() -> table of all games in upper format (possible in async calls)
core.get_mapgen_names([include_hidden=false]) -> table of map generator algorithms
registered in the core (possible in async calls)
+core.get_mod_info(path)
+^ returns {
+ name = "name of mod",
+ type = "mod" or "modpack",
+ description = "description",
+ path = "path/to/mod",
+ depends = {"mod", "names"},
+ optional_depends = {"mod", "names"},
+}
Favorites:
core.get_favorites(location) -> list of favorites (possible in async calls)