The Battle for Wesnoth  1.15.12+dev
help.hpp
Go to the documentation of this file.
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 class config;
18 class terrain_type;
19 class unit;
20 class unit_type;
21 class CVideo;
22 class game_config_view;
23 
24 #include <string>
25 #include "utils/guard_value.hpp"
26 
27 namespace help {
28 
29 struct help_manager {
31  ~help_manager();
32 private:
34 };
35 
36 struct section;
37 /**
38  * Open a help dialog using a toplevel other than the default. This
39  * allows for complete customization of the contents, although not in a
40  * very easy way.
41  */
42 void show_help(const section &toplevel, const std::string& show_topic="",
43  int xloc=-1, int yloc=-1);
44 
45 /**
46  * Open the help browser. The help browser will have the topic with id
47  * show_topic open if it is not the empty string. The default topic
48  * will be shown if show_topic is the empty string.
49  */
50 void show_help(const std::string& show_topic="", int xloc=-1, int yloc=-1);
51 
52 /** wrapper to add unit prefix and hiding symbol */
53 void show_unit_help(const std::string& unit_id, bool has_variations=false,
54  bool hidden = false, int xloc=-1, int yloc=-1);
55 
56 /** wrapper to add variation prefix and hiding symbol */
57 void show_variation_help(const std::string &unit_id, const std::string &variation,
58  bool hidden = false, int xloc=-1, int yloc=-1);
59 
60 /** wrapper to add terrain prefix and hiding symbol */
61 void show_terrain_help(const std::string& unit_id, bool hidden = false,
62  int xloc = -1, int yloc = -1);
63 
64 void show_unit_description(const unit_type &t);
65 void show_unit_description(const unit &u);
67 
68 } // End namespace help.
void show_help(const std::string &show_topic, int xloc, int yloc)
Open the help browser, show topic with id show_topic.
Definition: help.cpp:112
This class represents a single unit of a specific type.
Definition: unit.hpp:120
void show_terrain_description(const terrain_type &t)
Definition: help.cpp:62
A section contains topics and sections along with title and ID.
Definition: help_impl.hpp:145
Definition: video.hpp:31
A single unit type that the player may recruit.
Definition: types.hpp:44
void show_terrain_help(const std::string &show_topic, bool hidden, int xloc, int yloc)
Open the help browser, show terrain with id terrain_id.
Definition: help.cpp:133
void show_unit_description(const unit &u)
Definition: help.cpp:57
Data-based RAII scope guard.
Definition: guard_value.hpp:23
utils::guard_value< const game_config_view * > guard
Definition: help.hpp:33
Game configuration data as global variables.
Definition: build_info.cpp:58
void show_unit_help(const std::string &show_topic, bool has_variations, bool hidden, int xloc, int yloc)
Open the help browser, show unit with id unit_id.
Definition: help.cpp:122
help_manager(const game_config_view *game_config)
Definition: help.cpp:91
double t
Definition: astarsearch.cpp:64
Definition: help.cpp:55
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:59
void show_variation_help(const std::string &unit, const std::string &variation, bool hidden, int xloc, int yloc)
Open the help browser, show the variation of the unit matching.
Definition: help.cpp:141