Skip to content

Commit

Permalink
Convert uses of the old GUI2 API in World Conquest
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Sep 27, 2020
1 parent 6340823 commit 0e1b968
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Expand Up @@ -165,7 +165,7 @@ function wc2_show_invest_dialog_impl(args)
res = selected_data.res
end
end
local d_res = wesnoth.show_dialog(dialog_wml, preshow)
local d_res = gui.show_dialog(dialog_wml, preshow)
return d_res, res
end

Expand Down
Expand Up @@ -61,12 +61,12 @@ function invest_tellunit.execute(unit_type)
if not wesnoth.sides[wesnoth.current.side].is_local then
return
end
local function preshow()
wesnoth.set_dialog_value(wc2_color.tc_image(unit_type.image), "icon")
wesnoth.set_dialog_value(unit_type.name, "name")
local function preshow(dialog)
dialog.icon.label = wc2_color.tc_image(unit_type.image)
dialog.name.label = unit_type.name
end

wesnoth.show_dialog(invest_tellunit.dialog_wml, preshow)
gui.show_dialog(invest_tellunit.dialog_wml, preshow)
end

return invest_tellunit
Expand Up @@ -83,7 +83,7 @@ local function show_dialog(unit, item_image)
dialog.item_icon.label = item_image
dialog.res_yes:focus()
end
local res = wesnoth.show_dialog(dialog_wml, preshow)
local res = gui.show_dialog(dialog_wml, preshow)
return res == 1 or res == -1
end

Expand Down
Expand Up @@ -242,7 +242,7 @@ function wesnoth.wml_actions.wc2_show_wocopedia(cfg)
end
end

wesnoth.show_dialog(dialog, preshow)
gui.show_dialog(dialog, preshow)
end

wc2_utils.menu_item {
Expand Down
Expand Up @@ -299,5 +299,5 @@ function wc2_debug_settings(nplayers)
globals.settings.ncastles = window.sl_ncastles.value

end
wesnoth.show_dialog(dialog_wml, preshow, postshow)
gui.show_dialog(dialog_wml, preshow, postshow)
end

0 comments on commit 0e1b968

Please sign in to comment.