Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formspec table #920

Closed
wants to merge 1 commit into from
Closed

Add formspec table #920

wants to merge 1 commit into from

Conversation

kahrl
Copy link
Contributor

@kahrl kahrl commented Sep 11, 2013

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 returns nil instead of 0 when nothing is selected. (Also, added: engine.get_table_index)

@kahrl
Copy link
Contributor Author

kahrl commented Sep 11, 2013

Update to lua_api.txt: "last tableoptions[]" and "last tablecolumns[]" replaced by "previous tableoptions[]" and "previous tablecolumns[]"

@sapier sapier mentioned this pull request Nov 9, 2013
@kahrl
Copy link
Contributor Author

kahrl commented Dec 23, 2013

Rebased to current master and fixed another small issue with key navigation.

@ShadowNinja
Copy link
Member

8966c16

@kahrl kahrl deleted the formspec_table branch September 14, 2014 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants