summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2022-02-03 11:43:28 +0100
committerGitHub <noreply@github.com>2022-02-03 11:43:28 +0100
commitd387e9b6d39d9689b79da21fa263c93d2b26e840 (patch)
tree3b70a621005ca0553ade23b124a294dc360afaee /doc
parent163d3547e65a6cea8a3e555557407e88d8e09183 (diff)
downloadminetest-d387e9b6d39d9689b79da21fa263c93d2b26e840.tar.gz
minetest-d387e9b6d39d9689b79da21fa263c93d2b26e840.tar.bz2
minetest-d387e9b6d39d9689b79da21fa263c93d2b26e840.zip
Add more documentation for the list[] fs element (#11979)
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt22
1 files changed, 12 insertions, 10 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index e9140a972..7061a5b8a 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2388,21 +2388,23 @@ Elements
* End of a scroll_container, following elements are no longer bound to this
container.
-### `list[<inventory location>;<list name>;<X>,<Y>;<W>,<H>;]`
+### `list[<inventory location>;<list name>;<X>,<Y>;<W>,<H>;<starting item index>]`
-* Show an inventory list if it has been sent to the client. Nothing will
- be shown if the inventory list is of size 0.
+* Show an inventory list if it has been sent to the client.
+* If the inventory list changes (eg. it didn't exist before, it's resized, or its items
+ are moved) while the formspec is open, the formspec element may (but is not guaranteed
+ to) adapt to the new inventory list.
+* Item slots are drawn in a grid from left to right, then up to down, ordered
+ according to the slot index.
+* `W` and `H` are in inventory slots, not in coordinates.
+* `starting item index` (Optional): The index of the first (upper-left) item to draw.
+ Indices start at `0`. Default is `0`.
+* The number of shown slots is the minimum of `W*H` and the inventory list's size minus
+ `starting item index`.
* **Note**: With the new coordinate system, the spacing between inventory
slots is one-fourth the size of an inventory slot by default. Also see
[Styling Formspecs] for changing the size of slots and spacing.
-### `list[<inventory location>;<list name>;<X>,<Y>;<W>,<H>;<starting item index>]`
-
-* Show an inventory list if it has been sent to the client. Nothing will
- be shown if the inventory list is of size 0.
-* **Note**: With the new coordinate system, the spacing between inventory
- slots is one-fourth the size of an inventory slot.
-
### `listring[<inventory location>;<list name>]`
* Allows to create a ring of inventory lists