mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-14 16:32:09 +00:00
pick_advance: Use the correct team colour settings
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)
This commit is contained in:
parent
bb6ef63f0f
commit
a426d9fa5f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user