Added test for dialog getters.
This commit is contained in:
parent
76a592946a
commit
1f04eceed3
1 changed files with 5 additions and 1 deletions
|
@ -307,6 +307,8 @@ local t = {
|
|||
} }
|
||||
}
|
||||
|
||||
local li = 0
|
||||
|
||||
local r = wesnoth.show_dialog(t, function()
|
||||
local _ = wesnoth.textdomain "wesnoth-units"
|
||||
local t = { "Ancient Lich", "Ancient Wose", "Elvish Avenger" }
|
||||
|
@ -316,9 +318,11 @@ local r = wesnoth.show_dialog(t, function()
|
|||
wesnoth.set_dialog_value(img, "the_list", i, "the_icon")
|
||||
end
|
||||
wesnoth.set_dialog_value(2, "the_list")
|
||||
end, function ()
|
||||
li = wesnoth.get_dialog_value "the_list"
|
||||
end)
|
||||
|
||||
wesnoth.message(string.format("Button %d pressed.", r))
|
||||
wesnoth.message(string.format("Button %d pressed. Item %d selected.", r, li))
|
||||
>>
|
||||
[/lua]
|
||||
[/event]
|
||||
|
|
Loading…
Add table
Reference in a new issue