1 /*
2    Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
3    Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY.
11 
12    See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 #include "tstring.hpp"
18 
19 #include <vector>
20 #include <string>
21 
22 class config;
23 
24 namespace about
25 {
26 struct credits_group
27 {
28 	struct about_group
29 	{
30 		explicit about_group(const config& cfg);
31 
32 		/** Contributor names. */
33 		std::vector<std::string> names;
34 
35 		/** The section title. */
36 		t_string title;
37 
38 		bool operator<(const about_group& o) const;
39 	};
40 
41 	credits_group(const config& cfg, bool is_campaign_credits);
42 
43 	/** The group's sub-groups. Corresponds to each [about] tag .*/
44 	std::vector<about_group> sections;
45 
46 	/** Optional group ID. Currently only used for identifying campaigns. */
47 	std::string id;
48 
49 	/** Optional group tite. Currently only used for identifying campaigns. */
50 	t_string header;
51 };
52 
53 using credits_data = std::vector<credits_group>;
54 
55 /**
56  * General getter methods for the credits config and image lists by campaign id
57  */
58 const credits_data& get_credits_data();
59 
60 std::vector<std::string> get_background_images(const std::string& campaign);
61 
62 /**
63  * Regenerates the credits config
64  */
65 void set_about(const config& cfg);
66 
67 }
68