Fixed a gui.get_user_choice() call in the test scenario

This commit is contained in:
Elvish_Hunter 2022-01-08 22:17:00 +01:00
parent 5b18f2df4c
commit 38855ba399
2 changed files with 20 additions and 6 deletions

View file

@ -45,6 +45,7 @@
* Avoid rare crash situation after editing scenarios (issue #5883)
### Multiplayer
### Lua API
* Fixed an error in gui.get_user_choice() and added support for the current DescriptionWML syntax (PR #6247)
### Packaging
### Terrain
### Translations

View file

@ -2562,13 +2562,26 @@ Also, 0..9 = $below_ten, one,two,three = $ascii and the bonus answer is $mixed."
wesnoth.interface.add_chat_message(string.format("Unit moved from %d,%d to %d,%d", ec.x2, ec.y2, ec.x1, ec.y1))
local result = gui.get_user_choice(
{ speaker = "unit", message = "Pick your poison" },
{ "&items/potion-red.png=Something red=Take a sip and enjoy",
"*&items/potion-blue.png=Nice blue=Surely youll like that one",
"&items/potion-yellow.png=<span color='yellow'>Oh noes yellow</span>=Oh Im sure youll love that one",
"&scenery/well.png=A nice well=Grab a bucket and fetch some water",
"&items/holy-water.png=Oh nice bottle=Feel the divinity",
{ { image = "items/potion-red.png",
label = "Something red",
description = "Take a sip and enjoy" },
{ image = "items/potion-blue.png",
label = "Nice blue",
description = "Surely youll like that one",
default = true },
{ image = "items/potion-yellow.png",
label = "<span color='yellow'>Oh noes yellow</span>",
description = "Oh Im sure youll love that one" },
{ image = "scenery/well.png",
label = "A nice well",
description = "Grab a bucket and fetch some water" },
{ image = "items/holy-water.png",
label = "Oh nice bottle",
description = "Feel the divinity" },
-- Should have an empty first column and a second column on two lines.
"=Well a nice and black drink.\nToo dark too see?=Take a sip and pass the bottle along" })
{ label = "Well a nice and black drink.\nToo dark too see?",
description = "Take a sip and pass the bottle along" }
})
wesnoth.interface.add_chat_message(string.format("User selected choice %d.", result))
>>
[/lua]