mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-01 16:10:05 +00:00
Fixed a gui.get_user_choice() call in the test scenario
This commit is contained in:
parent
5b18f2df4c
commit
38855ba399
@ -45,6 +45,7 @@
|
|||||||
* Avoid rare crash situation after editing scenarios (issue #5883)
|
* Avoid rare crash situation after editing scenarios (issue #5883)
|
||||||
### Multiplayer
|
### Multiplayer
|
||||||
### Lua API
|
### Lua API
|
||||||
|
* Fixed an error in gui.get_user_choice() and added support for the current DescriptionWML syntax (PR #6247)
|
||||||
### Packaging
|
### Packaging
|
||||||
### Terrain
|
### Terrain
|
||||||
### Translations
|
### Translations
|
||||||
|
@ -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))
|
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(
|
local result = gui.get_user_choice(
|
||||||
{ speaker = "unit", message = "Pick your poison" },
|
{ speaker = "unit", message = "Pick your poison" },
|
||||||
{ "&items/potion-red.png=Something red=Take a sip and enjoy",
|
{ { image = "items/potion-red.png",
|
||||||
"*&items/potion-blue.png=Nice blue=Surely you’ll like that one",
|
label = "Something red",
|
||||||
"&items/potion-yellow.png=<span color='yellow'>Oh noes yellow</span>=Oh I’m sure you’ll love that one",
|
description = "Take a sip and enjoy" },
|
||||||
"&scenery/well.png=A nice well=Grab a bucket and fetch some water",
|
{ image = "items/potion-blue.png",
|
||||||
"&items/holy-water.png=Oh nice bottle=Feel the divinity",
|
label = "Nice blue",
|
||||||
|
description = "Surely you’ll like that one",
|
||||||
|
default = true },
|
||||||
|
{ image = "items/potion-yellow.png",
|
||||||
|
label = "<span color='yellow'>Oh noes yellow</span>",
|
||||||
|
description = "Oh I’m sure you’ll 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.
|
-- 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))
|
wesnoth.interface.add_chat_message(string.format("User selected choice %d.", result))
|
||||||
>>
|
>>
|
||||||
[/lua]
|
[/lua]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user