mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Add Settings interface for Lua
This commit is contained in:
parent
10a38a3005
commit
d820a6bfd8
9 changed files with 331 additions and 0 deletions
|
@ -1069,6 +1069,8 @@ minetest.pos_to_string({x=X,y=Y,z=Z}) -> "(X,Y,Z)"
|
|||
minetest.string_to_pos(string) -> position
|
||||
^ Same but in reverse
|
||||
^ escapes characters [ ] \ , ; that can not be used in formspecs
|
||||
minetest.is_yes(string)
|
||||
^ returns whether string can be interpreted as yes
|
||||
|
||||
minetest namespace reference
|
||||
-----------------------------
|
||||
|
@ -1737,6 +1739,18 @@ methods:
|
|||
^ from (minx,miny,minz) to (maxx,maxy,maxz) in the order of [z [y [x]]]
|
||||
- iterp(minp, maxp): same as above, except takes a vector
|
||||
|
||||
Settings: An interface to read config files in the format of minetest.conf
|
||||
- Can be created via Settings(filename)
|
||||
methods:
|
||||
- get(key) -> value
|
||||
- get_bool(key) -> boolean
|
||||
- set(key, value)
|
||||
- remove(key) -> success
|
||||
- get_names() -> {key1,...}
|
||||
- write() -> success
|
||||
^ write changes to file
|
||||
- to_table() -> {[key1]=value1,...}
|
||||
|
||||
Mapgen objects
|
||||
---------------
|
||||
A mapgen object is a construct used in map generation. Mapgen objects can be used by an on_generate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue