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