Skip to content

Commit

Permalink
Parsed contributor comments too
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Oct 4, 2020
1 parent 116687c commit 762f476
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/about.cpp
Expand Up @@ -15,9 +15,9 @@
#include "about.hpp"

#include "config.hpp"
#include "game_config_view.hpp"
#include "gettext.hpp"
#include "serialization/string_utils.hpp"
#include "game_config_view.hpp"

#include <map>

Expand All @@ -41,7 +41,7 @@ void gather_images(const config& from, std::vector<std::string>& to)
}
}

} // end anon namespace
} // namespace

credits_group::credits_group(const config& cfg, bool is_campaign_credits)
: sections()
Expand Down Expand Up @@ -81,7 +81,7 @@ credits_group::about_group::about_group(const config& cfg)
names.reserve(cfg.child_count("entry"));

for(const config& entry : cfg.child_range("entry")) {
names.push_back(entry["name"].str());
names.emplace_back(entry["name"].str(), entry["comment"].str());
}
}

Expand All @@ -97,7 +97,7 @@ const credits_data& get_credits_data()

std::vector<std::string> get_background_images(const std::string& campaign)
{
if(!campaign.empty() && !images_campaigns[campaign].empty()){
if(!campaign.empty() && !images_campaigns[campaign].empty()) {
return images_campaigns[campaign];
}

Expand Down
6 changes: 3 additions & 3 deletions src/about.hpp
Expand Up @@ -16,8 +16,8 @@

#include "tstring.hpp"

#include <vector>
#include <string>
#include <vector>

class config;
class game_config_view;
Expand All @@ -31,7 +31,7 @@ struct credits_group
explicit about_group(const config& cfg);

/** Contributor names. */
std::vector<std::string> names;
std::vector<std::pair<std::string, std::string>> names;

/** The section title. */
t_string title;
Expand Down Expand Up @@ -65,4 +65,4 @@ std::vector<std::string> get_background_images(const std::string& campaign);
*/
void set_about(const game_config_view& cfg);

}
} // namespace about
4 changes: 2 additions & 2 deletions src/gui/dialogs/end_credits.cpp
Expand Up @@ -73,8 +73,8 @@ void end_credits::pre_show(window& window)
for(const about::credits_group::about_group& about : group.sections) {
group_stream << "\n" << "<span size='x-large'>" << about.title << "</span>" << "\n";

for(const std::string& entry : about.names) {
group_stream << entry << "\n";
for(const auto& entry : about.names) {
group_stream << entry.first << "\n";
}
}
}
Expand Down

0 comments on commit 762f476

Please sign in to comment.