The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
about.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2003 - 2025
3 by David White <dave@whitevine.net>
4 Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY.
12
13 See the COPYING file for more details.
14*/
15
16#pragma once
17
18#include "tstring.hpp"
19
21#include <string>
22#include <utility>
23#include <vector>
24
25class config;
27
28namespace about
29{
31{
33 {
34 explicit about_group(const config& cfg);
35
36 /** Contributor names. */
37 std::vector<std::pair<std::string, std::string>> names;
38
39 /** The section title. */
41
42 bool operator<(const about_group& o) const;
43 };
44
45 credits_group(const config& cfg, bool is_campaign_credits);
46
47 /** The group's sub-groups. Corresponds to each [about] tag .*/
48 std::vector<about_group> sections;
49
50 /** Optional group ID. Currently only used for identifying campaigns. */
51 std::string id;
52
53 /** Optional group title. Currently only used for identifying campaigns. */
55};
56
57using credits_data = std::vector<credits_group>;
58
59/** Gets all credits data. */
61
62/** Gets credits for a given campaign. Returns a null optional if that campaign has no credits. */
63utils::optional<credits_data::const_iterator> get_campaign_credits(const std::string& campaign);
64
65/** Gets credit background images for a given campaign. */
66std::vector<std::string> get_background_images(const std::string& campaign);
67
68/** Regenerates the credits data. */
69void set_about(const game_config_view& cfg);
70
71} // namespace about
A config object defines a single node in a WML file, with access to child nodes.
Definition config.hpp:157
A class grating read only view to a vector of config objects, viewed as one config with all children ...
const config * cfg
Display credits about all contributors.
std::vector< credits_group > credits_data
Definition about.hpp:57
utils::optional< credits_data::const_iterator > get_campaign_credits(const std::string &campaign)
Gets credits for a given campaign.
Definition about.cpp:100
void set_about(const game_config_view &cfg)
Regenerates the credits data.
Definition about.cpp:119
std::vector< std::string > get_background_images(const std::string &campaign)
Gets credit background images for a given campaign.
Definition about.cpp:106
const credits_data & get_credits_data()
Gets all credits data.
Definition about.cpp:95
bool operator<(const about_group &o) const
Definition about.cpp:90
std::vector< std::pair< std::string, std::string > > names
Contributor names.
Definition about.hpp:37
t_string title
The section title.
Definition about.hpp:40
t_string header
Optional group title.
Definition about.hpp:54
std::string id
Optional group ID.
Definition about.hpp:51
std::vector< about_group > sections
The group's sub-groups.
Definition about.hpp:48