Use std::map::emplace in all dialogs when applicable
This commit is contained in:
parent
b5ec03c81b
commit
bf734e3289
24 changed files with 94 additions and 91 deletions
|
@ -195,7 +195,7 @@ void taddon_filter_options::pre_show(twindow& window)
|
|||
string_map column;
|
||||
|
||||
column["label"] = status_label(ADDON_STATUS_FILTER(k));
|
||||
row.insert(std::make_pair("status", column));
|
||||
row.emplace("status", column);
|
||||
|
||||
list.add_row(row);
|
||||
}
|
||||
|
|
|
@ -327,30 +327,31 @@ void taddon_list::pre_show(twindow& window)
|
|||
std::map<std::string, string_map> data;
|
||||
string_map item;
|
||||
|
||||
item["use_markup"] = "true";
|
||||
|
||||
item["label"] = info.display_icon();
|
||||
data.insert(std::make_pair("icon", item));
|
||||
data.emplace("icon", item);
|
||||
|
||||
item["label"] = info.display_title();
|
||||
data.insert(std::make_pair("name", item));
|
||||
data.emplace("name", item);
|
||||
|
||||
item["label"] = describe_status_simple(tracking_info_[info.id]);
|
||||
item["use_markup"] = "true";
|
||||
data.insert(std::make_pair("installation_status", item));
|
||||
data.emplace("installation_status", item);
|
||||
|
||||
item["label"] = info.version.str();
|
||||
data.insert(std::make_pair("version", item));
|
||||
data.emplace("version", item);
|
||||
|
||||
item["label"] = info.author;
|
||||
data.insert(std::make_pair("author", item));
|
||||
data.emplace("author", item);
|
||||
|
||||
item["label"] = size_display_string(info.size);
|
||||
data.insert(std::make_pair("size", item));
|
||||
data.emplace("size", item);
|
||||
|
||||
item["label"] = std::to_string(info.downloads);
|
||||
data.insert(std::make_pair("downloads", item));
|
||||
data.emplace("downloads", item);
|
||||
|
||||
item["label"] = info.display_type();
|
||||
data.insert(std::make_pair("type", item));
|
||||
data.emplace("type", item);
|
||||
|
||||
list.add_row(data);
|
||||
|
||||
|
|
|
@ -73,7 +73,8 @@ void taddon_uninstall_list::pre_show(twindow& window)
|
|||
string_map column;
|
||||
|
||||
column["label"] = title;
|
||||
data.insert(std::make_pair("name", column));
|
||||
data.emplace("name", column);
|
||||
|
||||
list.add_row(data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,10 +168,10 @@ void tcampaign_selection::pre_show(twindow& window)
|
|||
detail_item["text_alignment"] = campaign["description_alignment"];
|
||||
}
|
||||
|
||||
detail_page.insert(std::make_pair("description", detail_item));
|
||||
detail_page.emplace("description", detail_item);
|
||||
|
||||
detail_item["label"] = campaign["image"];
|
||||
detail_page.insert(std::make_pair("image", detail_item));
|
||||
detail_page.emplace("image", detail_item);
|
||||
|
||||
multi_page.add_page(detail_page);
|
||||
}
|
||||
|
@ -237,10 +237,10 @@ void tcampaign_selection::pre_show(twindow& window)
|
|||
std::map<std::string, string_map> list_item_item;
|
||||
|
||||
list_item["label"] = campaign["icon"];
|
||||
list_item_item.insert(std::make_pair("icon", list_item));
|
||||
list_item_item.emplace("icon", list_item);
|
||||
|
||||
list_item["label"] = campaign["name"];
|
||||
list_item_item.insert(std::make_pair("name", list_item));
|
||||
list_item_item.emplace("name", list_item);
|
||||
|
||||
list.add_row(list_item_item);
|
||||
|
||||
|
@ -256,12 +256,13 @@ void tcampaign_selection::pre_show(twindow& window)
|
|||
string_map detail_item;
|
||||
std::map<std::string, string_map> detail_page;
|
||||
|
||||
detail_item["label"] = campaign["description"];
|
||||
detail_item["use_markup"] = "true";
|
||||
detail_page.insert(std::make_pair("description", detail_item));
|
||||
|
||||
detail_item["label"] = campaign["description"];
|
||||
detail_page.emplace("description", detail_item);
|
||||
|
||||
detail_item["label"] = campaign["image"];
|
||||
detail_page.insert(std::make_pair("image", detail_item));
|
||||
detail_page.emplace("image", detail_item);
|
||||
|
||||
multi_page.add_page(detail_page);
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ void tcampaign_settings::update_lists(twindow& window)
|
|||
string_map column;
|
||||
|
||||
column["label"] = era;
|
||||
row.insert(std::make_pair("era", column));
|
||||
row.emplace("era", column);
|
||||
|
||||
era_list.add_row(row);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ void tcampaign_settings::update_lists(twindow& window)
|
|||
string_map column;
|
||||
|
||||
column["label"] = mod->name;
|
||||
row.insert(std::make_pair("mod", column));
|
||||
row.emplace("mod", column);
|
||||
|
||||
mod_list.add_row(row);
|
||||
|
||||
|
|
|
@ -110,10 +110,10 @@ void tcore_selection::pre_show(twindow& window)
|
|||
std::map<std::string, string_map> list_item_item;
|
||||
|
||||
list_item["label"] = core["image"];
|
||||
list_item_item.insert(std::make_pair("image", list_item));
|
||||
list_item_item.emplace("image", list_item);
|
||||
|
||||
list_item["label"] = core["name"];
|
||||
list_item_item.insert(std::make_pair("name", list_item));
|
||||
list_item_item.emplace("name", list_item);
|
||||
|
||||
list.add_row(list_item_item);
|
||||
|
||||
|
@ -126,7 +126,7 @@ void tcore_selection::pre_show(twindow& window)
|
|||
|
||||
detail_item["label"] = core["description"];
|
||||
detail_item["use_markup"] = "true";
|
||||
detail_page.insert(std::make_pair("description", detail_item));
|
||||
detail_page.emplace("description", detail_item);
|
||||
|
||||
multi_page.add_page(detail_page);
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ void tdebug_clock::update_time(const bool force)
|
|||
string_map item;
|
||||
|
||||
item["label"] = std::to_string(second_stamp);
|
||||
item_data.insert(std::make_pair("time", item));
|
||||
item_data.emplace("time", item);
|
||||
|
||||
if(pane_) {
|
||||
pane_->create_item(item_data, tags);
|
||||
|
|
|
@ -84,7 +84,7 @@ void teditor_set_starting_position::pre_show(twindow& window)
|
|||
string_map column;
|
||||
|
||||
column["label"] = _("player^None");
|
||||
data.insert(std::make_pair("player", column));
|
||||
data.emplace("player", column);
|
||||
list.add_row(data);
|
||||
|
||||
for(unsigned i = 0; i < starting_positions_.size(); ++i) {
|
||||
|
@ -97,12 +97,12 @@ void teditor_set_starting_position::pre_show(twindow& window)
|
|||
|
||||
column["label"] = utils::interpolate_variables_into_string(
|
||||
_("Player $player_number"), &symbols);
|
||||
data.insert(std::make_pair("player", column));
|
||||
data.emplace("player", column);
|
||||
|
||||
if(player_pos.valid()) {
|
||||
column["label"] = (formatter() << "(" << player_pos.x + 1 << ", "
|
||||
<< player_pos.y + 1 << ")").str();
|
||||
data.insert(std::make_pair("location", column));
|
||||
data.emplace("location", column);
|
||||
}
|
||||
|
||||
list.add_row(data);
|
||||
|
|
|
@ -137,10 +137,10 @@ void tgame_load::pre_show(twindow& window)
|
|||
std::string name = game.name();
|
||||
utils::ellipsis_truncate(name, 50);
|
||||
item["label"] = name;
|
||||
data.insert({"filename", item});
|
||||
data.emplace("filename", item);
|
||||
|
||||
item["label"] = game.format_time_summary();
|
||||
data.insert({"date", item});
|
||||
data.emplace("date", item);
|
||||
|
||||
list.add_row(data);
|
||||
}
|
||||
|
|
|
@ -113,13 +113,13 @@ void tgame_stats::pre_show(twindow& window)
|
|||
column_stats["use_markup"] = "true";
|
||||
|
||||
column_stats["label"] = leader_image;
|
||||
row_data_stats.insert({"team_leader_image", column_stats});
|
||||
row_data_stats.emplace("team_leader_image", column_stats);
|
||||
|
||||
column_stats["label"] = leader_name;
|
||||
row_data_stats.insert({"team_leader_name", column_stats});
|
||||
row_data_stats.emplace("team_leader_name", column_stats);
|
||||
|
||||
column_stats["label"] = data.teamname.empty() ? team.team_name() : data.teamname;
|
||||
row_data_stats.insert({"team_name", column_stats});
|
||||
row_data_stats.emplace("team_name", column_stats);
|
||||
|
||||
// Only fill in the rest of the info if the side is known...
|
||||
if(known || game_config::debug) {
|
||||
|
@ -129,7 +129,7 @@ void tgame_stats::pre_show(twindow& window)
|
|||
}
|
||||
|
||||
column_stats["label"] = gold_str;
|
||||
row_data_stats.insert({"team_gold", column_stats});
|
||||
row_data_stats.emplace("team_gold", column_stats);
|
||||
|
||||
std::string village_count = std::to_string(data.villages);
|
||||
if(!viewing_team_.uses_fog() && !viewing_team_.uses_shroud()) {
|
||||
|
@ -137,17 +137,17 @@ void tgame_stats::pre_show(twindow& window)
|
|||
}
|
||||
|
||||
column_stats["label"] = village_count;
|
||||
row_data_stats.insert({"team_villages", column_stats});
|
||||
row_data_stats.emplace("team_villages", column_stats);
|
||||
|
||||
column_stats["label"] = std::to_string(data.units);
|
||||
row_data_stats.insert({"team_units", column_stats});
|
||||
row_data_stats.emplace("team_units", column_stats);
|
||||
|
||||
column_stats["label"] = std::to_string(data.upkeep);
|
||||
row_data_stats.insert({"team_upkeep", column_stats});
|
||||
row_data_stats.emplace("team_upkeep", column_stats);
|
||||
|
||||
const std::string income = utils::signed_value(data.net_income);
|
||||
column_stats["label"] = data.net_income < 0 ? "<span color='#ff0000'>" + income + "</span>" : income;
|
||||
row_data_stats.insert({"team_income", column_stats});
|
||||
row_data_stats.emplace("team_income", column_stats);
|
||||
}
|
||||
|
||||
stats_list.add_row(row_data_stats);
|
||||
|
@ -161,31 +161,31 @@ void tgame_stats::pre_show(twindow& window)
|
|||
column_settings["use_markup"] = "true";
|
||||
|
||||
column_settings["label"] = leader_image;
|
||||
row_data_settings.insert({"team_leader_image", column_settings});
|
||||
row_data_settings.emplace("team_leader_image", column_settings);
|
||||
|
||||
column_settings["label"] = leader_name;
|
||||
row_data_settings.insert({"team_leader_name", column_settings});
|
||||
row_data_settings.emplace("team_leader_name", column_settings);
|
||||
|
||||
column_settings["label"] = std::to_string(team.side());
|
||||
row_data_settings.insert({"team_side", column_settings});
|
||||
row_data_settings.emplace("team_side", column_settings);
|
||||
|
||||
column_settings["label"] = std::to_string(team.start_gold());
|
||||
row_data_settings.insert({"team_start_gold", column_settings});
|
||||
row_data_settings.emplace("team_start_gold", column_settings);
|
||||
|
||||
column_settings["label"] = std::to_string(team.base_income());
|
||||
row_data_settings.insert({"team_base_income", column_settings});
|
||||
row_data_settings.emplace("team_base_income", column_settings);
|
||||
|
||||
column_settings["label"] = std::to_string(team.village_gold());
|
||||
row_data_settings.insert({"team_village_gold", column_settings});
|
||||
row_data_settings.emplace("team_village_gold", column_settings);
|
||||
|
||||
column_settings["label"] = std::to_string(team.village_support());
|
||||
row_data_settings.insert({"team_village_support", column_settings});
|
||||
row_data_settings.emplace("team_village_support", column_settings);
|
||||
|
||||
column_settings["label"] = team.uses_fog() ? _("yes") : _("no");
|
||||
row_data_settings.insert({"team_fog", column_settings});
|
||||
row_data_settings.emplace("team_fog", column_settings);
|
||||
|
||||
column_settings["label"] = team.uses_shroud() ? _("yes") : _("no");;
|
||||
row_data_settings.insert({"team_shroud", column_settings});
|
||||
row_data_settings.emplace("team_shroud", column_settings);
|
||||
|
||||
settings_list.add_row(row_data_settings);
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ public:
|
|||
item["id"] = id;
|
||||
item["label"] = label;
|
||||
item["use_markup"] = colorize ? "true" : "false";
|
||||
data.insert(std::make_pair("name", item));
|
||||
data.emplace("name", item);
|
||||
stuff_list->add_row(data);
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ public:
|
|||
item["id"] = id;
|
||||
item["label"] = label;
|
||||
item["use_markup"] = colorize ? "true" : "false";
|
||||
data.insert(std::make_pair("typename", item));
|
||||
data.emplace("typename", item);
|
||||
stuff_types_list->add_row(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ void tlanguage_selection::pre_show(twindow& window)
|
|||
for(const auto & lang : languages)
|
||||
{
|
||||
string_map item;
|
||||
item.insert(std::make_pair("label", lang.language));
|
||||
item.emplace("label", lang.language);
|
||||
|
||||
list.add_row(item);
|
||||
if(lang == current_language) {
|
||||
|
|
|
@ -434,7 +434,7 @@ void add_label_data(std::map<std::string, string_map>& map,
|
|||
string_map item;
|
||||
item["label"] = label;
|
||||
item["use_markup"] = "true";
|
||||
map.insert(std::make_pair(key, item));
|
||||
map.emplace(key, item);
|
||||
}
|
||||
|
||||
void add_tooltip_data(std::map<std::string, string_map>& map,
|
||||
|
@ -443,7 +443,7 @@ void add_tooltip_data(std::map<std::string, string_map>& map,
|
|||
{
|
||||
string_map item;
|
||||
item["tooltip"] = label;
|
||||
map.insert(std::make_pair(key, item));
|
||||
map.emplace(key, item);
|
||||
}
|
||||
|
||||
void modify_grid_with_data(tgrid* grid,
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
item["id"] = std::string("side_") + std::to_string(side_num);
|
||||
item["label"] = label;
|
||||
item["use_markup"] = "true";
|
||||
data.insert(std::make_pair("side", item));
|
||||
data.emplace("side", item);
|
||||
sides_list->add_row(data);
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
item["id"] = nick;
|
||||
item["label"] = label;
|
||||
item["use_markup"] = "true";
|
||||
data.insert(std::make_pair("nick", item));
|
||||
data.emplace("nick", item);
|
||||
nicks_list->add_row(data);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -103,10 +103,10 @@ void tmp_server_list::pre_show(twindow& window)
|
|||
string_map item;
|
||||
|
||||
item["label"] = server.name;
|
||||
data.insert(std::make_pair("name", item));
|
||||
data.emplace("name", item);
|
||||
|
||||
item["label"] = server.address;
|
||||
data.insert(std::make_pair("address", item));
|
||||
data.emplace("address", item);
|
||||
|
||||
list.add_row(data);
|
||||
}
|
||||
|
|
|
@ -93,8 +93,8 @@ void tmp_create_game::pre_show(twindow& window)
|
|||
|
||||
// Load option (might turn it into a button later).
|
||||
string_map item;
|
||||
item.insert(std::make_pair("label", _("Load Game")));
|
||||
item.insert(std::make_pair("tooltip", _("Load Game...")));
|
||||
item.emplace("label", _("Load Game"));
|
||||
item.emplace("tooltip", _("Load Game..."));
|
||||
list.add_row(item);
|
||||
|
||||
// User maps
|
||||
|
@ -105,7 +105,7 @@ void tmp_create_game::pre_show(twindow& window)
|
|||
|
||||
for(const auto& map : maps) {
|
||||
std::map<std::string, t_string> item;
|
||||
item.insert(std::make_pair("label", map));
|
||||
item.emplace("label", map);
|
||||
list->add_row(item);
|
||||
}
|
||||
*/
|
||||
|
@ -116,8 +116,8 @@ void tmp_create_game::pre_show(twindow& window)
|
|||
{
|
||||
if(map["allow_new_game"].to_bool(true)) {
|
||||
string_map item;
|
||||
item.insert(std::make_pair("label", map["name"].str()));
|
||||
item.insert(std::make_pair("tooltip", map["name"].str()));
|
||||
item.emplace("label", map["name"].str());
|
||||
item.emplace("tooltip", map["name"].str());
|
||||
list.add_row(item);
|
||||
|
||||
// This hack is needed since the next item is too wide to fit.
|
||||
|
|
|
@ -89,7 +89,7 @@ void tsimple_item_selector::pre_show(twindow& window)
|
|||
string_map column;
|
||||
|
||||
column["label"] = it;
|
||||
data.insert(std::make_pair("item", column));
|
||||
data.emplace("item", column);
|
||||
|
||||
list.add_row(data);
|
||||
}
|
||||
|
|
|
@ -72,9 +72,9 @@ void ttheme_list::pre_show(twindow& window)
|
|||
}
|
||||
|
||||
column["label"] = theme_name;
|
||||
data.insert(std::make_pair("name", column));
|
||||
data.emplace("name", column);
|
||||
column["label"] = t.description;
|
||||
data.insert(std::make_pair("description", column));
|
||||
data.emplace("description", column);
|
||||
|
||||
list.add_row(data);
|
||||
}
|
||||
|
|
|
@ -91,10 +91,10 @@ void tunit_advance::pre_show(twindow& window)
|
|||
}
|
||||
|
||||
column["label"] = image_string;
|
||||
row_data.insert({"advancement_image", column});
|
||||
row_data.emplace("advancement_image", column);
|
||||
|
||||
column["label"] = name;
|
||||
row_data.insert({"advancement_name", column});
|
||||
row_data.emplace("advancement_name", column);
|
||||
|
||||
list.add_row(row_data);
|
||||
}
|
||||
|
|
|
@ -152,19 +152,19 @@ static void set_weapon_info(twindow& window,
|
|||
item["use_markup"] = "true";
|
||||
|
||||
item["label"] = attacker_weapon.icon();
|
||||
data.insert({"attacker_weapon_icon", item});
|
||||
data.emplace("attacker_weapon_icon", item);
|
||||
|
||||
item["label"] = attacker_stats.str();
|
||||
data.insert({"attacker_weapon", item});
|
||||
data.emplace("attacker_weapon", item);
|
||||
|
||||
item["label"] = "<span color='#a69275'>" + utils::unicode_em_dash + " " + range + " " + utils::unicode_em_dash + "</span>";
|
||||
data.insert({"range", item});
|
||||
data.emplace("range", item);
|
||||
|
||||
item["label"] = defender_stats.str();
|
||||
data.insert({"defender_weapon", item});
|
||||
data.emplace("defender_weapon", item);
|
||||
|
||||
item["label"] = defender_weapon.icon();
|
||||
data.insert({"defender_weapon_icon", item});
|
||||
data.emplace("defender_weapon_icon", item);
|
||||
|
||||
weapon_list.add_row(data);
|
||||
}
|
||||
|
|
|
@ -142,10 +142,10 @@ void tunit_create::pre_show(twindow& window)
|
|||
string_map column;
|
||||
|
||||
column["label"] = units_.back()->race()->plural_name();
|
||||
row_data.insert({"race", column});
|
||||
row_data.emplace("race", column);
|
||||
|
||||
column["label"] = units_.back()->type_name();
|
||||
row_data.insert({"unit_type", column});
|
||||
row_data.emplace("unit_type", column);
|
||||
|
||||
list.add_row(row_data);
|
||||
|
||||
|
|
|
@ -125,33 +125,33 @@ void tunit_list::pre_show(twindow& window)
|
|||
column["use_markup"] = "true";
|
||||
|
||||
column["label"] = format_if_leader(unit, unit->type_name());
|
||||
row_data.insert({"unit_type", column});
|
||||
row_data.emplace("unit_type", column);
|
||||
|
||||
const std::string& name = !unit->name().empty() ? format_if_leader(unit, unit->name().str()) : utils::unicode_en_dash;
|
||||
column["label"] = name;
|
||||
row_data.insert({"unit_name", column});
|
||||
row_data.emplace("unit_name", column);
|
||||
|
||||
column["label"] = format_movement_string(unit);
|
||||
row_data.insert({"unit_moves", column});
|
||||
row_data.emplace("unit_moves", column);
|
||||
|
||||
std::stringstream hp_str;
|
||||
hp_str << font::span_color(unit->hp_color()) << unit->hitpoints() << "/" << unit->max_hitpoints() << "</span>";
|
||||
|
||||
column["label"] = hp_str.str();
|
||||
row_data.insert({"unit_hp", column});
|
||||
row_data.emplace("unit_hp", column);
|
||||
|
||||
column["label"] = format_level_string(unit->level());
|
||||
row_data.insert({"unit_level", column});
|
||||
row_data.emplace("unit_level", column);
|
||||
|
||||
std::stringstream exp_str;
|
||||
exp_str << font::span_color(unit->xp_color()) << unit->experience() << "/"
|
||||
<< (unit->can_advance() ? std::to_string(unit->max_experience()) : utils::unicode_en_dash) << "</span>";
|
||||
|
||||
column["label"] = exp_str.str();
|
||||
row_data.insert({"unit_experience", column});
|
||||
row_data.emplace("unit_experience", column);
|
||||
|
||||
column["label"] = utils::join(unit->trait_names(), ", ");
|
||||
row_data.insert({"unit_traits", column});
|
||||
row_data.emplace("unit_traits", column);
|
||||
|
||||
list.add_row(row_data);
|
||||
|
||||
|
|
|
@ -189,27 +189,27 @@ void tunit_recall::pre_show(twindow& window)
|
|||
column["use_markup"] = "true";
|
||||
|
||||
column["label"] = unit->absolute_image() + mods;
|
||||
row_data.insert({"unit_image", column});
|
||||
row_data.emplace("unit_image", column);
|
||||
|
||||
column["label"] = unit->type_name();
|
||||
row_data.insert({"unit_type", column});
|
||||
row_data.emplace("unit_type", column);
|
||||
|
||||
column["label"] = format_cost_string(unit->recall_cost(), team_.recall_cost());
|
||||
row_data.insert({"unit_recall_cost", column});
|
||||
row_data.emplace("unit_recall_cost", column);
|
||||
|
||||
const std::string& name = !unit->name().empty() ? unit->name().str() : utils::unicode_en_dash;
|
||||
column["label"] = name;
|
||||
row_data.insert({"unit_name", column});
|
||||
row_data.emplace("unit_name", column);
|
||||
|
||||
column["label"] = format_level_string(unit->level());
|
||||
row_data.insert({"unit_level", column});
|
||||
row_data.emplace("unit_level", column);
|
||||
|
||||
std::stringstream exp_str;
|
||||
exp_str << font::span_color(unit->xp_color()) << unit->experience() << "/"
|
||||
<< (unit->can_advance() ? std::to_string(unit->max_experience()) : utils::unicode_en_dash) << "</span>";
|
||||
|
||||
column["label"] = exp_str.str();
|
||||
row_data.insert({"unit_experience", column});
|
||||
row_data.emplace("unit_experience", column);
|
||||
|
||||
// Since the table widgets use heavy formatting, we save a bare copy
|
||||
// of certain options to filter on.
|
||||
|
@ -222,7 +222,7 @@ void tunit_recall::pre_show(twindow& window)
|
|||
}
|
||||
|
||||
column["label"] = !traits.empty() ? traits : utils::unicode_en_dash;
|
||||
row_data.insert({"unit_traits", column});
|
||||
row_data.emplace("unit_traits", column);
|
||||
|
||||
list.add_row(row_data);
|
||||
filter_options_.push_back(filter_text);
|
||||
|
|
|
@ -95,16 +95,16 @@ void tunit_recruit::pre_show(twindow& window)
|
|||
|
||||
const std::string cost_string = std::to_string(recruit->cost());
|
||||
|
||||
column["use_markup"] = "true";
|
||||
|
||||
column["label"] = image_string;
|
||||
row_data.insert({"unit_image", column});
|
||||
row_data.emplace("unit_image", column);
|
||||
|
||||
column["label"] = can_afford_unit(recruit->type_name(), can_afford);
|
||||
column["use_markup"] = "true";
|
||||
row_data.insert({"unit_type", column});
|
||||
row_data.emplace("unit_type", column);
|
||||
|
||||
column["label"] = can_afford_unit(cost_string, can_afford);
|
||||
column["use_markup"] = "true";
|
||||
row_data.insert({"unit_cost", column});
|
||||
row_data.emplace("unit_cost", column);
|
||||
|
||||
list.add_row(row_data);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue