Skip to content

Commit

Permalink
pick_advance: Use the correct team colour settings
Browse files Browse the repository at this point in the history
Also removed a listbox selection callback that serves no purpose beyond
re-setting the selection's icon to what it already is. Weird code.

(CC #5555)
  • Loading branch information
irydacea committed Feb 17, 2021
1 parent bb6ef63 commit a426d9f
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions data/modifications/pick_advance/dialog.lua
Expand Up @@ -161,19 +161,15 @@ function pickadvance.show_dialog_unsynchronized(advance_info, unit)
end
wesnoth.set_dialog_value(text, "the_list", i, "the_label")
local img = advance_type.__cfg.image
wesnoth.set_dialog_value(img or "misc/blank-hex.png", "the_list", i, "the_icon")
if img then
img = ("%s~TC(%d,%s)"):format(img, unit.side, advance_type.__cfg.flag_rgb or "magenta")
else
img = "misc/blank-hex.png"
end
wesnoth.set_dialog_value(img, "the_list", i, "the_icon")
end

wesnoth.set_dialog_focus("the_list")

local function select()
local i = wesnoth.get_dialog_value "the_list"
if i > 0 then
local img = options[i].__cfg.image
wesnoth.set_dialog_value(img or "misc/blank-hex.png", "the_list", i, "the_icon")
end
end
wesnoth.set_dialog_callback(select, "the_list")
end

-- dialog postshow function
Expand Down

0 comments on commit a426d9f

Please sign in to comment.