You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+53-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,59 @@ An experimental collection of extra widgets for [flow].
18
18
19
19
### Widgets
20
20
21
-
TODO
21
+
#### Grid
22
+
23
+
> TODO:
24
+
25
+
#### List
26
+
27
+
```lua
28
+
flow_extras.List{
29
+
inventory_location=inventory_location,
30
+
list_name=list_name,
31
+
w=w,
32
+
h=h,
33
+
starting_item_index=starting_item_index,
34
+
remainder=remainder ,
35
+
remainder_v=remainder_v ,
36
+
remainder_align=remainder_align,
37
+
listring=listring,
38
+
bgimg=bgimg,
39
+
align_h=align_h,
40
+
align_v=align_v,
41
+
spacing=spacing
42
+
}
43
+
```
44
+
45
+
> TODO: link these
46
+
47
+
| Parameter | Type | Description |
48
+
| :-------- | :--- | :---------- |
49
+
|`inventory_location`|`string`|**Required**. [See minetest's documentation for `list[]`][list] for more information. |
50
+
|`list_name`|`string`|**Required**. [See minetest's documentation for `list[]`][list] for more information. |
51
+
|`w`|`number`|**Required**. Width of list in tiles. [See minetest's documentation for `list[]`][list] for more information. |
52
+
|`h`|`number`|**Required**. Height of list in tiles. [See minetest's documentation for `list[]`][list] for more information. |
53
+
|`starting_item_index`|`number`|**Optional**. (Default `0`) Zero-based offset index for this list. [See minetest's documentation for `list[]`][list] for more information. |
54
+
|`remainder`|`number`|**Optional**. (Default `0`) If you'd like a row of list tiles that is less than one demention of the rest of the list, set this to a number > 0. |
55
+
|`remainder_v`|`boolean`|**Optional**. (Default `false`) If `true`, the remainder will be below the rest of the [`list[]`][list]. Otherwise, it is to the right. |
56
+
|`remainder_align`|`string`|**Optional**. Passed into `align_v` on a [`flow.widgets.VBox`][gui.VBox] if `remainder_v` or `align_h` on a [`flow.widgets.HBox`][gui.HBox] to align the remainder list. |
57
+
|`listring`|`table`|**Optional**. A list of tables each passed to `flow.widgets.Listring`. Prepended with this `list[]`'s location and name, if provided. If not provided, [`listring[]`][listring]s are not generated. |
58
+
|`bgimg`|`boolean` or `string` or `table` of `string`s |**Optional**. If present, applies each image in order, looping from left to right, top to bottom, on each list tile in the main list, followed by the remainder list, in the same pattern. By default, since `list[]` elements are opaque, you will not be able to see these images. Make use of [`flow.widgets.Listcolors`][listcolors] to adjust this as needed. If `bgimg` is `false`, then no `bgimg`s are rendered. If it is `nil`, it defaults to `{ "flow_extras_list_bg.png" }`. If it is a string, it is wrapped in a table. |
59
+
|`align_h`|`string`|**Optional**. If there is a remainder or a listring, this is passed to the the [`flow.widgets.VBox`][gui.VBox] if `remainder_v` or [`flow.widgets.Hbox`][gui.HBox] that wraps the entire element. Otherwise, this element does not exist, and either a [`flow.widgets.Stack`][gui.Stack] or a [`flow.widgets.List`][List] is the root. |
60
+
|`align_v`|`string`|**Optional**. If there is a remainder or a listring, this is passed to the the [`flow.widgets.VBox`][gui.VBox] if `remainder_v` or [`flow.widgets.Hbox`][gui.HBox] that wraps the entire element. Otherwise, this element does not exist, and either a [`flow.widgets.Stack`][gui.Stack] or a [`flow.widgets.List`][List] is the root. |
61
+
|`spacing`|`number`|**Optional**. The amount of space between the list tiles. Defaults to `0.25` - the same amount as minetest out of the box. |
0 commit comments