gui.get_user_choice(): fixed a 'number expected, got function' error

This commit is contained in:
Elvish_Hunter 2021-11-06 22:23:33 +01:00
parent 8e8d9a3c8f
commit 603430c3aa
2 changed files with 3 additions and 2 deletions

View file

@ -8,6 +8,7 @@
### Editor
### Multiplayer
### Lua API
* Fixed an error in `gui.get_user_choice()` (part of PR #6247).
### Packaging
### Terrain
### Translations

View file

@ -35,8 +35,8 @@ function gui.get_user_choice(attr, options)
msg[k] = attr[k]
end
for k,v in ipairs(options) do
table.insert(msg, wml.tag.option, { message = v,
wml.tag.command, { wml.tag.lua, {
table.insert(msg, wml.tag.option { message = v,
wml.tag.command { wml.tag.lua {
code = string.format("gui.__user_choice_helper(%d)", k)
}}})
end