minetest/minetest — pull request #920 by kahrl (2013-09-11 18:29:08+00:00)
Title: Add formspec table

This adds table[] as well as tableoptions[] and tablecolumns[] elements to formspec. Tables are basically "textlists on steroids". (Textlists are implemented in terms of tables now. Besides removing the need for a lot of irrlicht black magic, this bug mentioned in #814 is fixed: "It happens sometimes that the selection in a list follows the mouse (reproduceable by moving the scrollbar slider and then clicking outside of the formspec) (not in win build)".)

See my tabletest mod (https://github.com/kahrl/tabletest/) for examples.

Notable features:
- Text columns with left, centered, right or inline alignment
- Image columns, also with alignment
- Ability to set the color of cells or rows
- Treeview, supports opening and closing subtrees
- Table options: foreground/background/highlight colors, etc.
- Per-column tooltips. They suck a bit because they use irrlicht's builtin tooltips.
- Vertical scrolling, keyboard navigation and events work pretty much the same as previously in textlists, except table events report the column as well.

Incompatible changes:
- explode_textlist_event has been renamed to minetest.explode_textlist_event / engine.explode_textlist_event and handles invaild events slightly more gracefully. (Also, added: minetest.explode_table_event / engine.explode_table_event)
- engine.get_textlist_index has been renamed to engine.get_table_index and supports textlists and tables. Returns nil instead of 0 when nothing is selected.