#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 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 color_t 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 std::string & | team_name () const |
const std::vector< std::string > & | all_categories () const |
void | set_team (const team *) |
void | clear_all () |
Private Member Functions | |
template<typename... T> | |
terrain_label * | add_label (T &&... args) |
void | clear_map (label_map &, bool) |
terrain_label * | get_label_private (const map_location &loc, const std::string &team_name) |
Private Attributes | |
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 203 of file label.cpp.
References categories_dirty, labels_, and t.
Referenced by read(), and set_label().
const std::vector< std::string > & map_labels::all_categories | ( | ) | const |
Definition at line 287 of file label.cpp.
References categories, categories_dirty, resources::gameboard, labels_, and t.
Referenced by gui2::dialogs::label_settings::label_settings().
void map_labels::clear | ( | const std::string & | team_name, |
bool | force | ||
) |
Definition at line 211 of file label.cpp.
References categories_dirty, clear_map(), i, labels_, and team_name().
Referenced by do_replay_handle().
void map_labels::clear_all | ( | ) |
Definition at line 240 of file label.cpp.
References 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().
|
private |
Definition at line 226 of file label.cpp.
References categories_dirty, and i.
Referenced by clear().
void map_labels::enable | ( | bool | is_enabled | ) |
Definition at line 254 of file label.cpp.
References enabled_, and recalculate_labels().
Referenced by editor::context_manager::refresh_on_context_change().
|
inline |
Definition at line 67 of file label.hpp.
References enabled_.
Referenced by terrain_label::viewable().
const terrain_label * map_labels::get_label | ( | const map_location & | loc | ) | const |
Definition at line 116 of file label.cpp.
References get_label(), loc, and team_name().
|
inline |
Definition at line 48 of file label.hpp.
References get_label_private(), loc, and team_name().
Referenced by editor::mouse_action_map_label::drag_end_left(), get_label(), game_lua_kernel::intf_get_label(), and editor::mouse_action_map_label::up_left().
|
private |
Definition at line 103 of file label.cpp.
References labels_, loc, and team_name().
Referenced by get_label(), and set_label().
map_labels & map_labels::operator= | ( | const map_labels & | other | ) |
Definition at line 70 of file label.cpp.
References map_labels(), and ~map_labels().
void map_labels::read | ( | const config & | cfg | ) |
Definition at line 92 of file label.cpp.
References add_label(), config::child_range(), clear_all(), i, and recalculate_labels().
Referenced by editor::map_context::load_scenario(), and map_labels().
void map_labels::recalculate_labels | ( | ) |
Definition at line 245 of file label.cpp.
References labels_.
Referenced by editor::editor_controller::display_redraw_callback(), editor::editor_controller::do_execute_command(), enable(), display::queue_rerender(), read(), display::set_viewing_team_index(), and display::set_zoom().
void map_labels::recalculate_shroud | ( | ) |
Definition at line 278 of file label.cpp.
References labels_.
Referenced by game_lua_kernel::intf_override_shroud(), game_lua_kernel::intf_toggle_shroud(), 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 color_t | 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 147 of file label.cpp.
References add_label(), categories_dirty, get_label_private(), labels_, loc, terrain_label::recalculate(), t_string::str(), team_name(), and tooltip.
Referenced by do_replay_handle(), game_lua_kernel::intf_add_label(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_remove_label(), 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().
void map_labels::set_team | ( | const team * | team | ) |
Definition at line 139 of file label.cpp.
References categories_dirty, and team_.
Referenced by display::set_viewing_team_index().
const std::string & map_labels::team_name | ( | ) | const |
Definition at line 129 of file label.cpp.
References team_, and team::team_name().
Referenced by clear(), get_label(), get_label_private(), set_label(), 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 267 of file label.cpp.
References labels_, loc, team_, and team_name().
Referenced by terrain_label::viewable().
void map_labels::write | ( | config & | res | ) | const |
Definition at line 80 of file label.cpp.
References config::add_child(), label, and labels_.
Referenced by map_labels(), and editor::map_context::to_config().
|
mutableprivate |
Definition at line 102 of file label.hpp.
Referenced by all_categories().
|
mutableprivate |
Definition at line 103 of file label.hpp.
Referenced by add_label(), all_categories(), clear(), clear_map(), set_label(), and set_team().
|
private |
|
private |
Definition at line 99 of file label.hpp.
Referenced by add_label(), all_categories(), clear(), clear_all(), get_label_private(), recalculate_labels(), recalculate_shroud(), set_label(), visible_global_label(), and write().
|
private |
Definition at line 97 of file label.hpp.
Referenced by set_team(), team_name(), and visible_global_label().