To store label data Class implements logic for rendering. More...
#include <map_label.hpp>

Public Member Functions | |
| terrain_label (const t_string &, const std::string &, const map_location &, const map_labels &, const SDL_Color color=font::NORMAL_COLOR, const bool visible_in_fog=true, const bool visible_in_shroud=false, const bool immutable=false) | |
| creating new label | |
| terrain_label (const map_labels &, const config &) | |
| Load label from config. | |
| ~terrain_label () | |
| void | write (config &res) const |
| void | read (const config &cfg) |
| const t_string & | text () const |
| const std::string & | team_name () const |
| bool | visible_in_fog () const |
| bool | visible_in_shroud () const |
| bool | immutable () const |
| const map_location & | location () const |
| const SDL_Color & | color () const |
| void | set_text (const t_string &) |
| void | update_info (const t_string &, const std::string &, const SDL_Color) |
| void | recalculate () |
| void | calculate_shroud () const |
Private Member Functions | |
| terrain_label (const terrain_label &) | |
| const terrain_label & | operator= (const terrain_label &) |
| void | clear () |
| void | draw () |
| bool | visible () const |
| std::string | cfg_color () const |
Private Attributes | |
| int | handle_ |
| t_string | text_ |
| std::string | team_name_ |
| bool | visible_in_fog_ |
| bool | visible_in_shroud_ |
| bool | immutable_ |
| SDL_Color | color_ |
| const map_labels * | parent_ |
| map_location | loc_ |
To store label data Class implements logic for rendering.
Definition at line 84 of file map_label.hpp.
| terrain_label::terrain_label | ( | const t_string & | text, | |
| const std::string & | team_name, | |||
| const map_location & | loc, | |||
| const map_labels & | parent, | |||
| const SDL_Color | color = font::NORMAL_COLOR, |
|||
| const bool | visible_in_fog = true, |
|||
| const bool | visible_in_shroud = false, |
|||
| const bool | immutable = false | |||
| ) |
creating new label
Definition at line 283 of file map_label.cpp.
References draw().

| terrain_label::terrain_label | ( | const map_labels & | parent, | |
| const config & | cfg | |||
| ) |
Load label from config.
Definition at line 305 of file map_label.cpp.
References read().

| terrain_label::~terrain_label | ( | ) |
Definition at line 320 of file map_label.cpp.
References clear().

| terrain_label::terrain_label | ( | const terrain_label & | ) | [private] |
| void terrain_label::calculate_shroud | ( | ) | const |
Definition at line 432 of file map_label.cpp.
References map_labels::disp(), handle_, is_shrouded(), loc_, parent_, font::show_floating_label(), and visible_in_shroud_.
Referenced by draw().


| std::string terrain_label::cfg_color | ( | ) | const [private] |
Definition at line 398 of file map_label.cpp.
References color_.
Referenced by write().

| void terrain_label::clear | ( | ) | [private] |
Definition at line 488 of file map_label.cpp.
References handle_, and font::remove_floating_label().
Referenced by draw(), and ~terrain_label().


| const SDL_Color & terrain_label::color | ( | ) | const |
Definition at line 393 of file map_label.cpp.
References color_.
Referenced by do_replay_handle(), editor::mouse_action_map_label::drag_left(), and read().

| void terrain_label::draw | ( | ) | [private] |
Definition at line 442 of file map_label.cpp.
References font::add_floating_label(), font::ANCHOR_LABEL_MAP, calculate_shroud(), clear(), color_, map_labels::disp(), t_string::empty(), display::get_location_x(), display::get_location_y(), handle_, font::LABEL_COLOR, loc_, display::map_outside_area(), parent_, font::SIZE_NORMAL, t_string::str(), text_, visible(), map_location::x, and map_location::y.
Referenced by recalculate(), terrain_label(), and update_info().


| bool terrain_label::immutable | ( | ) | const |
Definition at line 383 of file map_label.cpp.
References immutable_.
Referenced by playsingle_controller::can_execute_command(), editor::mouse_action_map_label::drag_left(), and editor::mouse_action_map_label::up_left().

| const map_location & terrain_label::location | ( | ) | const |
Definition at line 388 of file map_label.cpp.
References loc_.
Referenced by do_replay_handle().

| const terrain_label& terrain_label::operator= | ( | const terrain_label & | ) | [private] |
| void terrain_label::read | ( | const config & | cfg | ) |
Definition at line 325 of file map_label.cpp.
References color(), color_, immutable_, int_to_color(), utils::interpolate_variables_into_string(), utils::interpolate_variables_into_tstring(), font::LABEL_COLOR, loc_, resources::state_of_game, string2rgb(), team_name_, text_, visible_in_fog_, and visible_in_shroud_.
Referenced by terrain_label().


| void terrain_label::recalculate | ( | ) |
Definition at line 427 of file map_label.cpp.
References draw().
Referenced by map_labels::set_label().


| void terrain_label::set_text | ( | const t_string & | text | ) |
Definition at line 412 of file map_label.cpp.
References text_.
| const std::string & terrain_label::team_name | ( | ) | const |
Definition at line 368 of file map_label.cpp.
References team_name_.
Referenced by map_labels::add_label(), do_replay_handle(), editor::mouse_action_map_label::drag_left(), events::menu_handler::label_terrain(), editor::mouse_action_map_label::up_left(), and write().

| const t_string & terrain_label::text | ( | ) | const |
Definition at line 363 of file map_label.cpp.
References text_.
Referenced by do_replay_handle(), events::menu_handler::do_search(), editor::mouse_action_map_label::drag_left(), events::menu_handler::label_terrain(), editor::mouse_action_map_label::up_left(), and write().

| void terrain_label::update_info | ( | const t_string & | text, | |
| const std::string & | team_name, | |||
| const SDL_Color | color | |||
| ) |
Definition at line 417 of file map_label.cpp.
References color_, draw(), team_name_, and text_.

| bool terrain_label::visible | ( | ) | const [private] |
Definition at line 477 of file map_label.cpp.
References map_labels::disp(), display::fogged(), is_observer(), loc_, team::nteams(), parent_, display::shrouded(), map_labels::team_name(), team_name_, map_labels::visible_global_label(), visible_in_fog_, and visible_in_shroud_.
Referenced by draw().


| bool terrain_label::visible_in_fog | ( | ) | const |
Definition at line 373 of file map_label.cpp.
References visible_in_fog_.
Referenced by editor::mouse_action_map_label::drag_left(), and editor::mouse_action_map_label::up_left().

| bool terrain_label::visible_in_shroud | ( | ) | const |
Definition at line 378 of file map_label.cpp.
References visible_in_shroud_.
Referenced by editor::mouse_action_map_label::drag_left(), and editor::mouse_action_map_label::up_left().

| void terrain_label::write | ( | config & | res | ) | const |
Definition at line 352 of file map_label.cpp.
References cfg_color(), immutable_, loc_, team_name(), text(), visible_in_fog_, visible_in_shroud_, and map_location::write().
Referenced by replay::add_label().


SDL_Color terrain_label::color_ [private] |
Definition at line 136 of file map_label.hpp.
Referenced by cfg_color(), color(), draw(), read(), and update_info().
int terrain_label::handle_ [private] |
Definition at line 128 of file map_label.hpp.
Referenced by calculate_shroud(), clear(), and draw().
bool terrain_label::immutable_ [private] |
Definition at line 134 of file map_label.hpp.
Referenced by immutable(), read(), and write().
map_location terrain_label::loc_ [private] |
Definition at line 139 of file map_label.hpp.
Referenced by calculate_shroud(), draw(), location(), read(), visible(), and write().
const map_labels* terrain_label::parent_ [private] |
Definition at line 138 of file map_label.hpp.
Referenced by calculate_shroud(), draw(), and visible().
std::string terrain_label::team_name_ [private] |
Definition at line 131 of file map_label.hpp.
Referenced by read(), team_name(), update_info(), and visible().
t_string terrain_label::text_ [private] |
Definition at line 130 of file map_label.hpp.
Referenced by draw(), read(), set_text(), text(), and update_info().
bool terrain_label::visible_in_fog_ [private] |
Definition at line 132 of file map_label.hpp.
Referenced by read(), visible(), visible_in_fog(), and write().
bool terrain_label::visible_in_shroud_ [private] |
Definition at line 133 of file map_label.hpp.
Referenced by calculate_shroud(), read(), visible(), visible_in_shroud(), and write().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:16:34 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |