#include <label.hpp>
Public Types | |
typedef std::map< map_location, terrain_label * > | label_map |
typedef std::map< std::string, label_map > | team_label_map |
Public Member Functions | |
map_labels (const map_labels &) | |
map_labels (const display &disp, const team *) | |
~map_labels () | |
map_labels & | operator= (const map_labels &) |
void | write (config &res) const |
void | read (const config &cfg) |
const terrain_label * | get_label (const map_location &loc, const std::string &team_name) const |
const terrain_label * | get_label (const map_location &loc) const |
const terrain_label * | set_label (const map_location &loc, const t_string &text, const int creator=-1, const std::string &team="", const SDL_Color color=font::NORMAL_COLOR, const bool visible_in_fog=true, const bool visible_in_shroud=false, const bool immutable=false, const std::string &category="", const t_string &tooltip="") |
bool | enabled () const |
void | enable (bool is_enabled) |
void | clear (const std::string &, bool force) |
void | recalculate_labels () |
void | recalculate_shroud () |
bool | visible_global_label (const map_location &) const |
Returns whether or not a global (non-team) label can be shown at a specified location. More... | |
const display & | disp () const |
const std::string & | team_name () const |
const std::vector< std::string > & | all_categories () const |
void | set_team (const team *) |
void | clear_all () |
Private Member Functions | |
void | add_label (const map_location &, terrain_label *) |
void | clear_map (label_map &, bool) |
terrain_label * | get_label_private (const map_location &loc, const std::string &team_name) |
For our private use, a wrapper for get_label() that can return a pointer to a non-const terrain_label. More... | |
Private Attributes | |
const display & | disp_ |
const team * | team_ |
team_label_map | labels_ |
bool | enabled_ |
std::vector< std::string > | categories |
bool | categories_dirty |
typedef std::map<map_location, terrain_label *> map_labels::label_map |
typedef std::map<std::string,label_map> map_labels::team_label_map |
map_labels::map_labels | ( | const map_labels & | other | ) |
map_labels::~map_labels | ( | ) |
|
private |
Definition at line 211 of file label.cpp.
References categories_dirty, labels_, and terrain_label::team_name().
Referenced by read(), and set_label().
const std::vector< std::string > & map_labels::all_categories | ( | ) | const |
Definition at line 296 of file label.cpp.
References categories, categories_dirty, i, labels_, and resources::teams.
Referenced by gui2::tlabel_settings::tlabel_settings().
void map_labels::clear | ( | const std::string & | team_name, |
bool | force | ||
) |
Definition at line 217 of file label.cpp.
References categories_dirty, clear_map(), i, and labels_.
Referenced by events::menu_handler::clear_labels(), and do_replay_handle().
void map_labels::clear_all | ( | ) |
Definition at line 246 of file label.cpp.
References clear_map(), and labels_.
Referenced by editor::map_context::clear_starting_position_labels(), game_lua_kernel::intf_find_cost_map(), read(), ai::default_recruitment::recruitment::show_important_hexes(), and ~map_labels().
Definition at line 233 of file label.cpp.
References categories_dirty, and i.
Referenced by clear(), and clear_all().
const display & map_labels::disp | ( | ) | const |
Definition at line 120 of file label.cpp.
References disp_.
Referenced by terrain_label::draw(), terrain_label::get_rect(), and terrain_label::hidden().
void map_labels::enable | ( | bool | is_enabled | ) |
Definition at line 266 of file label.cpp.
References enabled_, and recalculate_labels().
Referenced by editor::map_context_refresher::refresh().
|
inline |
Definition at line 58 of file label.hpp.
References enabled_.
Referenced by terrain_label::viewable().
const terrain_label * map_labels::get_label | ( | const map_location & | loc, |
const std::string & | team_name | ||
) | const |
Definition at line 97 of file label.cpp.
Referenced by events::menu_handler::do_search(), editor::mouse_action_map_label::drag_left(), get_label(), get_label_private(), events::menu_handler::label_terrain(), editor::editor_action_label::perform(), editor::editor_action_label_delete::perform(), and editor::mouse_action_map_label::up_left().
const terrain_label * map_labels::get_label | ( | const map_location & | loc | ) | const |
Definition at line 108 of file label.cpp.
References get_label(), and team_name().
|
inlineprivate |
For our private use, a wrapper for get_label() that can return a pointer to a non-const terrain_label.
Definition at line 86 of file label.hpp.
References get_label().
Referenced by set_label().
map_labels & map_labels::operator= | ( | const map_labels & | other | ) |
Definition at line 61 of file label.cpp.
References map_labels(), and ~map_labels().
Definition at line 84 of file label.cpp.
References add_label(), config::child_range(), clear_all(), resources::gamedata, i, and recalculate_labels().
Referenced by editor::map_context::load_scenario(), and map_labels().
void map_labels::recalculate_labels | ( | ) |
Definition at line 255 of file label.cpp.
References labels_.
Referenced by enable(), events::menu_handler::label_settings(), turn_info::process_network_data(), read(), display::redraw_everything(), display::set_team(), and display::set_zoom().
void map_labels::recalculate_shroud | ( | ) |
Definition at line 285 of file label.cpp.
References labels_.
Referenced by game_lua_kernel::intf_shroud_op(), actions::shroud_clearer::invalidate_after_clear(), and display::scroll().
const terrain_label * map_labels::set_label | ( | const map_location & | loc, |
const t_string & | text, | ||
const int | creator = -1 , |
||
const std::string & | team = "" , |
||
const SDL_Color | color = font::NORMAL_COLOR , |
||
const bool | visible_in_fog = true , |
||
const bool | visible_in_shroud = false , |
||
const bool | immutable = false , |
||
const std::string & | category = "" , |
||
const t_string & | tooltip = "" |
||
) |
Definition at line 145 of file label.cpp.
References add_label(), categories_dirty, get_label_private(), labels_, terrain_label::recalculate(), and t_string::str().
Referenced by do_replay_handle(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_label(), events::menu_handler::label_terrain(), editor::editor_action_label::perform_without_undo(), editor::editor_action_label_delete::perform_without_undo(), editor::editor_map::set_starting_position_labels(), and ai::default_recruitment::recruitment::show_important_hexes().
Definition at line 135 of file label.cpp.
References categories_dirty, and team_.
Referenced by display::set_team().
const std::string & map_labels::team_name | ( | ) | const |
Definition at line 125 of file label.cpp.
References team_, and team::team_name().
Referenced by get_label(), events::menu_handler::label_terrain(), terrain_label::viewable(), and visible_global_label().
bool map_labels::visible_global_label | ( | const map_location & | loc | ) | const |
Returns whether or not a global (non-team) label can be shown at a specified location.
(Global labels are suppressed in favor of team labels.)
Definition at line 278 of file label.cpp.
References labels_, and team_name().
Referenced by terrain_label::viewable().
Definition at line 70 of file label.cpp.
References config::add_child(), i, and labels_.
Referenced by map_labels(), and editor::map_context::to_config().
|
mutableprivate |
Definition at line 97 of file label.hpp.
Referenced by all_categories().
|
mutableprivate |
Definition at line 98 of file label.hpp.
Referenced by add_label(), all_categories(), clear(), clear_map(), set_label(), and set_team().
|
private |
|
private |
|
private |
Definition at line 94 of file label.hpp.
Referenced by add_label(), all_categories(), clear(), clear_all(), get_label(), recalculate_labels(), recalculate_shroud(), set_label(), visible_global_label(), and write().
|
private |
Definition at line 92 of file label.hpp.
Referenced by set_team(), and team_name().