]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - doc/lua_api.txt
Add minetest.get_gametime() API function, that returns the number of seconds since...
[dragonfireclient.git] / doc / lua_api.txt
index 3dfb67157db909cd2456dd6220d404152ed4ee93..f593b0db8d294649b80528ea25876cd2e94a979b 100644 (file)
@@ -970,7 +970,7 @@ textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>]
 ^ x and y position the itemlist relative to the top left of the menu
 ^ w and h are the size of the itemlist
 ^ name fieldname sent to server on doubleclick value is current selected element
-^ listelements can be prepended by #colorkey (see colorkeys), 
+^ listelements can be prepended by #color in hexadecimal format RRGGBB,
 ^    if you want a listelement to start with # write ##
 
 textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>;<selected idx>;<transparent>]
@@ -996,7 +996,7 @@ box[<X>,<Y>;<W>,<H>;<color>]
 ^ simple colored semitransparent box
 ^ x and y position the box relative to the top left of the menu
 ^ w and h are the size of box
-^ colorkey (see colorkeys)
+^ color in hexadecimal format RRGGBB
 
 dropdown[<X>,<Y>;<W>;<name>;<item 1>,<item 2>, ...,<item n>;<selected idx>]
 ^ show a dropdown field
@@ -1068,8 +1068,7 @@ minetest.pos_to_string({x=X,y=Y,z=Z}) -> "(X,Y,Z)"
 ^ Convert position to a printable string
 minetest.string_to_pos(string) -> position
 ^ Same but in reverse
-minetest.formspec_escape(string) -> string
-^ escapes characters like [, ], and \ that can not be used in formspecs
+^ escapes characters [ ] \ , ;  that can not be used in formspecs
 
 minetest namespace reference
 -----------------------------
@@ -1167,6 +1166,7 @@ minetest.register_authentication_handler(handler)
 Setting-related:
 minetest.setting_set(name, value)
 minetest.setting_get(name) -> string or nil
+minetest.setting_setbool(name, value)
 minetest.setting_getbool(name) -> boolean value or nil
 minetest.setting_get_pos(name) -> position or nil
 minetest.setting_save() -> nil, save all settings to config file
@@ -1226,6 +1226,7 @@ minetest.get_player_by_name(name) -- Get an ObjectRef to a player
 minetest.get_objects_inside_radius(pos, radius)
 minetest.set_timeofday(val): val: 0...1; 0 = midnight, 0.5 = midday
 minetest.get_timeofday()
+minetest.get_gametime(): returns the time, in seconds, since the world was created
 minetest.find_node_near(pos, radius, nodenames) -> pos or nil
 ^ nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
 minetest.find_nodes_in_area(minp, maxp, nodenames) -> list of positions
@@ -1458,6 +1459,12 @@ minetest.get_content_id(name) -> integer
 ^ Gets the internal content ID of name
 minetest.get_name_from_content_id(content_id) -> string
 ^ Gets the name of the content with that content ID
+minetest.parse_json(string[, nullvalue]) -> something
+^ Convert a string containing JSON data into the Lua equivalent
+^ nullvalue: returned in place of the JSON null; defaults to nil
+^ On success returns a table, a string, a number, a boolean or nullvalue
+^ On failure outputs an error message and returns nil
+^ Example: parse_json("[10, {\"a\":false}]") -> {[1] = 10, [2] = {a = false}}
 minetest.serialize(table) -> string
 ^ Convert a table containing tables, strings, numbers, booleans and nils
   into string form readable by minetest.deserialize
@@ -1612,6 +1619,10 @@ Player-only: (no-op for other objects)
   ^ if a flag is nil, the flag is not modified
 - hud_set_hotbar_itemcount(count): sets number of items in builtin hotbar
   ^ count: number of items, must be between 1 and 23
+- hud_set_hotbar_image(texturename)
+  ^ sets background image for hotbar
+- hud_set_hotbar_selected_image(texturename)
+  ^ sets image for selected item of hotbar
 
 InvRef: Reference to an inventory
 methods:
@@ -1863,6 +1874,7 @@ Object Properties
     makes_footstep_sound = false,
     automatic_rotate = false,
     stepheight = 0,
+    automatic_face_movement_dir = false,
 }
 
 Entity definition (register_entity)
@@ -1985,12 +1997,11 @@ Node definition (register_node)
     liquid_alternative_flowing = "", -- Flowing version of source liquid
     liquid_alternative_source = "", -- Source version of flowing liquid
     liquid_viscosity = 0, -- Higher viscosity = slower flow (max. 7)
-    liquid_renewable = true, -- Can new liquid source be created by placing
+    liquid_renewable = true, -- Can new liquid source be created by placing two or more sources nearby?
     freezemelt = "", -- water for snow/ice, ice/snow for water
     leveled = 0, -- Block contain level in param2. value - default level, used for snow. Dont forget use "leveled" type nodebox
     liquid_range = 8, -- number of flowing nodes arround source (max. 8)
     drowning = 0, -- Player will take this amount of damage if no bubbles are left
-    two or more sources nearly?
     light_source = 0, -- Amount of light emitted by node
     damage_per_second = 0, -- If player is inside node, this damage is caused
     node_box = {type="regular"}, -- See "Node boxes"