20 #define GETTEXT_DOMAIN "wesnoth-help"
41 #include "widgets/button.hpp"
51 #define WRN_DP LOG_STREAM(warn, log_display)
54 #define WRN_HP LOG_STREAM(warn, log_help)
55 #define DBG_HP LOG_STREAM(debug, log_help)
73 var_id = t.
get_cfg()[
"variation_name"].str();
75 bool use_variation =
false;
76 if (!var_id.empty()) {
96 game_cfg = cfg ==
nullptr ? &dummy_cfg : cfg;
178 if (yloc <= -1 || xloc <= -1) {
179 xloc = scr->w / 2 - width / 2;
180 yloc = scr->h / 2 - height / 2;
182 std::vector<gui::button*> buttons_ptr;
184 buttons_ptr.push_back(&close_button_);
188 f.
layout(xloc, yloc, width, height);
207 hb.
set_location(xloc + left_padding, yloc + top_padding);
208 hb.
set_width(width - left_padding - right_padding);
209 hb.
set_height(height - top_padding - bot_padding);
210 if (show_topic !=
"") {
224 if (key[SDLK_ESCAPE]) {
229 button_it != buttons_ptr.end(); ++button_it) {
230 if ((*button_it)->pressed()) {
240 std::stringstream
msg;
241 msg <<
_(
"Parse error when parsing help text: ") <<
"'" << e.
message <<
"'";
void show_help(CVideo &video, const std::string &show_topic, int xloc, int yloc)
Open the help browser, show topic with id show_topic.
const std::string unit_prefix
static const style default_style
A section contains topics and sections along with title and ID.
int relative_size(int size)
Thrown when the help system fails to parse something.
bool hide_in_editor() const
void build_all(unit_type::BUILD_STATUS status)
Makes sure the all unit_types are built to the specified level.
unit_type_data unit_types
const std::string & id() const
void show_transient_message(CVideo &video, const std::string &title, const std::string &message, const std::string &image, const bool message_use_markup, const bool title_use_markup, const bool restore_background)
Shows a transient message to the user.
void show_unit_description(CVideo &video, const unit &u)
const std::string terrain_prefix
int last_num_encountered_terrains
Definitions for the interface to Wesnoth Markup Language (WML).
help::section hidden_sections
const unit_type & type() const
The type of the unit (accounting for gender and variation).
dimension_measurements layout(int x, int y, int w, int h)
help_manager(const config *game_config)
static UNUSEDNOWARN std::string _(const char *str)
std::string hidden_symbol(bool hidden)
std::set< t_translation::t_terrain > & encountered_terrains()
bool show_variations_in_help() const
Whether the unit type has at least one help-visible variation.
static lg::log_domain log_display("display")
void show_terrain_description(CVideo &video, const terrain_type &t)
void raise_process_event()
const std::string variation_prefix
void show_topic(const std::string &topic_id)
Display the topic with the specified identifier.
int last_num_encountered_units
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
std::set< std::string > & encountered_units()
const config & get_cfg() const
GLint GLint GLint GLint GLint GLint GLsizei GLsizei height
void show_variation_help(CVideo &video, 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.
const std::string default_show_topic
void generate_contents()
Generate the help contents from the configurations given to the manager.
Standard logging facilities (interface).
static void delay(unsigned int milliseconds)
const unit_type * find(const std::string &key, unit_type::BUILD_STATUS status=unit_type::FULL) const
Finds a unit_type by its id() and makes sure it is built to the specified level.
void show_unit_help(CVideo &video, const std::string &show_topic, bool has_variations, bool hidden, int xloc, int yloc)
Open the help browser, show unit with id unit_id.
GLint GLint GLint GLint GLint GLint GLsizei width
void show_terrain_help(CVideo &video, const std::string &show_topic, bool hidden, int xloc, int yloc)
Open the help browser, show terrain with id terrain_id.
A config object defines a single node in a WML file, with access to child nodes.
Class that keeps track of all the keys on the keyboard.
GLsizei const GLcharARB ** string
const std::string & id() const
The id for this unit_type.
static lg::log_domain log_help("help")