19 Commits

Author SHA1 Message Date
Lazerbeak12345
1528e87864
feat: Embed support (#15)
Co-authored-by: luk3yx <luk3yx@users.noreply.github.com>
2024-07-25 19:40:18 +12:00
luk3yx
da87496e26 Add listcolors to invisible_elems 2024-06-30 21:32:35 +12:00
luk3yx
13136ab2dc Add enter_after_edit parameter to Field
Closes https://gitlab.com/luk3yx/minetest-flow/-/issues/3
2024-06-18 15:02:14 +12:00
luk3yx
a3523c7073 The example form doesn't show a field by default 2024-05-18 19:25:56 +12:00
luk3yx
5215229d8c Add inline styles and tooltips 2024-05-15 10:49:36 +12:00
luk3yx
918002d505 Even more input validation 2023-08-08 21:55:09 +12:00
luk3yx
f5b7bc796a Add additional input validation
This makes it harder to crash mods that aren't expecting malicious
formspec input.

I don't like the large amount of unit tests but I don't see how to avoid
them and arguably those tests should have been there beforehand anyway.
2023-08-04 19:05:53 +12:00
luk3yx
dd9976296b Fix unit test 2023-07-08 12:19:23 +12:00
luk3yx
4046fed55f Translate labels before calculating their size
I've made a new naive_str_width function that tries to estimate the
width of UTF-8 text and is faster than strip_escape_sequences on LuaJIT
(I guess because there isn't an intermediate string being created).

Closes #4
2023-06-16 14:06:32 +12:00
Lazerbeak12345
5bb5dba625
feat: add locale support (#9)
Co-authored-by: luk3yx <luk3yx@users.noreply.github.com>
2023-06-11 22:10:19 +12:00
Lazerbeak12345
35fa361f8d
fix: bgcolor settings for root node (#7) 2023-06-01 16:56:03 +12:00
Lazerbeak12345
435efd014e
feat(flow.widgets): Add nil gui object (#6)
Skipped over by rendering library, and not included in output formspec.
2023-04-19 16:54:04 +12:00
Lazerbeak12345
60d2674a45
feat: Add render_to_formspec_string function (#5)
Co-authored-by: luk3yx <luk3yx@users.noreply.github.com>
2023-04-08 13:13:44 +12:00
Lazerbeak12345
bba30cc267
feat: Add set_as_inventory_for API function (#2)
Adds the `Form:set_as_inventory_for(player, [ctx])` API.

Also includes:

 • `Form:unset_as_inventory_for(player)`
 • Extends private `show_form` to account for inv edge cases
 • Extends private `on_fs_input` to account for inv edge cases
 • Adds several abstraction functions
 • Add feature to `on_leaveplayer` to delete the inv formspec state as well
 • Add a few unit tests for related features
2023-03-26 15:44:31 +13:00
luk3yx
5f2e601938 Fix gui.Stack expanding 2023-02-09 11:08:00 +13:00
luk3yx
a2fc646e77 Add gui.Stack 2023-02-01 18:08:58 +13:00
luk3yx
299ccfcddc Add visible = false (may be renamed in the future) 2023-01-08 17:13:44 +13:00
luk3yx
bb102c360f Make luacheck ignore test.lua 2023-01-02 16:36:30 +13:00
luk3yx
048bd0a082 WIP: Unit tests 2023-01-02 16:34:07 +13:00