]> git.lizzy.rs Git - minetest.git/blobdiff - doc/menu_lua_api.txt
Delete world dialog: Move buttons to avoid double click deletion
[minetest.git] / doc / menu_lua_api.txt
index cd44fa81587cc737d821d57d317a6cc0e4657f48..1d158f3049fcfb6d94432d4c10455ebf4549b240 100644 (file)
@@ -1,4 +1,4 @@
-Minetest Lua Mainmenu API Reference 0.4.10
+Minetest Lua Mainmenu API Reference 0.5.0
 ========================================
 
 Introduction
@@ -31,38 +31,16 @@ core.start()
 core.close()
 
 Filesystem:
-core.get_scriptdir()
-^ returns directory of script
+core.get_builtin_path()
+^ returns path to builtin root
 core.get_modpath() (possible in async calls)
 ^ returns path to global modpath
-core.get_modstore_details(modid) (possible in async calls)
-^ modid numeric id of mod in modstore
-^ returns {
-       id                      = <numeric id of mod in modstore>,
-       title           = <human readable title>,
-       basename        = <basename for mod>,
-       description = <description of mod>,
-       author          = <author of mod>,
-       download_url= <best match download url>,
-       license         = <short description of license>,
-       rating          = <float value of current rating>
-}
-core.get_modstore_list() (possible in async calls)
-^ returns {
-       [1] = {
-               id               = <numeric id of mod in modstore>,
-               title    = <human readable title>,
-               basename = <basename for mod>
-       }
-}
+core.get_clientmodpath() (possible in async calls)
+^ returns path to global client-side modpath
 core.get_gamepath() (possible in async calls)
 ^ returns path to global gamepath
 core.get_texturepath() (possible in async calls)
 ^ returns path to default textures
-core.get_dirlist(path,onlydirs) (possible in async calls)
-^ path to get subdirs from
-^ onlydirs should result contain only dirs?
-^ returns list of folders within path
 core.create_dir(absolute_path) (possible in async calls)
 ^ absolute_path to directory to create (needs to be absolute)
 ^ returns true/false
@@ -88,6 +66,11 @@ core.sound_play(spec, looped) -> handle
 ^ spec = SimpleSoundSpec (see lua-api.txt)
 ^ looped = bool
 core.sound_stop(handle)
+core.get_video_drivers()
+^ get list of video drivers supported by engine (not all modes are guaranteed to work)
+^ returns list of available video drivers' settings name and 'friendly' display name
+^ e.g. { {name="opengl", friendly_name="OpenGL"}, {name="software", friendly_name="Software Renderer"} }
+^ first element of returned list is guaranteed to be the NULL driver
 
 Formspec:
 core.update_formspec(formspec)
@@ -103,8 +86,11 @@ core.explode_textlist_event(string) -> table
 ^ type: "INV" (no row selected), "CHG" (selected) or "DCL" (double-click)
 
 GUI:
-core.set_background(type, texturepath)
+core.set_background(type, texturepath,[tile],[minsize])
 ^ type: "background", "overlay", "header" or "footer"
+^ tile: tile the image instead of scaling (background only)
+^ minsize: minimum tile size, images are scaled to at least this size prior
+^   doing tiling (background only)
 core.set_clouds(<true/false>)
 core.set_topleft_text(text)
 core.show_keys_menu()
@@ -137,6 +123,8 @@ core.get_game(index)
        addon_mods_paths = {[1] = <path>,},
 }
 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)
 
 Favorites:
 core.get_favorites(location) -> list of favorites (possible in async calls)
@@ -185,11 +173,15 @@ core.create_world(worldname, gameid)
 core.delete_world(index)
 
 Helpers:
+core.get_us_time()
+^ returns time with microsecond precision
 core.gettext(string) -> string
 ^ look up the translation of a string in the gettext message catalog
-fgettext(string, ...) -> string
+fgettext_ne(string, ...)
 ^ call core.gettext(string), replace "$1"..."$9" with the given
-^ extra arguments, call core.formspec_escape and return the result
+^ extra arguments and return the result
+fgettext(string, ...) -> string
+^ same as fgettext_ne(), but calls core.formspec_escape before returning result
 core.parse_json(string[, nullvalue]) -> something (possible in async calls)
 ^ see core.parse_json (lua_api.txt)
 dump(obj, dumped={})
@@ -200,6 +192,16 @@ string:trim()
 ^ eg. string.trim("\n \t\tfoo bar\t ") == "foo bar"
 core.is_yes(arg) (possible in async calls)
 ^ returns whether arg can be interpreted as yes
+minetest.encode_base64(string) (possible in async calls)
+^ Encodes a string in base64.
+minetest.decode_base64(string) (possible in async calls)
+^ Decodes a string encoded in base64.
+
+Version compat:
+core.get_min_supp_proto()
+^ returns the minimum supported network protocol version
+core.get_max_supp_proto()
+^ returns the maximum supported network protocol version
 
 Async:
 core.handle_async(async_job,parameters,finished)
@@ -214,7 +216,7 @@ Limitations of Async operations
  -Limited set of available functions
        e.g. No access to functions modifying menu like core.start,core.close,
        core.file_open_dialog
-                       
+
 
 Class reference
 ----------------