GUI2: make use of utils::bullet_list

Might be able to use this in more places but these were the obvious ones.
This commit is contained in:
Charles Dang 2024-10-12 16:35:06 -04:00
parent dfa8db1f72
commit 7c042e41b2
2 changed files with 4 additions and 12 deletions

View file

@ -150,12 +150,10 @@ void faction_select::on_faction_select()
on_leader_select();
// Print recruits
const std::vector<std::string> recruit_list = utils::split(flg_manager_.current_faction()["recruit"]);
std::vector<t_string> recruit_names;
for(const auto& recruit : recruit_list) {
for(const auto& recruit : utils::split(flg_manager_.current_faction()["recruit"])) {
if(const unit_type* rt = unit_types.find(recruit)) {
recruit_names.push_back(font::unicode_bullet + " " + rt->type_name());
recruit_names.push_back(rt->type_name());
}
}
@ -163,7 +161,7 @@ void faction_select::on_faction_select()
return translation::compare(s1, s2) < 0;
});
find_widget<styled_widget>("recruits").set_label(utils::join(recruit_names, "\n"));
find_widget<styled_widget>("recruits").set_label(utils::bullet_list(recruit_names, 0));
}
void faction_select::on_leader_select()

View file

@ -47,13 +47,7 @@ void terrain_layers::pre_show()
//
// List terrain flags
//
std::vector<std::string> flags(tile_->flags.begin(), tile_->flags.end());
for(auto& flag : flags) {
flag = (formatter() << font::unicode_bullet << " " << flag).str();
}
find_widget<label>("flags").set_label(utils::join(flags, "\n"));
find_widget<label>("flags").set_label(utils::bullet_list(tile_->flags, 0));
//
// Generate terrain list