The Battle for Wesnoth  1.15.3+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 
26 namespace help {
27 
28 struct help_manager {
30  ~help_manager();
31 };
32 
33 struct section;
34 /// Open a help dialog using a toplevel other than the default. This
35 /// allows for complete customization of the contents, although not in a
36 /// very easy way.
37 void show_help(const section &toplevel, const std::string& show_topic="",
38  int xloc=-1, int yloc=-1);
39 
40 /// Open the help browser. The help browser will have the topic with id
41 /// show_topic open if it is not the empty string. The default topic
42 /// will be shown if show_topic is the empty string.
43 void show_help(const std::string& show_topic="", int xloc=-1, int yloc=-1);
44 
45 /// wrapper to add unit prefix and hiding symbol
46 void show_unit_help(const std::string& unit_id, bool has_variations=false,
47  bool hidden = false, int xloc=-1, int yloc=-1);
48 
49 /// wrapper to add variation prefix and hiding symbol
50 void show_variation_help(const std::string &unit_id, const std::string &variation,
51  bool hidden = false, int xloc=-1, int yloc=-1);
52 
53 /// wrapper to add terrain prefix and hiding symbol
54 void show_terrain_help(const std::string& unit_id, bool hidden = false,
55  int xloc = -1, int yloc = -1);
56 
57 void show_unit_description(const unit_type &t);
58 void show_unit_description(const unit &u);
60 
61 } // 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:114
This class represents a single unit of a specific type.
Definition: unit.hpp:129
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:142
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:135
void show_unit_description(const unit &u)
Definition: help.cpp:57
Game configuration data as global variables.
Definition: build_info.cpp:55
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:124
help_manager(const game_config_view *game_config)
Definition: help.cpp:90
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:68
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:143