Added test for dialog getters.

This commit is contained in:
Guillaume Melquiond 2010-07-27 21:13:00 +00:00
parent 76a592946a
commit 1f04eceed3

View file

@ -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]