Take care of proper palette selection report.

This commit is contained in:
fendrin 2013-05-17 02:14:17 +02:00
parent 41ccede02b
commit b106255fed

View file

@ -51,29 +51,33 @@ static bool is_valid_terrain(const t_translation::t_terrain & c) {
void terrain_palette::update_report()
{
std::ostringstream msg;
msg << _("FG: ") << map().get_terrain_editor_string(selected_fg_item())
<< '\n' << _("BG: ") << map().get_terrain_editor_string(selected_fg_item());
msg << _("FG: ") << map().get_terrain_editor_string(selected_fg_item()) << " | "
<< _("BG: ") << map().get_terrain_editor_string(selected_bg_item());
selected_terrain = msg.str();
}
void terrain_palette::select_bg_item(const std::string& item_id) {
editor_palette<t_translation::t_terrain>::select_bg_item(item_id);
bg_terrain = editor_palette<t_translation::t_terrain>::selected_bg_item();
update_report();
}
void terrain_palette::select_fg_item(const std::string& item_id) {
editor_palette<t_translation::t_terrain>::select_fg_item(item_id);
fg_terrain = editor_palette<t_translation::t_terrain>::selected_fg_item();
update_report();
}
void terrain_palette::select_bg_item(const t_translation::t_terrain& terrain) {
editor_palette<t_translation::t_terrain>::select_bg_item(get_id(terrain));
bg_terrain = terrain;
update_report();
}
void terrain_palette::select_fg_item(const t_translation::t_terrain& terrain) {
editor_palette<t_translation::t_terrain>::select_fg_item(get_id(terrain));
fg_terrain = terrain;
update_report();
}
@ -90,7 +94,6 @@ void terrain_palette::setup(const config& cfg)
BOOST_FOREACH(const config &g, cfg.child_range("editor_group"))
{
if (group_names.find(g["id"]) == group_names.end()) {
config item;
config cfg;
cfg["id"] = g["id"];