Search found 9 matches
- February 16th, 2024, 12:36 pm
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Re: Lua type annotations
Hi !
Could we add some typing to the terrain_map class, to support the map style read/write access to terrain codes ?
Updating the class definition to
should do the trick
Could we add some typing to the terrain_map class, to support the map style read/write access to terrain codes ?
Updating the class definition to
Code: Select all
---@class terrain_map : wesnoth.map, {[{[1]:integer, [2]:integer}]: string}
- February 12th, 2024, 8:10 am
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Re: Lua type annotations
Thank you very much !
- February 8th, 2024, 1:06 pm
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Re: Lua type annotations
Thank you !
I think the typing of gui.simple_widget.label is too restrictive : for instance, for image widget, the label is not a tstring, just a simple string.
Could it be changed to string|tstring ?
I think the typing of gui.simple_widget.label is too restrictive : for instance, for image widget, the label is not a tstring, just a simple string.
Could it be changed to string|tstring ?
- February 7th, 2024, 11:50 am
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Re: Lua type annotations
Another one : it seems that the definitions for
are missing in wesnoth/interface.lua
Code: Select all
interface.remove_item
interface.add_item_halo
- February 7th, 2024, 11:36 am
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Re: Lua type annotations
Another small fix I had to make in wesnoth/interface.lua is replacing
by
Code: Select all
---@type table<string, fun()>
wesnoth.game_display = {}
Code: Select all
---@type table<string, fun(): WMLTag[]>
wesnoth.interface.game_display = {}
- February 7th, 2024, 9:54 am
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Re: Lua type annotations
I've have copied the files from #7359, and it works fine, thank you. Except perhaps for this function : gui.widget.remove_items_at (documented at https://wiki.wesnoth.org/LuaAPI/gui/widget#remove_items_at) Since it is a replacement for the old wesnoth.remove_dialog_item it seems to me that its signa...
- February 5th, 2024, 6:06 pm
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Re: Lua type annotations
I've indeed seen some inaccuracies fixed by #7359, I'll give a second look when it's merged.
Thank you for providing these definitions.
Thank you for providing these definitions.
- February 5th, 2024, 3:27 pm
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Re: Lua type annotations
Many thanks for your quick reply.
https://github.com/wesnoth/wesnoth/tree ... ua/wesnoth is exactly what I had in mind !
https://github.com/wesnoth/wesnoth/tree ... ua/wesnoth is exactly what I had in mind !
- February 4th, 2024, 6:05 pm
- Forum: Lua Labs
- Topic: Lua type annotations
- Replies: 14
- Views: 2485
Lua type annotations
Hi !
Do you know if there are some Lua type annotations (following this format https://luals.github.io/wiki/annotations/#class) available for the
LuaAPI exposed by the game engine. I would make developing UMC so much easier !
Thank you !
Do you know if there are some Lua type annotations (following this format https://luals.github.io/wiki/annotations/#class) available for the
LuaAPI exposed by the game engine. I would make developing UMC so much easier !
Thank you !