Classes | |
class | topic_generator |
Generate a topic text on the fly. More... | |
class | text_topic_generator |
class | topic_text |
The text displayed in a topic. More... | |
struct | topic |
A topic contains a title, an id and some text. More... | |
struct | section |
A section contains topics and sections along with title and ID. More... | |
class | has_id |
To be used as a function object to locate sections and topics with a specified ID. More... | |
class | title_less |
To be used as a function object when sorting topic lists on the title. More... | |
class | section_less |
To be used as a function object when sorting section lists on the title. More... | |
struct | delete_section |
struct | create_section |
class | help_menu |
The menu to the left in the help browser, where topics can be navigated through and chosen. More... | |
struct | parse_error |
Thrown when the help system fails to parse something. More... | |
class | help_text_area |
The area where the content is shown in the help browser. More... | |
class | help_browser |
A help browser widget. More... | |
class | unit_topic_generator |
struct | help_manager |
class | help_button |
Typedefs | |
typedef std::vector< section * > | section_list |
typedef std::list< topic > | topic_list |
Enumerations | |
enum | UNIT_DESCRIPTION_TYPE { FULL_DESCRIPTION, NO_DESCRIPTION, NON_REVEALING_DESCRIPTION } |
Functions | |
static void | generate_contents () |
Generate the help contents from the configurations given to the manager. | |
static void | generate_sections (const config *help_cfg, const std::string &generator, section &sec, int level) |
Dispatch generators to their appropriate functions. | |
static std::vector< topic > | generate_topics (const bool sort_topics, const std::string &generator) |
static std::string | generate_topic_text (const std::string &generator, const config *help_cfg, const section &sec, const std::vector< topic > &generated_topics) |
static std::string | generate_about_text () |
static std::string | generate_contents_links (const std::string §ion_name, config const *help_cfg) |
static std::string | generate_contents_links (const section &sec, const std::vector< topic > &topics) |
static void | generate_races_sections (const config *help_cfg, section &sec, int level) |
static std::vector< topic > | generate_unit_topics (const bool, const std::string &race) |
static 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. | |
static std::vector< topic > | generate_ability_topics (const bool) |
static std::vector< topic > | generate_weapon_special_topics (const bool) |
static section | parse_config (const config *cfg) |
Parse a help config, return the top level section. | |
static void | parse_config_internal (const config *help_cfg, const config *section_cfg, section &sec, int level=0) |
Recursive function used by parse_config. | |
static 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. | |
static 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. | |
static 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. | |
static 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. | |
static std::vector< std::string > | parse_text (const std::string &text) |
Parse a text string. | |
static std::string | convert_to_wml (const std::string &element_name, const std::string &contents) |
Convert the contents to wml attributes, surrounded within [element_name]. | |
static bool | get_bool (const std::string &s) |
Return true if s is a representation of a truth value (yes/true/. | |
static SDL_Color | string_to_color (const std::string &s) |
Return the color the string represents. | |
static 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. All parts are less than width. | |
static std::string | remove_first_space (const std::string &text) |
static std::string | to_lower (const std::string &s) |
Return a lowercase copy of s. | |
static std::string | escape (const std::string &s) |
Prepend all chars with meaning inside attributes with a backslash. | |
static std::string | get_first_word (const std::string &s) |
Return the first word in s, not removing any spaces in the start of it. | |
void | show_help (display &disp, const std::string &show_topic, int xloc, int yloc) |
Open the help browser, show topic with id show_topic. | |
void | show_unit_help (display &disp, const std::string &show_topic, bool hidden, int xloc, int yloc) |
Open the help browser, show unit with id unit_id. | |
void | show_help (display &disp, const section &toplevel_sec, const std::string &show_topic, int xloc, int yloc) |
Open a help dialog using a toplevel other than the default. |
typedef std::vector<section *> help::section_list |
typedef std::list<topic> help::topic_list |
std::string help::convert_to_wml | ( | const std::string & | element_name, | |
const std::string & | contents | |||
) | [static] |
Convert the contents to wml attributes, surrounded within [element_name].
..[/element_name]. Return the resulting WML.
Definition at line 2796 of file help.cpp.
References escape_char, and pos.
Referenced by parse_text().
UNIT_DESCRIPTION_TYPE help::description_type | ( | const unit_type & | type | ) | [static] |
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 1617 of file help.cpp.
References game_config::debug, preferences::encountered_units(), FULL_DESCRIPTION, unit_type::id(), and NO_DESCRIPTION.
Referenced by generate_ability_topics(), generate_races_sections(), generate_unit_topics(), generate_weapon_special_topics(), and help::unit_topic_generator::operator()().
std::string help::escape | ( | const std::string & | s | ) | [static] |
Prepend all chars with meaning inside attributes with a backslash.
Definition at line 2909 of file help.cpp.
References pos.
Referenced by bold(), generate_ability_topics(), generate_contents_links(), generate_unit_topics(), generate_weapon_special_topics(), and help::unit_topic_generator::operator()().
const section * help::find_section | ( | const section & | sec, | |
const std::string & | id | |||
) | [static] |
Search for the section with the specified identifier in the section and its subsections.
Return the found section or NULL if none could be found.
Definition at line 2664 of file help.cpp.
References help::section::sections.
Referenced by generate_contents().
const topic * help::find_topic | ( | const section & | sec, | |
const std::string & | id | |||
) | [static] |
Search for the topic with the specified identifier in the section and its subsections.
Return the found topic, or NULL if none could be found.
Definition at line 2647 of file help.cpp.
References help::section::sections, 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 | ) | [static] |
Definition at line 1122 of file help.cpp.
References _, a, unit_type::abilities(), unit_type::ability_tooltips(), unit_map::begin(), boost::foreach_detail_::begin(), utils::capitalize(), description, description_type(), unit_map::end(), escape(), FULL_DESCRIPTION, unit_type::hide_help(), unit_type::id(), name, string_table, text, type, unit_type::type_name(), unit_type_data::types(), and units.
Referenced by generate_topics().
std::string help::generate_about_text | ( | ) | [static] |
Definition at line 1630 of file help.cpp.
References about::get_text(), utils::join(), halo::remove(), and text.
Referenced by generate_topic_text().
void help::generate_contents | ( | ) | [static] |
Generate the help contents from the configurations given to the manager.
Definition at line 732 of file help.cpp.
References config::add_child(), config::child(), config::child_range(), help::section::clear(), config::clear_children(), find_section(), find_topic(), help::parse_error::message, parse_config(), section_is_referenced(), and topic_is_referenced().
Referenced by show_help().
std::string help::generate_contents_links | ( | const section & | sec, | |
const std::vector< topic > & | topics | |||
) | [static] |
Definition at line 1680 of file help.cpp.
References escape(), is_visible_id(), and help::section::sections.
std::string help::generate_contents_links | ( | const std::string & | section_name, | |
config const * | help_cfg | |||
) | [static] |
Definition at line 1641 of file help.cpp.
References escape(), config::find_child(), is_visible_id(), and utils::quoted_split().
Referenced by generate_topic_text().
void help::generate_races_sections | ( | const config * | help_cfg, | |
section & | sec, | |||
int | level | |||
) | [static] |
Definition at line 1518 of file help.cpp.
References _, help::section::add_section(), boost::foreach_detail_::begin(), description_type(), boost::foreach_detail_::end(), FULL_DESCRIPTION, hidden, hidden_symbol(), unit_type::hide_help(), parse_config_internal(), unit_type::race(), text, type, and unit_type_data::types().
Referenced by generate_sections().
void help::generate_sections | ( | const config * | help_cfg, | |
const std::string & | generator, | |||
section & | sec, | |||
int | level | |||
) | [static] |
Dispatch generators to their appropriate functions.
Definition at line 993 of file help.cpp.
References generate_races_sections().
Referenced by parse_config_internal().
std::string help::generate_topic_text | ( | const std::string & | generator, | |
const config * | help_cfg, | |||
const section & | sec, | |||
const std::vector< topic > & | generated_topics | |||
) | [static] |
Definition at line 1000 of file help.cpp.
References empty_string, generate_about_text(), generate_contents_links(), and utils::split().
Referenced by parse_config_internal().
std::vector< topic > help::generate_topics | ( | const bool | sort_topics, | |
const std::string & | generator | |||
) | [static] |
Definition at line 972 of file help.cpp.
References generate_ability_topics(), generate_unit_topics(), generate_weapon_special_topics(), utils::split(), and utils::STRIP_SPACES.
Referenced by parse_config_internal().
std::vector< topic > help::generate_unit_topics | ( | const | bool, | |
const std::string & | race | |||
) | [static] |
Definition at line 1561 of file help.cpp.
References _, boost::foreach_detail_::begin(), description_type(), boost::foreach_detail_::end(), escape(), FULL_DESCRIPTION, hidden_symbol(), unit_type::hide_help(), unit_type::id(), unit_type::race(), text, type, unit_type::type_name(), and unit_type_data::types().
Referenced by generate_topics().
std::vector< topic > help::generate_weapon_special_topics | ( | const | bool | ) | [static] |
Definition at line 1051 of file help.cpp.
References _, unit_type::attacks(), boost::foreach_detail_::begin(), utils::capitalize(), description, description_type(), escape(), FULL_DESCRIPTION, unit_type::hide_help(), unit_type::id(), name, text, type, unit_type::type_name(), unit_type_data::types(), and units.
Referenced by generate_topics().
bool help::get_bool | ( | const std::string & | s | ) | [static] |
Return true if s is a representation of a truth value (yes/true/.
..), otherwise false.
Definition at line 2847 of file help.cpp.
References to_lower().
Referenced by help::help_text_area::handle_format_cfg(), help::help_text_area::handle_img_cfg(), and help::help_text_area::handle_ref_cfg().
std::string help::get_first_word | ( | const std::string & | s | ) | [static] |
Return the first word in s, not removing any spaces in the start of it.
Definition at line 2925 of file help.cpp.
Referenced by help::help_text_area::add_text_item().
Parse a help config, return the top level section.
Return an empty section if cfg is NULL.
Definition at line 962 of file help.cpp.
References config::child(), and parse_config_internal().
Referenced by generate_contents().
void help::parse_config_internal | ( | const config * | help_cfg, | |
const config * | section_cfg, | |||
section & | sec, | |||
int | level = 0 | |||
) | [static] |
Recursive function used by parse_config.
Definition at line 854 of file help.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(), help::section::level, utils::quoted_split(), help::section::sections, text, help::section::title, and help::section::topics.
Referenced by generate_races_sections(), and parse_config().
std::vector< std::string > help::parse_text | ( | const std::string & | text | ) | [static] |
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 2723 of file help.cpp.
References convert_to_wml(), escape_char, and pos.
Referenced by help::topic_text::parsed_text().
std::string help::remove_first_space | ( | const std::string & | text | ) | [static] |
bool help::section_is_referenced | ( | const std::string & | section_id, | |
const config & | cfg | |||
) | [static] |
Return true if the section with id section_id is referenced from another section in the config, or the toplevel.
Definition at line 808 of file help.cpp.
References config::child(), config::child_range(), and utils::quoted_split().
Referenced by generate_contents().
void help::show_help | ( | display & | disp, | |
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.
This allows for complete customization of the contents, although not in a very easy way.
Definition at line 2959 of file help.cpp.
References _, game_config::debug, gui::dialog_frame::default_style, display::delay(), preferences::encountered_terrains(), preferences::encountered_units(), display::flip(), generate_contents(), CVideo::getSurface(), gui::widget::height(), unit_type::HELP_INDEX, display::invalidate_all(), help::parse_error::message, events::pump(), events::raise_draw_event(), events::raise_process_event(), font::relative_size(), screen, gui::widget::set_dirty(), gui::widget::set_height(), gui::widget::set_location(), gui::widget::set_width(), help::help_browser::show_topic(), size, unit_type_data::types(), display::video(), and gui::widget::width().
void help::show_help | ( | display & | disp, | |
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 2942 of file help.cpp.
Referenced by play_game(), events::menu_handler::show_help(), help::help_button::show_help(), and show_unit_help().
void help::show_unit_help | ( | display & | disp, | |
const std::string & | show_topic, | |||
bool | hidden, | |||
int | xloc, | |||
int | yloc | |||
) |
Open the help browser, show unit with id unit_id.
wrapper to add unit prefix and hidding symbol
If show_topic is the empty string, the default topic will be shown.
Definition at line 2950 of file help.cpp.
References hidden_symbol(), and show_help().
Referenced by dialogs::show_unit_description().
std::vector< std::string > help::split_in_width | ( | const std::string & | s, | |
const int | font_size, | |||
const unsigned | width | |||
) | [static] |
Make a best effort to word wrap s. All parts are less than width.
Definition at line 2874 of file help.cpp.
References _, and font::word_wrap_text().
Referenced by help::help_text_area::add_text_item().
SDL_Color help::string_to_color | ( | const std::string & | s | ) | [static] |
Return the color the string represents.
Return font::NORMAL_COLOUR if the string is empty or can't be matched against any other color.
Definition at line 2856 of file help.cpp.
References font::BAD_COLOUR, font::BLACK_COLOUR, font::GOOD_COLOUR, font::NORMAL_COLOUR, to_lower(), and font::YELLOW_COLOUR.
Referenced by help::help_text_area::handle_format_cfg().
std::string help::to_lower | ( | const std::string & | s | ) | [static] |
Return a lowercase copy of s.
Definition at line 2901 of file help.cpp.
Referenced by get_bool(), help::help_text_area::str_to_align(), and string_to_color().
bool help::topic_is_referenced | ( | const std::string & | topic_id, | |
const config & | cfg | |||
) | [static] |
Return true if the topic with id topic_id is referenced from another section in the config, or the toplevel.
Definition at line 831 of file help.cpp.
References config::child(), config::child_range(), and utils::quoted_split().
Referenced by generate_contents().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |