Classes | |
class | has_id |
To be used as a function object to locate sections and topics with a specified ID. More... | |
class | help_browser |
A help browser widget. More... | |
struct | help_manager |
class | help_menu |
The menu to the left in the help browser, where topics can be navigated through and chosen. More... | |
class | help_text_area |
The area where the content is shown in the help browser. More... | |
struct | parse_error |
Thrown when the help system fails to parse something. More... | |
struct | section |
A section contains topics and sections along with title and ID. More... | |
class | section_less |
To be used as a function object when sorting section lists on the title. More... | |
class | string_less |
struct | terrain_movement_info |
class | terrain_topic_generator |
class | text_topic_generator |
class | title_less |
To be used as a function object when sorting topic lists on the title. More... | |
struct | topic |
A topic contains a title, an id and some text. More... | |
class | topic_generator |
Generate a topic text on the fly. More... | |
class | topic_text |
The text displayed in a topic. More... | |
class | unit_topic_generator |
Typedefs | |
typedef std::list< section > | section_list |
typedef std::list< topic > | topic_list |
typedef std::pair< std::string, unsigned > | item |
typedef std::vector< std::vector< help::item > > | table_spec |
typedef t_translation::ter_list::const_iterator | ter_iter |
typedef std::pair< std::string, std::string > | trait_data |
Enumerations | |
enum | UNIT_DESCRIPTION_TYPE { FULL_DESCRIPTION, NO_DESCRIPTION, HIDDEN_BUT_SHOW_MACROS } |
Functions | |
void | show_unit_description (const unit &u) |
void | show_terrain_description (const terrain_type &t) |
void | show_unit_description (const unit_type &t) |
void | show_help (const std::string &show_topic, int xloc, int yloc) |
Open the help browser, show topic with id show_topic. More... | |
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. More... | |
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. More... | |
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. More... | |
void | show_help (const section &toplevel_sec, const std::string &show_topic, int xloc, int yloc) |
Open a help dialog using a toplevel other than the default. More... | |
bool | section_is_referenced (const std::string §ion_id, const config &cfg) |
Return true if the section with id section_id is referenced from another section in the config, or the toplevel. More... | |
bool | topic_is_referenced (const std::string &topic_id, const config &cfg) |
Return true if the topic with id topic_id is referenced from another section in the config, or the toplevel. More... | |
void | parse_config_internal (const config *help_cfg, const config *section_cfg, section &sec, int level=0) |
Recursive function used by parse_config. More... | |
section | parse_config (const config *cfg) |
Parse a help config, return the top level section. More... | |
std::vector< topic > | generate_topics (const bool sort_generated, const std::string &generator) |
void | generate_sections (const config *help_cfg, const std::string &generator, section &sec, int level) |
Dispatch generators to their appropriate functions. More... | |
std::string | generate_topic_text (const std::string &generator, const config *help_cfg, const section &sec, const std::vector< topic > &generated_topics) |
std::string | time_of_day_bonus_colored (const int time_of_day_bonus) |
std::vector< topic > | generate_time_of_day_topics (const bool) |
std::vector< topic > | generate_weapon_special_topics (const bool sort_generated) |
std::vector< topic > | generate_ability_topics (const bool sort_generated) |
std::vector< topic > | generate_era_topics (const bool sort_generated, const std::string &era_id) |
std::vector< topic > | generate_faction_topics (const config &era, const bool sort_generated) |
std::vector< topic > | generate_trait_topics (const bool sort_generated) |
std::string | make_unit_link (const std::string &type_id) |
return a hyperlink with the unit's name and pointing to the unit page return empty string if this unit is hidden. More... | |
std::vector< std::string > | make_unit_links_list (const std::vector< std::string > &type_id_list, bool ordered=false) |
return a list of hyperlinks to unit's pages (ordered or not) More... | |
void | generate_races_sections (const config *help_cfg, section &sec, int level) |
void | generate_era_sections (const config *help_cfg, section &sec, int level) |
void | generate_terrain_sections (section &sec, int) |
void | generate_unit_sections (const config *, section &sec, int, const bool, const std::string &race) |
std::vector< topic > | generate_unit_topics (const bool sort_generated, const std::string &race) |
UNIT_DESCRIPTION_TYPE | description_type (const unit_type &type) |
Return the type of description that should be shown for a unit of the given kind. More... | |
std::string | generate_contents_links (const std::string §ion_name, config const *help_cfg) |
std::string | generate_contents_links (const section &sec, const std::vector< topic > &topics) |
const topic * | find_topic (const section &sec, const std::string &id) |
Search for the topic with the specified identifier in the section and its subsections. More... | |
const section * | find_section (const section &sec, const std::string &id) |
Search for the section with the specified identifier in the section and its subsections. More... | |
section * | find_section (section &sec, const std::string &id) |
std::vector< std::string > | parse_text (const std::string &text) |
Parse a text string. More... | |
std::string | convert_to_wml (const std::string &element_name, const std::string &contents) |
Convert the contents to wml attributes, surrounded within [element_name]...[/element_name]. More... | |
color_t | string_to_color (const std::string &s) |
Return the color the string represents. More... | |
std::vector< std::string > | split_in_width (const std::string &s, const int font_size, const unsigned width) |
Make a best effort to word wrap s. More... | |
std::string | remove_first_space (const std::string &text) |
std::string | get_first_word (const std::string &s) |
Return the first word in s, not removing any spaces in the start of it. More... | |
void | generate_contents () |
Generate the help contents from the configurations given to the manager. More... | |
std::string | hidden_symbol (bool hidden) |
bool | is_visible_id (const std::string &id) |
bool | is_valid_id (const std::string &id) |
Return true if the id is valid for user defined topics and sections. More... | |
unsigned | image_width (const std::string &filename) |
void | push_tab_pair (std::vector< help::item > &v, const std::string &s, const std::optional< std::string > &image, unsigned padding) |
std::string | generate_table (const table_spec &tab, const unsigned int spacing) |
std::string | escape (const std::string &s) |
Prepend all chars with meaning inside attributes with a backslash. More... | |
std::shared_ptr< terrain_type_data > | load_terrain_types_data () |
Load the appropriate terrain types data to use. More... | |
std::string | make_link (const std::string &text, const std::string &dst) |
std::string | jump_to (const unsigned pos) |
std::string | jump (const unsigned amount) |
std::string | bold (const std::string &s) |
static std::string | best_str (bool best) |
static std::string | print_behavior_description (ter_iter start, ter_iter end, const std::shared_ptr< terrain_type_data > &tdata, bool first_level=true, bool begin_best=true) |
static void | print_trait_list (std::stringstream &ss, const std::vector< trait_data > &l) |
Variables | |
const game_config_view * | game_cfg = nullptr |
help::section | default_toplevel |
help::section | hidden_sections |
int | last_num_encountered_units = -1 |
int | last_num_encountered_terrains = -1 |
boost::tribool | last_debug_state = boost::indeterminate |
std::vector< std::string > | empty_string_vector |
const int | max_section_level = 15 |
const int | title_size = font::SIZE_LARGE |
const int | title2_size = font::SIZE_15 |
const int | box_width = 2 |
const int | normal_font_size = font::SIZE_NORMAL |
const unsigned | max_history = 100 |
const std::string | topic_img = "help/topic.png" |
const std::string | closed_section_img = "help/closed_section.png" |
const std::string | open_section_img = "help/open_section.png" |
const std::string | default_show_topic = "..introduction" |
const std::string | unknown_unit_topic = ".unknown_unit" |
const std::string | unit_prefix = "unit_" |
const std::string | terrain_prefix = "terrain_" |
const std::string | race_prefix = "race_" |
const std::string | faction_prefix = "faction_" |
const std::string | era_prefix = "era_" |
const std::string | variation_prefix = "variation_" |
const std::string | ability_prefix = "ability_" |
typedef std::pair< std::string, unsigned > help::item |
Definition at line 407 of file help_impl.hpp.
typedef std::list<section> help::section_list |
Definition at line 138 of file help_impl.hpp.
typedef std::vector<std::vector<help::item> > help::table_spec |
Definition at line 409 of file help_impl.hpp.
typedef t_translation::ter_list::const_iterator help::ter_iter |
Definition at line 69 of file help_topic_generators.cpp.
typedef std::list<topic> help::topic_list |
Definition at line 140 of file help_impl.hpp.
typedef std::pair<std::string, std::string> help::trait_data |
Definition at line 234 of file help_topic_generators.cpp.
Definition at line 236 of file help_impl.hpp.
|
static |
Definition at line 62 of file help_topic_generators.cpp.
References _().
Referenced by print_behavior_description().
|
inline |
Definition at line 399 of file help_impl.hpp.
References escape().
Referenced by help::help_text_area::handle_format_cfg(), help::unit_topic_generator::push_header(), and help::help_text_area::set_items().
std::string help::convert_to_wml | ( | const std::string & | element_name, |
const std::string & | contents | ||
) |
Convert the contents to wml attributes, surrounded within [element_name]...[/element_name].
Return the resulting WML.
Definition at line 1271 of file help_impl.cpp.
References c, and wfl::msg().
Referenced by parse_text().
UNIT_DESCRIPTION_TYPE help::description_type | ( | const unit_type & | type | ) |
Return the type of description that should be shown for a unit of the given kind.
This method is intended to filter out information about units that should not be shown, for example due to not being encountered.
Definition at line 1052 of file help_impl.cpp.
References game_config::debug, preferences::encountered_units(), FULL_DESCRIPTION, HIDDEN_BUT_SHOW_MACROS, unit_type::id(), hotkey::is_scope_active(), NO_DESCRIPTION, hotkey::SCOPE_EDITOR, and preferences::show_all_units_in_help().
Referenced by generate_ability_topics(), generate_races_sections(), generate_trait_topics(), generate_unit_topics(), generate_weapon_special_topics(), make_unit_link(), and help::unit_topic_generator::operator()().
std::string help::escape | ( | const std::string & | s | ) |
Prepend all chars with meaning inside attributes with a backslash.
Definition at line 1561 of file help_impl.cpp.
References utils::escape().
Referenced by bold(), make_link(), and help::unit_topic_generator::operator()().
Search for the section with the specified identifier in the section and its subsections.
Return the found section or nullptr if none could be found.
Definition at line 1177 of file help_impl.cpp.
References s, and help::section::sections.
Referenced by find_section(), and generate_contents().
Definition at line 1193 of file help_impl.cpp.
References find_section().
Search for the topic with the specified identifier in the section and its subsections.
Return the found topic, or nullptr if none could be found.
Definition at line 1161 of file help_impl.cpp.
References s, help::section::sections, t, and help::section::topics.
Referenced by generate_contents(), help::help_browser::handle_event(), help::help_text_area::handle_ref_cfg(), help::help_menu::process(), and help::help_browser::show_topic().
std::vector< topic > help::generate_ability_topics | ( | const bool | sort_generated | ) |
Definition at line 492 of file help_impl.cpp.
References _(), a, unit_type::abilities_metadata(), unit_type::adv_abilities_metadata(), description_type(), FULL_DESCRIPTION, unit_type::hide_help(), unit_type::id(), make_link(), sort(), unit_type::type_name(), unit_type_data::types(), font::unicode_bullet, and unit_types.
Referenced by generate_topics().
void help::generate_contents | ( | ) |
Generate the help contents from the configurations given to the manager.
Definition at line 1399 of file help_impl.cpp.
References config::add_child(), game_config_view::child_or_empty(), config::child_range(), help::section::clear(), config::clear_children(), e, find_section(), find_topic(), game::error::message, wfl::msg(), parse_config(), section_is_referenced(), and topic_is_referenced().
Referenced by show_help().
std::string help::generate_contents_links | ( | const std::string & | section_name, |
config const * | help_cfg | ||
) |
Definition at line 1072 of file help_impl.cpp.
References config::find_child(), is_visible_id(), make_link(), utils::quoted_split(), sort(), t, and font::unicode_bullet.
Referenced by generate_topic_text(), and help::parse_error::parse_error().
std::string help::generate_contents_links | ( | const section & | sec, |
const std::vector< topic > & | topics | ||
) |
Definition at line 1110 of file help_impl.cpp.
References is_visible_id(), make_link(), s, help::section::sections, t, and font::unicode_bullet.
Definition at line 813 of file help_impl.cpp.
References help::section::add_section(), game_config_view::child_range(), DBG_HP, config::debug(), preferences::era(), and parse_config_internal().
Referenced by generate_sections().
std::vector< topic > help::generate_era_topics | ( | const bool | sort_generated, |
const std::string & | era_id | ||
) |
Definition at line 558 of file help_impl.cpp.
References _(), config_attribute_value::empty(), preferences::era(), game_config_view::find_child(), generate_faction_topics(), make_link(), sort(), t, config_attribute_value::t_str(), and font::unicode_bullet.
Referenced by generate_topics().
std::vector< topic > help::generate_faction_topics | ( | const config & | era, |
const bool | sort_generated | ||
) |
Definition at line 594 of file help_impl.cpp.
References _(), unit_type::alignment(), unit_type::alignment_description(), config::child_range(), config_attribute_value::empty(), f, unit_type_data::find(), unit_type_data::find_race(), unit_type::genders(), unit_type::HELP_INDEXED, make_link(), make_unit_links_list(), name, unit_type::race_id(), sort(), utils::split(), t, config_attribute_value::t_str(), font::unicode_bullet, and unit_types.
Referenced by generate_era_topics().
Definition at line 773 of file help_impl.cpp.
References _(), help::section::add_section(), description_type(), unit_type_data::find_race(), FULL_DESCRIPTION, hidden_symbol(), unit_type::hide_help(), i, parse_config_internal(), unit_type::race_id(), unit_type_data::types(), and unit_types.
Referenced by generate_sections(), and help::parse_error::parse_error().
void help::generate_sections | ( | const config * | help_cfg, |
const std::string & | generator, | ||
section & | sec, | ||
int | level | ||
) |
Dispatch generators to their appropriate functions.
Definition at line 289 of file help_impl.cpp.
References DBG_HP, generate_era_sections(), generate_races_sections(), generate_terrain_sections(), generate_unit_sections(), utils::split(), utils::STRIP_SPACES, and WRN_HP.
Referenced by parse_config_internal(), and help::parse_error::parse_error().
std::string help::generate_table | ( | const table_spec & | tab, |
const unsigned int | spacing | ||
) |
Definition at line 1518 of file help_impl.cpp.
Referenced by help::unit_topic_generator::operator()().
void help::generate_terrain_sections | ( | section & | sec, |
int | |||
) |
Definition at line 836 of file help_impl.cpp.
References help::section::add_section(), terrain_type::editor_name(), preferences::encountered_terrains(), hidden_symbol(), terrain_type::hide_help(), terrain_type::id(), help::topic::id, help::section::id, lg::info(), terrain_type::is_nonnull(), terrain_type::is_overlay(), load_terrain_types_data(), t, help::topic::text, help::topic::title, help::section::title, help::section::topics, and WRN_HP.
Referenced by generate_sections(), and help::parse_error::parse_error().
std::vector< topic > help::generate_time_of_day_topics | ( | const bool | ) |
Definition at line 348 of file help_impl.cpp.
References _(), generic_combat_modifier(), tod_manager::get_max_liminal_bonus(), jump(), jump_to(), make_link(), time_of_day_bonus_colored(), tod_manager::times(), and resources::tod_manager.
Referenced by generate_topics().
std::string help::generate_topic_text | ( | const std::string & | generator, |
const config * | help_cfg, | ||
const section & | sec, | ||
const std::vector< topic > & | generated_topics | ||
) |
Definition at line 308 of file help_impl.cpp.
References generate_contents_links(), and utils::split().
Referenced by parse_config_internal(), and help::parse_error::parse_error().
std::vector< topic > help::generate_topics | ( | const bool | sort_generated, |
const std::string & | generator | ||
) |
Definition at line 260 of file help_impl.cpp.
References generate_ability_topics(), generate_era_topics(), generate_time_of_day_topics(), generate_trait_topics(), generate_unit_topics(), generate_weapon_special_topics(), utils::split(), utils::STRIP_SPACES, and WRN_HP.
Referenced by parse_config_internal(), and help::parse_error::parse_error().
std::vector< topic > help::generate_trait_topics | ( | const bool | sort_generated | ) |
Definition at line 669 of file help_impl.cpp.
References _(), a, description_type(), unit_type_data::find_race(), FULL_DESCRIPTION, HIDDEN_BUT_SHOW_MACROS, i, name, unit_type::possible_traits(), unit_type::race_id(), sort(), unit_type_data::traits(), unit_type_data::types(), and unit_types.
Referenced by generate_topics().
void help::generate_unit_sections | ( | const config * | , |
section & | sec, | ||
int | , | ||
const bool | , | ||
const std::string & | race | ||
) |
Definition at line 888 of file help_impl.cpp.
References help::section::add_section(), unit_type::get_variation(), hidden_symbol(), unit_type::hide_help(), i, unit_type::id(), help::section::id, unit_type::race_id(), unit_type::show_variations_in_help(), help::topic::text, help::section::title, help::section::topics, unit_type::type_name(), unit_type_data::types(), unit_types, unit_type::variation_name(), and unit_type::variations().
Referenced by generate_sections(), and help::parse_error::parse_error().
std::vector< topic > help::generate_unit_topics | ( | const bool | sort_generated, |
const std::string & | race | ||
) |
Definition at line 921 of file help_impl.cpp.
References _(), unit_type::alignment(), unit_type::alignment_description(), game_config::debug, description_type(), unit_type_data::find_race(), FULL_DESCRIPTION, unit_type::genders(), hidden_symbol(), unit_type::hide_help(), i, unit_type::id(), make_link(), unit_type::race_id(), unit_type_data::races(), unit_type::show_variations_in_help(), sort(), t_string::str(), help::topic::text, unit_type::type_name(), unit_type_data::types(), font::unicode_bullet, unit_types, and VGETTEXT.
Referenced by generate_topics(), and help::parse_error::parse_error().
std::vector< topic > help::generate_weapon_special_topics | ( | const bool | sort_generated | ) |
Definition at line 395 of file help_impl.cpp.
References _(), unit_type::attacks(), config::child_range(), description_type(), FULL_DESCRIPTION, unit_type::hide_help(), i, unit_type::id(), make_link(), unit_type::modification_advancements(), s, unit_type::show_variations_in_help(), sort(), unit_type::type_name(), unit_type_data::types(), font::unicode_bullet, and unit_types.
Referenced by generate_topics().
std::string help::get_first_word | ( | const std::string & | s | ) |
Return the first word in s, not removing any spaces in the start of it.
Definition at line 1373 of file help_impl.cpp.
References ucs4::iterator_base< string_type, update_implementation >::end(), font::is_cjk_char(), s, and unicode_cast().
Referenced by help::help_text_area::add_text_item().
std::string help::hidden_symbol | ( | bool | hidden | ) |
Definition at line 1460 of file help_impl.cpp.
Referenced by generate_races_sections(), generate_terrain_sections(), generate_unit_sections(), generate_unit_topics(), is_valid_id(), show_terrain_help(), help::help_browser::show_topic(), show_unit_help(), and show_variation_help().
unsigned help::image_width | ( | const std::string & | filename | ) |
Definition at line 1494 of file help_impl.cpp.
References image::get_image().
Referenced by help::unit_topic_generator::operator()(), and push_tab_pair().
bool help::is_valid_id | ( | const std::string & | id | ) |
Return true if the id is valid for user defined topics and sections.
Some IDs are special, such as toplevel and may not be be defined in the config.
Definition at line 1473 of file help_impl.cpp.
References translation::compare(), hidden_symbol(), and unit_prefix.
Referenced by parse_config_internal().
bool help::is_visible_id | ( | const std::string & | id | ) |
Definition at line 1464 of file help_impl.cpp.
Referenced by generate_contents_links(), and help::help_menu::update_visible_items().
|
inline |
Definition at line 392 of file help_impl.hpp.
Referenced by generate_time_of_day_topics(), help::unit_topic_generator::operator()(), push_tab_pair(), and help::help_text_area::set_items().
|
inline |
Definition at line 385 of file help_impl.hpp.
Referenced by generate_table(), generate_time_of_day_topics(), and help::help_text_area::handle_jump_cfg().
std::shared_ptr< terrain_type_data > help::load_terrain_types_data | ( | ) |
Load the appropriate terrain types data to use.
Definition at line 1567 of file help_impl.cpp.
References game_config_manager::get(), display::get_disp_context(), display::get_singleton(), display_context::map(), gamemap::tdata(), and game_config_manager::terrain_types().
Referenced by generate_terrain_sections(), gui2::get_mp_tooltip(), help::terrain_topic_generator::operator()(), and help::unit_topic_generator::operator()().
|
inline |
Definition at line 379 of file help_impl.hpp.
References escape().
Referenced by generate_ability_topics(), generate_contents_links(), generate_era_topics(), generate_faction_topics(), generate_time_of_day_topics(), generate_unit_topics(), generate_weapon_special_topics(), make_unit_link(), help::terrain_topic_generator::operator()(), help::unit_topic_generator::operator()(), and print_trait_list().
std::string help::make_unit_link | ( | const std::string & | type_id | ) |
return a hyperlink with the unit's name and pointing to the unit page return empty string if this unit is hidden.
If not yet discovered add the (?) suffix
Definition at line 732 of file help_impl.cpp.
References description_type(), unit_type_data::find(), FULL_DESCRIPTION, unit_type::HELP_INDEXED, unit_type::hide_help(), unit_type::id(), make_link(), name, unit_type::show_variations_in_help(), unit_type::type_name(), unit_types, and unknown_unit_topic.
Referenced by make_unit_links_list(), and help::parse_error::parse_error().
std::vector< std::string > help::make_unit_links_list | ( | const std::vector< std::string > & | type_id_list, |
bool | ordered | ||
) |
return a list of hyperlinks to unit's pages (ordered or not)
Definition at line 758 of file help_impl.cpp.
References make_unit_link(), and sort().
Referenced by generate_faction_topics(), and help::parse_error::parse_error().
Parse a help config, return the top level section.
Return an empty section if cfg is nullptr.
Definition at line 250 of file help_impl.cpp.
References config::child(), and parse_config_internal().
Referenced by generate_contents(), and terrain_builder::parse_global_config().
void help::parse_config_internal | ( | const config * | help_cfg, |
const config * | section_cfg, | ||
section & | sec, | ||
int | level = 0 |
||
) |
Recursive function used by parse_config.
Definition at line 145 of file help_impl.cpp.
References help::section::add_section(), config::find_child(), generate_sections(), generate_topic_text(), generate_topics(), help::topic::id, help::section::id, is_valid_id(), utils::quoted_split(), help::section::sections, sort(), help::section::title, and help::section::topics.
Referenced by generate_era_sections(), generate_races_sections(), and parse_config().
std::vector< std::string > help::parse_text | ( | const std::string & | text | ) |
Parse a text string.
Return a vector with the different parts of the text. Each markup item is a separate part while the text between markups are separate parts.
Definition at line 1198 of file help_impl.cpp.
References c, convert_to_wml(), wfl::msg(), desktop::notifications::OTHER, and s.
Referenced by help::topic_text::parsed_text().
|
static |
Definition at line 71 of file help_topic_generators.cpp.
References best_str(), terrain_type::editor_name(), t_string::empty(), i, t_translation::MINUS, names, t_translation::PLUS, and s.
Referenced by help::terrain_topic_generator::operator()().
|
static |
Definition at line 237 of file help_topic_generators.cpp.
References i, and make_link().
Referenced by help::unit_topic_generator::operator()().
void help::push_tab_pair | ( | std::vector< help::item > & | v, |
const std::string & | s, | ||
const std::optional< std::string > & | image, | ||
unsigned | padding | ||
) |
Definition at line 1504 of file help_impl.cpp.
References image_width(), jump(), and font::line_width().
Referenced by help::unit_topic_generator::operator()().
std::string help::remove_first_space | ( | const std::string & | text | ) |
Definition at line 1365 of file help_impl.cpp.
Referenced by help::help_text_area::add_text_item().
bool help::section_is_referenced | ( | const std::string & | section_id, |
const config & | cfg | ||
) |
Return true if the section with id section_id is referenced from another section in the config, or the toplevel.
Definition at line 97 of file help_impl.cpp.
References config::child(), config::child_range(), and utils::quoted_split().
Referenced by generate_contents().
void help::show_help | ( | const std::string & | show_topic, |
int | xloc, | ||
int | yloc | ||
) |
Open the help browser, show topic with id show_topic.
Open the help browser.
If show_topic is the empty string, the default topic will be shown.
The help browser will have the topic with id show_topic open if it is not the empty string. The default topic will be shown if show_topic is the empty string.
Definition at line 114 of file help.cpp.
References default_toplevel.
Referenced by tooltips::click(), hotkey::command_executor::do_execute_command(), gui2::dialogs::addon_connect::help_button_callback(), game_lua_kernel::intf_open_help(), gui2::dialogs::title_screen::pre_show(), editor::editor_controller::save_map(), events::menu_handler::set_gui(), gui2::dialogs::unit_advance::show_help(), gui2::dialogs::unit_recruit::show_help(), gui2::dialogs::unit_recall::show_help(), events::menu_handler::show_help(), editor::editor_controller::show_help(), gui2::dialogs::addon_manager::show_help(), gui2::dialogs::mp_lobby::show_help_callback(), show_terrain_help(), show_unit_help(), show_variation_help(), and editor::editor_controller::unit_description().
void help::show_help | ( | const section & | toplevel_sec, |
const std::string & | show_topic, | ||
int | xloc, | ||
int | yloc | ||
) |
Open a help dialog using a toplevel other than the default.
This allows for complete customization of the contents, although not in a very easy way.
Definition at line 154 of file help.cpp.
References _(), unit_type_data::build_all(), game_config::debug, default_show_topic, gui::dialog_frame::default_style, CVideo::delay(), gui::dialog_frame::draw(), e, preferences::encountered_terrains(), preferences::encountered_units(), ERR_HELP, f, CVideo::flip(), generate_contents(), CVideo::get_singleton(), unit_type::HELP_INDEXED, last_debug_state, last_num_encountered_terrains, last_num_encountered_units, gui::dialog_frame::layout(), game::error::message, wfl::msg(), events::pump(), events::raise_draw_event(), events::raise_process_event(), font::relative_size(), CVideo::screen_area(), gui::widget::set_dirty(), gui::widget::set_height(), gui::widget::set_location(), gui::widget::set_width(), help::help_browser::show_topic(), gui2::show_transient_message(), utf8::size(), and unit_types.
void help::show_terrain_description | ( | const terrain_type & | t | ) |
Definition at line 62 of file help.cpp.
References terrain_type::hide_help(), terrain_type::id(), and show_terrain_help().
Referenced by events::menu_handler::terrain_description(), and editor::editor_controller::terrain_description().
void help::show_terrain_help | ( | const std::string & | show_topic, |
bool | hidden, | ||
int | xloc, | ||
int | yloc | ||
) |
Open the help browser, show terrain with id terrain_id.
wrapper to add terrain prefix and hiding symbol
If show_topic is the empty string, the default topic will be shown.
Definition at line 135 of file help.cpp.
References default_toplevel, hidden_symbol(), show_help(), and terrain_prefix.
Referenced by show_terrain_description().
void help::show_unit_description | ( | const unit & | u | ) |
Definition at line 57 of file help.cpp.
References unit::type().
Referenced by gui2::unit_preview_pane::profile_button_callback(), gui2::dialogs::faction_select::profile_button_callback(), and events::menu_handler::unit_description().
void help::show_unit_description | ( | const unit_type & | t | ) |
Definition at line 67 of file help.cpp.
References unit_type_data::find(), unit_type::get_cfg(), unit_type::hide_help(), unit_type::id(), show_unit_help(), show_variation_help(), unit_type::show_variations_in_help(), and unit_types.
void help::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.
wrapper to add unit prefix and hiding symbol
If show_topic is the empty string, the default topic will be shown.
Definition at line 124 of file help.cpp.
References default_toplevel, hidden_symbol(), show_help(), and unit_prefix.
Referenced by show_unit_description(), and editor::editor_controller::unit_description().
void help::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.
wrapper to add variation prefix and hiding symbol
Definition at line 143 of file help.cpp.
References default_toplevel, hidden_symbol(), show_help(), and variation_prefix.
Referenced by show_unit_description().
std::vector< std::string > help::split_in_width | ( | const std::string & | s, |
const int | font_size, | ||
const unsigned | width | ||
) |
Make a best effort to word wrap s.
All parts are less than width.
Definition at line 1346 of file help_impl.cpp.
References _(), and font::word_wrap_text().
Referenced by help::help_text_area::add_text_item().
color_t help::string_to_color | ( | const std::string & | s | ) |
Return the color the string represents.
Return font::NORMAL_COLOR if the string is empty or can't be matched against any other color.
Definition at line 1322 of file help_impl.cpp.
References font::BAD_COLOR, font::BIGMAP_COLOR, font::BLACK_COLOR, color_t::from_argb_bytes(), font::GOOD_COLOR, font::NORMAL_COLOR, and font::YELLOW_COLOR.
Referenced by help::help_text_area::handle_format_cfg().
std::string help::time_of_day_bonus_colored | ( | const int | time_of_day_bonus | ) |
Definition at line 342 of file help_impl.cpp.
Referenced by generate_time_of_day_topics().
bool help::topic_is_referenced | ( | const std::string & | topic_id, |
const config & | cfg | ||
) |
Return true if the topic with id topic_id is referenced from another section in the config, or the toplevel.
Definition at line 121 of file help_impl.cpp.
References config::child(), config::child_range(), and utils::quoted_split().
Referenced by generate_contents().
const std::string help::ability_prefix = "ability_" |
Definition at line 95 of file help_impl.cpp.
Referenced by help::unit_topic_generator::operator()().
const int help::box_width = 2 |
Definition at line 80 of file help_impl.cpp.
Referenced by help::help_text_area::add_img_item(), help::help_text_area::draw_contents(), and help::help_text_area::item::item().
const std::string help::closed_section_img = "help/closed_section.png" |
Definition at line 84 of file help_impl.cpp.
Referenced by help::help_menu::get_string_to_show(), and help::help_menu::process().
const std::string help::default_show_topic = "..introduction" |
Definition at line 87 of file help_impl.cpp.
Referenced by show_help().
help::section help::default_toplevel |
Definition at line 68 of file help_impl.cpp.
Referenced by help::help_menu::process(), show_help(), show_terrain_help(), show_unit_help(), show_variation_help(), and help::help_manager::~help_manager().
std::vector< std::string > help::empty_string_vector |
Definition at line 76 of file help_impl.cpp.
const std::string help::era_prefix = "era_" |
Definition at line 93 of file help_impl.cpp.
const std::string help::faction_prefix = "faction_" |
Definition at line 92 of file help_impl.cpp.
const game_config_view * help::game_cfg = nullptr |
Definition at line 66 of file help_impl.cpp.
Referenced by help::help_manager::help_manager(), and help::help_manager::~help_manager().
help::section help::hidden_sections |
Definition at line 70 of file help_impl.cpp.
Referenced by help::help_manager::~help_manager().
boost::tribool help::last_debug_state = boost::indeterminate |
Definition at line 74 of file help_impl.cpp.
Referenced by show_help().
int help::last_num_encountered_terrains = -1 |
Definition at line 73 of file help_impl.cpp.
Referenced by show_help(), and help::help_manager::~help_manager().
int help::last_num_encountered_units = -1 |
Definition at line 72 of file help_impl.cpp.
Referenced by show_help(), and help::help_manager::~help_manager().
const unsigned help::max_history = 100 |
Definition at line 82 of file help_impl.cpp.
Referenced by help::help_browser::move_in_history(), and help::help_browser::show_topic().
const int help::max_section_level = 15 |
Definition at line 77 of file help_impl.cpp.
const int help::normal_font_size = font::SIZE_NORMAL |
Definition at line 81 of file help_impl.cpp.
Referenced by help::help_text_area::add_text_item(), help::help_text_area::handle_format_cfg(), help::unit_topic_generator::operator()(), and help::unit_topic_generator::push_header().
const std::string help::open_section_img = "help/open_section.png" |
Definition at line 85 of file help_impl.cpp.
Referenced by help::help_menu::get_string_to_show(), and help::help_menu::process().
const std::string help::race_prefix = "race_" |
Definition at line 91 of file help_impl.cpp.
const std::string help::terrain_prefix = "terrain_" |
Definition at line 90 of file help_impl.cpp.
Referenced by help::terrain_topic_generator::operator()(), and show_terrain_help().
const int help::title2_size = font::SIZE_15 |
Definition at line 79 of file help_impl.cpp.
Referenced by help::help_text_area::handle_header_cfg().
const int help::title_size = font::SIZE_LARGE |
Definition at line 78 of file help_impl.cpp.
Referenced by help::help_text_area::set_items().
const std::string help::topic_img = "help/topic.png" |
Definition at line 83 of file help_impl.cpp.
Referenced by help::help_menu::get_string_to_show().
const std::string help::unit_prefix = "unit_" |
Definition at line 89 of file help_impl.cpp.
Referenced by is_valid_id(), help::unit_topic_generator::operator()(), help::help_browser::show_topic(), and show_unit_help().
const std::string help::unknown_unit_topic = ".unknown_unit" |
Definition at line 88 of file help_impl.cpp.
Referenced by make_unit_link(), help::unit_topic_generator::operator()(), and help::help_browser::show_topic().
const std::string help::variation_prefix = "variation_" |
Definition at line 94 of file help_impl.cpp.
Referenced by help::unit_topic_generator::operator()(), and show_variation_help().