Commit graph

8 commits

Author SHA1 Message Date
gfgtdf
b8c6edc53c
Fix indices in widget.add_item_of_type()/add_item()/remove_items_at() (#8516)
- widget:add_item_of_type() now uses lua 1-based indicies and throws lua errors on wrong indicies. (previously used c++ 0-based indexing, and could lead to assertions when wrong indicies were used, )
- widget:add_item() now has a optional location pos parameter as claimed in the wiki
- the pos and count paraemters in widget:remove_items_at() are now optional and default to removing the last element

With this is matches the behavior of the standart lua functions table.insert and table.remove which is imo what lua writers expect.
2024-09-03 14:17:57 +02:00
Subhraman Sarkar
60640dc8bd Add lua function gui.switch_theme() to allow add-ons to switch themes in the middle of a scenario 2024-08-25 01:56:22 -04:00
Celtic Minstrel
7aa5450a41 [Lua] Replace gui.show_inspector's undocumented config parameter with a string parameter that does the same thing.
It's still supported to pass a config, just in case anything relied on that.

This also updates the LuaDoc documentation at the same time.
2024-04-11 23:49:15 -04:00
Celtic Minstrel
8a42565447 [LuaDoc] Permit GUI widgets to have non-translatable labels, including numbers. 2024-02-13 19:29:21 -05:00
Celtic Minstrel
09c88d2b47 [LuaDoc] Fix typo 2024-02-07 22:10:33 -05:00
Celtic Minstrel
3276b9a36c [LuaDoc] Fix missing and incorrectly optional arguments to gui.widget.remove_items_at 2024-02-07 22:10:33 -05:00
Celtic Minstrel
c7741907c2 [LuaDoc] Fix several errors in the inline documentation 2024-02-06 19:04:00 -05:00
Celtic Minstrel
e1300e29b0
Lua API: Add inline documentation for pretty much everything and convert existing docs (#6483)
The new format is EmmyLua-based and can be used with (at least) Visual Studio Code.
2022-02-17 13:43:31 -05:00