#include <menu_events.hpp>
Public Member Functions | |
menu_handler (game_display *gui, unit_map &units, std::vector< team > &teams, const config &level, const gamemap &map, const config &game_config, const gamestatus &status, game_state &gamestate, undo_list &undo_stack, undo_list &redo_stack) | |
virtual | ~menu_handler () |
const undo_list & | get_undo_list () const |
gui::floating_textbox & | get_textbox () |
void | set_gui (game_display *gui) |
std::string | get_title_suffix (int team_num) |
void | objectives (const unsigned int team_num) |
void | show_statistics (const unsigned int team_num) |
void | unit_list () |
void | status_table (int selected=0) |
void | save_game (const std::string &message, gui::DIALOG_TYPE dialog_type, const bool has_exit_button=false, const bool replay=false) |
void | save_map () |
void | load_game () |
void | preferences () |
void | show_chat_log () |
void | show_help () |
void | speak () |
void | whisper () |
void | shout () |
void | recruit (const bool browse, const unsigned int team_num, const gamemap::location &last_hex) |
void | repeat_recruit (const unsigned int team_num, const gamemap::location &last_hex) |
void | recall (const unsigned int team_num, const gamemap::location &last_hex) |
void | undo (const unsigned int team_num) |
void | redo (const unsigned int team_num) |
void | show_enemy_moves (bool ignore_units, const unsigned int team_num) |
void | toggle_shroud_updates (const unsigned int team_num) |
void | update_shroud_now (const unsigned int team_num) |
bool | end_turn (const unsigned int team_num) |
void | goto_leader (const unsigned int team_num) |
void | unit_description (mouse_handler &mousehandler) |
void | rename_unit (mouse_handler &mousehandler) |
void | create_unit (mouse_handler &mousehandler) |
void | change_unit_side (mouse_handler &mousehandler) |
void | label_terrain (mouse_handler &mousehandler, bool team_only) |
void | clear_labels () |
void | continue_move (mouse_handler &mousehandler, const unsigned int team_num) |
void | toggle_grid () |
void | unit_hold_position (mouse_handler &mousehandler, const unsigned int team_num) |
void | end_unit_turn (mouse_handler &mousehandler, const unsigned int team_num) |
void | search () |
void | user_command () |
void | custom_command (mouse_handler &mousehandler, const unsigned int team_num) |
void | ai_formula () |
void | clear_messages () |
unit_map::iterator | current_unit (mouse_handler &mousehandler) |
unit_map::const_iterator | current_unit (const mouse_handler &mousehandler) const |
void | move_unit_to_loc (const unit_map::const_iterator &ui, const gamemap::location &target, bool continue_move, const unsigned int team_num, mouse_handler &mousehandler) |
void | do_speak () |
void | do_search (const std::string &new_search) |
void | do_command (const std::string &str, const unsigned int team_num, mouse_handler &mousehandler) |
void | do_ai_formula (const std::string &str, const unsigned int team_num, mouse_handler &mousehandler) |
void | clear_undo_stack (const unsigned int team_num) |
void | autosave (const std::string &label, unsigned turn, const config &starting_pos) const |
bool | has_team () const |
Protected Member Functions | |
void | add_chat_message (const time_t &time, const std::string &speaker, int side, const std::string &message, game_display::MESSAGE_TYPE type=game_display::MESSAGE_PRIVATE) |
void | send_chat_message (const std::string &message, bool allies_only=false) |
Private Member Functions | |
void | do_recruit (const std::string &name, const unsigned int team_num, const gamemap::location &last_hex) |
void | write_game_snapshot (config &start) const |
bool | has_friends () const |
bool | clear_shroud (const unsigned int team_num) |
void | scenario_settings_table (int selected=0) |
Static Private Member Functions | |
static void | change_side_controller (const std::string &side, const std::string &player, bool own_side=false) |
Private Attributes | |
game_display * | gui_ |
unit_map & | units_ |
std::vector< team > & | teams_ |
const config & | level_ |
const gamemap & | map_ |
const config & | game_config_ |
const gamestatus & | status_ |
game_state & | gamestate_ |
undo_list & | undo_stack_ |
undo_list & | redo_stack_ |
gui::floating_textbox | textbox_info_ |
std::string | last_search_ |
gamemap::location | last_search_hit_ |
std::string | last_recruit_ |
Friends | |
class | console_handler |
Definition at line 91 of file menu_events.hpp.
events::menu_handler::menu_handler | ( | game_display * | gui, | |
unit_map & | units, | |||
std::vector< team > & | teams, | |||
const config & | level, | |||
const gamemap & | map, | |||
const config & | game_config, | |||
const gamestatus & | status, | |||
game_state & | gamestate, | |||
undo_list & | undo_stack, | |||
undo_list & | redo_stack | |||
) |
Definition at line 333 of file menu_events.cpp.
events::menu_handler::~menu_handler | ( | ) | [virtual] |
Definition at line 343 of file menu_events.cpp.
const undo_list & events::menu_handler::get_undo_list | ( | ) | const |
gui::floating_textbox & events::menu_handler::get_textbox | ( | ) |
Definition at line 350 of file menu_events.cpp.
References textbox_info_.
Referenced by play_controller::enter_textbox(), play_controller::handle_event(), and play_controller::play_slice().
void events::menu_handler::set_gui | ( | game_display * | gui | ) | [inline] |
Definition at line 101 of file menu_events.hpp.
References gui_.
Referenced by play_controller::init().
std::string events::menu_handler::get_title_suffix | ( | int | team_num | ) |
Definition at line 354 of file menu_events.cpp.
References unit_map::end(), team_leader(), teams_, and units_.
void events::menu_handler::objectives | ( | const unsigned int | team_num | ) |
Definition at line 372 of file menu_events.cpp.
References gui_, level_, dialogs::show_objectives(), and teams_.
Referenced by play_controller::objectives().
void events::menu_handler::show_statistics | ( | const unsigned int | team_num | ) |
Definition at line 378 of file menu_events.cpp.
References _, gui_, and teams_.
Referenced by replay_controller::show_statistics(), and play_controller::show_statistics().
void events::menu_handler::unit_list | ( | ) |
Definition at line 389 of file menu_events.cpp.
References _, gui::dialog::add_button(), gui::dialog::add_pane(), unit_map::begin(), font::BOLD_TEXT, gui::dialog::BUTTON_STANDARD, font::color2markup(), COLUMN_SEPARATOR, DEFAULT_ITEM, game_config::defense_color_scale, unit_map::end(), gamemap::get_terrain(), font::GREEN_TEXT, gui_, HEADING_PREFIX, IMAGE_PREFIX, IMG_TEXT_SEPARATOR, loc, map_, font::NORMAL_TEXT, gui::NULL_DIALOG, gui::OK_CANCEL, font::RED_TEXT, rgb2highlight(), display::scroll_to_tile(), game_display::select_hex(), display::selected_hex(), gui::menu::basic_sorter::set_alpha_sort(), gui::dialog::set_basic_behavior(), gui::dialog::set_menu(), dialogs::unit_preview_pane::set_selection(), gui::dialog::show(), utils::string_bool(), units_, display::video(), game_display::viewing_team(), and display::WARP.
Referenced by play_controller::unit_list().
void events::menu_handler::status_table | ( | int | selected = 0 |
) |
Definition at line 558 of file menu_events.cpp.
References _, font::BAD_TEXT, gui::dialog::BUTTON_EXTRA_LEFT, calculate_team_data(), COLUMN_SEPARATOR, data, game_config::debug, gui::DIALOG_FORWARD, unit_map::end(), team::get_side_colour_index(), team::get_side_highlight(), team_data::gold, gui_, HEADING_PREFIX, IMAGE_PREFIX, team::is_enemy(), team::knows_about_team(), team_data::net_income, font::NULL_MARKUP, scenario_settings_table(), game_display::scroll_to_leader(), gui::menu::basic_sorter::set_redirect_sort(), team_leader(), team_data::teamname, teams_, gui::button::TYPE_PRESS, team_data::units, units_, team_data::upkeep, team::uses_fog(), display::video(), game_display::viewing_team(), and team_data::villages.
Referenced by scenario_settings_table(), and play_controller::status_table().
void events::menu_handler::save_game | ( | const std::string & | message, | |
gui::DIALOG_TYPE | dialog_type, | |||
const bool | has_exit_button = false , |
|||
const bool | replay = false | |||
) |
Definition at line 740 of file menu_events.cpp.
References _, gamestate_, dialogs::get_save_name(), gui_, dialogs::is_illegal_file_char(), game_state::label, font::make_text_ellipsis(), gui::NULL_DIALOG, QUIT, recorder, replay::save_game(), gui::message_dialog::show(), font::SIZE_NORMAL, game_state::starting_pos, status_, stream, gamestatus::turn(), and write_game_snapshot().
Referenced by events::console_handler::do_save(), events::console_handler::do_save_quit(), playsingle_controller::play_scenario(), playmp_controller::process_oos(), play_controller::save_game(), and play_controller::save_replay().
void events::menu_handler::save_map | ( | ) |
Definition at line 783 of file menu_events.cpp.
References _, file_exists(), get_dir(), get_user_data_dir(), gui_, map_, dialogs::show_file_chooser_dialog(), vgettext(), io_exception::what(), gamemap::write(), write_file(), and gui::YES_NO.
Referenced by play_controller::save_map().
void events::menu_handler::load_game | ( | ) |
Definition at line 919 of file menu_events.cpp.
References game_config_, gui_, and dialogs::load_game_dialog().
Referenced by play_controller::load_game().
void events::menu_handler::preferences | ( | ) |
Definition at line 928 of file menu_events.cpp.
References game_config_, gui_, display::redraw_everything(), and preferences::show_preferences_dialog().
Referenced by play_controller::preferences().
void events::menu_handler::show_chat_log | ( | ) |
Definition at line 934 of file menu_events.cpp.
References _, replay::build_chat_log(), gui::CLOSE_ONLY, gui_, is_observer(), game_config::observer_team_name, recorder, gui::show_dialog(), teams_, text, and game_display::viewing_team().
Referenced by play_controller::show_chat_log().
void events::menu_handler::show_help | ( | ) |
Definition at line 942 of file menu_events.cpp.
References gui_, and help::show_help().
Referenced by play_controller::show_help().
void events::menu_handler::speak | ( | ) |
Definition at line 947 of file menu_events.cpp.
References _, gui_, has_friends(), is_observer(), preferences::message_private(), gui::floating_textbox::show(), textbox_info_, and gui::TEXTBOX_MESSAGE.
Referenced by shout(), playmp_controller::speak(), and whisper().
void events::menu_handler::whisper | ( | ) |
Definition at line 954 of file menu_events.cpp.
References preferences::set_message_private(), and speak().
Referenced by playmp_controller::whisper().
void events::menu_handler::shout | ( | ) |
Definition at line 960 of file menu_events.cpp.
References preferences::set_message_private(), and speak().
Referenced by playmp_controller::shout().
void events::menu_handler::recruit | ( | const bool | browse, | |
const unsigned int | team_num, | |||
const gamemap::location & | last_hex | |||
) |
Definition at line 996 of file menu_events.cpp.
References _, gui::dialog::add_button(), font::BAD_TEXT, gui::dialog::BUTTON_HELP, COLUMN_SEPARATOR, unit_type::cost(), gui::dialog::default_style, description, do_recruit(), game_display::draw(), boost::foreach_detail_::end(), ERR_NG, unit_type::flag_rgb(), team::get_side_colour_index(), get_title_suffix(), team::gold(), gui_, unit_type::image(), font::IMAGE, font::LARGE_TEXT, map_, font::NULL_MARKUP, gui::OK_CANCEL, team::recruits(), gui::dialog::set_menu(), gui::dialog::set_panes(), gui::dialog::show(), gui::message_dialog::show(), sngettext(), teams_, type, unit_type::type_name(), and unit_type_data::types().
Referenced by playsingle_controller::recruit().
void events::menu_handler::repeat_recruit | ( | const unsigned int | team_num, | |
const gamemap::location & | last_hex | |||
) |
Definition at line 1065 of file menu_events.cpp.
References do_recruit(), and last_recruit_.
Referenced by playsingle_controller::repeat_recruit().
void events::menu_handler::recall | ( | const unsigned int | team_num, | |
const gamemap::location & | last_hex | |||
) |
Definition at line 1135 of file menu_events.cpp.
References _, gui::dialog::add_button(), replay::add_checksum_check(), gui::dialog::add_pane(), replay::add_recall(), player_info::available_units, gui::dialog::BUTTON_HELP, clear_shroud(), clear_undo_stack(), COLUMN_SEPARATOR, gui::dialog::default_style, game_display::draw(), lg::err, ERR_NG, gamestate_, game_state::get_player(), team::get_side_colour_index(), get_title_suffix(), team::gold(), gui_, HEADING_PREFIX, IMAGE_PREFIX, display::invalidate_all(), display::invalidate_game_status(), level_, lexical_cast(), LOG_NG, map_, gui::OK_CANCEL, gui::OK_ONLY, game_config::recall_cost, statistics::recall_unit(), recorder, recruit_unit(), redo_stack_, gui::menu::basic_sorter::set_alpha_sort(), unit::set_game_context(), gui::dialog::set_menu(), gui::dialog::show(), sort_units(), team::spend_gold(), status_, utils::string_bool(), teams_, replay::undo(), undo_stack_, units_, and vngettext().
Referenced by playsingle_controller::recall().
void events::menu_handler::undo | ( | const unsigned int | team_num | ) |
Definition at line 1254 of file menu_events.cpp.
References unit_map::add(), player_info::available_units, clear_shroud(), unit::clear_status_caches(), unit_type::cost(), unit_map::count(), undo_action::countdown_time_bonus, game_display::draw(), unit_map::end(), unit_map::erase(), ERR_NG, unit_map::extract(), unit_map::find(), gamestate_, game_state::get_player(), get_village(), gui_, game_display::invalidate(), display::invalidate_game_status(), game_display::invalidate_unit(), undo_action::is_recall(), undo_action::is_recruit(), gamemap::is_village(), map_, unit_display::move_unit(), undo_action::original_village_owner, display::recalculate_minimap(), game_config::recall_cost, undo_action::recall_loc, undo_action::recall_pos, recorder, redo_stack_, display::redraw_minimap(), undo_action::route, team::spend_gold(), undo_action::starting_moves, teams_, unit::type(), statistics::un_recall_unit(), statistics::un_recruit_unit(), replay::undo(), undo_stack_, and units_.
Referenced by play_controller::handle_event(), and play_controller::undo().
void events::menu_handler::redo | ( | const unsigned int | team_num | ) |
Definition at line 1362 of file menu_events.cpp.
References team::action_bonus_count(), unit_map::add(), replay::add_checksum_check(), replay::add_movement(), replay::add_recall(), replay::add_recruit(), undo_action::affected_unit, player_info::available_units, unit::clear_status_caches(), unit_type::cost(), undo_action::countdown_time_bonus, game_display::draw(), unit_map::end(), ERR_NG, unit_map::extract(), unit_map::find(), gamestate_, game_state::get_player(), get_village(), gui_, game_display::invalidate(), display::invalidate_game_status(), game_display::invalidate_unit(), undo_action::is_recall(), undo_action::is_recruit(), gamemap::is_village(), last_recruit_, map_, unit_display::move_unit(), gui::OK_ONLY, r, game_config::recall_cost, undo_action::recall_loc, undo_action::recall_pos, statistics::recall_unit(), recorder, statistics::recruit_unit(), recruit_unit(), team::recruits(), redo_stack_, undo_action::route, team::set_action_bonus_count(), unit::set_game_context(), team::spend_gold(), undo_action::starting_moves, status_, teams_, unit::type(), unit::type_id(), replay::undo(), undo_stack_, and units_.
Referenced by play_controller::redo().
void events::menu_handler::show_enemy_moves | ( | bool | ignore_units, | |
const unsigned int | team_num | |||
) |
Definition at line 1495 of file menu_events.cpp.
References unit_map::begin(), unit_map::end(), display::fogged(), gui_, game_display::highlight_another_reach(), map_, game_config::path, teams_, game_display::unhighlight_reach(), units_, and game_display::viewing_team().
Referenced by play_controller::show_enemy_moves().
void events::menu_handler::toggle_shroud_updates | ( | const unsigned int | team_num | ) |
Definition at line 1514 of file menu_events.cpp.
References teams_, and update_shroud_now().
Referenced by playsingle_controller::toggle_shroud_updates().
void events::menu_handler::update_shroud_now | ( | const unsigned int | team_num | ) |
Definition at line 1521 of file menu_events.cpp.
References clear_undo_stack().
Referenced by toggle_shroud_updates(), and playsingle_controller::update_shroud_now().
bool events::menu_handler::end_turn | ( | const unsigned int | team_num | ) |
Definition at line 1526 of file menu_events.cpp.
References _, unit_map::begin(), preferences::confirm_no_moves(), unit_map::end(), preferences::green_confirm(), gui_, map_, teams_, unit_can_move(), units_, preferences::yellow_confirm(), and gui::YES_NO.
Referenced by playsingle_controller::end_turn().
void events::menu_handler::goto_leader | ( | const unsigned int | team_num | ) |
Definition at line 1570 of file menu_events.cpp.
References clear_shroud(), unit_map::end(), gui_, display::scroll_to_tile(), team_leader(), units_, and display::WARP.
Referenced by play_controller::goto_leader().
void events::menu_handler::unit_description | ( | mouse_handler & | mousehandler | ) |
Definition at line 1579 of file menu_events.cpp.
References current_unit(), unit_map::end(), gui_, dialogs::show_unit_description(), and units_.
Referenced by play_controller::unit_description().
void events::menu_handler::rename_unit | ( | mouse_handler & | mousehandler | ) |
Definition at line 1587 of file menu_events.cpp.
References _, replay::add_rename(), current_unit(), unit_map::end(), gui_, game_display::invalidate_unit(), gui::OK_CANCEL, recorder, gui::show_dialog(), units_, and game_display::viewing_team().
Referenced by playsingle_controller::rename_unit().
void events::menu_handler::create_unit | ( | mouse_handler & | mousehandler | ) |
Definition at line 1628 of file menu_events.cpp.
References _, unit_map::add(), gui::dialog::add_pane(), boost::foreach_detail_::begin(), COLUMN_SEPARATOR, unit_map::erase(), events::mouse_handler::get_last_hex(), gui::dialog::get_menu(), gui_, HEADING_PREFIX, game_display::invalidate(), game_display::invalidate_unit(), map_, unit::new_turn(), gui::OK_CANCEL, gui::menu::basic_sorter::set_alpha_sort(), gui::dialog::set_menu(), dialogs::unit_preview_pane::set_selection(), gui::dialog::show(), status_, teams_, unit_type_data::types(), units_, and unit_type::WITHOUT_ANIMATIONS.
Referenced by playsingle_controller::create_unit().
void events::menu_handler::change_unit_side | ( | mouse_handler & | mousehandler | ) |
Definition at line 1683 of file menu_events.cpp.
References unit_map::end(), unit_map::find(), events::mouse_handler::get_last_hex(), team::nteams(), and units_.
Referenced by playsingle_controller::change_unit_side().
void events::menu_handler::label_terrain | ( | mouse_handler & | mousehandler, | |
bool | team_only | |||
) |
Definition at line 1699 of file menu_events.cpp.
References _, replay::add_label(), gui::dialog::add_option(), gui::dialog::BUTTON_CHECKBOX_LEFT, map_labels::get_label(), events::mouse_handler::get_last_hex(), map_labels::get_max_chars(), team::get_side_rgb(), gui_, int_to_color(), font::LABEL_COLOUR, display::labels(), map_, gamemap::MAX_PLAYERS, gui::OK_CANCEL, gamemap::on_board(), gui::dialog::option_checked(), recorder, map_labels::set_label(), gui::dialog::set_textbox(), gui::dialog::show(), map_labels::team_name(), terrain_label::team_name(), game_config::team_rgb_range, terrain_label::text(), gui::dialog::textbox_text(), and game_display::viewing_team().
Referenced by playsingle_controller::label_terrain().
void events::menu_handler::clear_labels | ( | ) |
Definition at line 1732 of file menu_events.cpp.
References map_labels::clear(), replay::clear_labels(), game_display::current_team_name(), gui_, is_observer(), display::labels(), recorder, and game_display::team_valid().
Referenced by playmp_controller::clear_labels().
void events::menu_handler::continue_move | ( | mouse_handler & | mousehandler, | |
const unsigned int | team_num | |||
) |
Definition at line 1742 of file menu_events.cpp.
References current_unit(), unit_map::end(), unit_map::find(), events::mouse_handler::get_selected_hex(), move_unit_to_loc(), and units_.
Referenced by playsingle_controller::continue_move().
void events::menu_handler::toggle_grid | ( | ) |
Definition at line 1768 of file menu_events.cpp.
References preferences::grid(), gui_, display::invalidate_all(), and preferences::set_grid().
Referenced by play_controller::toggle_grid().
void events::menu_handler::unit_hold_position | ( | mouse_handler & | mousehandler, | |
const unsigned int | team_num | |||
) |
Definition at line 1774 of file menu_events.cpp.
References events::mouse_handler::cycle_units(), game_display::draw(), unit_map::end(), unit_map::find(), events::mouse_handler::get_selected_hex(), gui_, game_display::invalidate(), events::mouse_handler::set_current_paths(), and units_.
Referenced by playsingle_controller::unit_hold_position().
void events::menu_handler::end_unit_turn | ( | mouse_handler & | mousehandler, | |
const unsigned int | team_num | |||
) |
Definition at line 1791 of file menu_events.cpp.
References events::mouse_handler::cycle_units(), game_display::draw(), unit_map::end(), unit_map::find(), events::mouse_handler::get_selected_hex(), gui_, game_display::invalidate(), events::mouse_handler::set_current_paths(), and units_.
Referenced by playsingle_controller::end_unit_turn().
void events::menu_handler::search | ( | ) |
Definition at line 1810 of file menu_events.cpp.
References _, gui_, last_search_, last_search_hit_, gui::floating_textbox::show(), textbox_info_, gui::TEXTBOX_SEARCH, and gamemap::location::valid().
Referenced by play_controller::search().
void events::menu_handler::user_command | ( | ) |
Definition at line 2963 of file menu_events.cpp.
References gui_, sgettext(), gui::floating_textbox::show(), gui::TEXTBOX_COMMAND, and textbox_info_.
Referenced by playsingle_controller::user_command().
void events::menu_handler::custom_command | ( | mouse_handler & | mousehandler, | |
const unsigned int | team_num | |||
) |
Definition at line 2968 of file menu_events.cpp.
References preferences::custom_command(), do_command(), and utils::split().
Referenced by playsingle_controller::custom_command().
void events::menu_handler::ai_formula | ( | ) |
Definition at line 2977 of file menu_events.cpp.
References gui_, sgettext(), gui::floating_textbox::show(), gui::TEXTBOX_AI, and textbox_info_.
Referenced by playsingle_controller::ai_formula().
void events::menu_handler::clear_messages | ( | ) |
Definition at line 2983 of file menu_events.cpp.
References game_display::clear_chat_messages(), and gui_.
Referenced by playsingle_controller::clear_messages().
unit_map::iterator events::menu_handler::current_unit | ( | mouse_handler & | mousehandler | ) |
Definition at line 1604 of file menu_events.cpp.
References unit_map::end(), find_visible_unit(), events::mouse_handler::get_last_hex(), events::mouse_handler::get_selected_hex(), gui_, map_, teams_, units_, and game_display::viewing_team().
Referenced by playsingle_controller::can_execute_command(), play_controller::can_execute_command(), continue_move(), events::console_handler::do_buff(), events::console_handler::do_unbuff(), events::console_handler::do_unit(), rename_unit(), and unit_description().
unit_map::const_iterator events::menu_handler::current_unit | ( | const mouse_handler & | mousehandler | ) | const |
Definition at line 1616 of file menu_events.cpp.
References unit_map::end(), find_visible_unit(), events::mouse_handler::get_last_hex(), events::mouse_handler::get_selected_hex(), gui_, map_, teams_, units_, and game_display::viewing_team().
void events::menu_handler::move_unit_to_loc | ( | const unit_map::const_iterator & | ui, | |
const gamemap::location & | target, | |||
bool | continue_move, | |||
const unsigned int | team_num, | |||
mouse_handler & | mousehandler | |||
) |
Definition at line 1752 of file menu_events.cpp.
References unit_map::end(), events::mouse_handler::get_route(), gui_, display::invalidate_game_status(), map_, move_unit(), recorder, game_display::set_route(), teams_, undo_stack_, and units_.
Referenced by playsingle_controller::before_human_turn(), and continue_move().
void events::menu_handler::do_speak | ( | ) |
Definition at line 1821 of file menu_events.cpp.
References gui::floating_textbox::box(), gui::floating_textbox::check(), events::chat_handler::do_speak(), and textbox_info_.
Referenced by play_controller::enter_textbox().
void events::menu_handler::do_search | ( | const std::string & | new_search | ) |
Definition at line 2622 of file menu_events.cpp.
References chars_equal_insensitive(), unit_map::end(), unit_map::find(), display::fogged(), map_labels::get_label(), gui_, gamemap::h(), game_display::highlight_hex(), display::labels(), last_search_, last_search_hit_, map_, display::ONSCREEN, display::scroll_to_tile(), display::shrouded(), utils::split(), teams_, terrain_label::text(), units_, gamemap::location::valid(), vgettext(), game_display::viewing_team(), gamemap::w(), gamemap::location::x, and gamemap::location::y.
Referenced by play_controller::enter_textbox().
void events::menu_handler::do_command | ( | const std::string & | str, | |
const unsigned int | team_num, | |||
mouse_handler & | mousehandler | |||
) |
Definition at line 2698 of file menu_events.cpp.
References events::map_command_handler< Worker >::dispatch().
Referenced by custom_command(), and play_controller::enter_textbox().
void events::menu_handler::do_ai_formula | ( | const std::string & | str, | |
const unsigned int | team_num, | |||
mouse_handler & | mousehandler | |||
) |
Definition at line 2946 of file menu_events.cpp.
References _, add_chat_message(), formula_ai::evaluate(), gamestate_, gui_, lg::info, map_, status_, teams_, and units_.
Referenced by play_controller::enter_textbox().
void events::menu_handler::clear_undo_stack | ( | const unsigned int | team_num | ) |
Definition at line 1487 of file menu_events.cpp.
References apply_shroud_changes(), gui_, map_, teams_, undo_stack_, and units_.
Referenced by playsingle_controller::after_human_turn(), playmp_controller::play_human_turn(), recall(), and update_shroud_now().
void events::menu_handler::autosave | ( | const std::string & | label, | |
unsigned | turn, | |||
const config & | starting_pos | |||
) | const |
Definition at line 893 of file menu_events.cpp.
References _, game_config::disable_autosave, boost::foreach_detail_::end(), gui_, lexical_cast(), LOG_NG, recorder, remove_old_auto_saves(), replay::save_game(), and write_game_snapshot().
Referenced by playsingle_controller::before_human_turn().
bool events::menu_handler::has_team | ( | ) | const |
Definition at line 981 of file menu_events.cpp.
References gui_, is_observer(), teams_, and game_display::viewing_team().
void events::menu_handler::add_chat_message | ( | const time_t & | time, | |
const std::string & | speaker, | |||
int | side, | |||
const std::string & | message, | |||
game_display::MESSAGE_TYPE | type = game_display::MESSAGE_PRIVATE | |||
) | [protected, virtual] |
Implements events::chat_handler.
Definition at line 1827 of file menu_events.cpp.
References game_display::add_chat_message(), and gui_.
Referenced by do_ai_formula(), and send_chat_message().
void events::menu_handler::send_chat_message | ( | const std::string & | message, | |
bool | allies_only = false | |||
) | [protected, virtual] |
Implements events::chat_handler.
Definition at line 2594 of file menu_events.cpp.
References add_chat_message(), cfg, gui_, has_friends(), is_observer(), lexical_cast(), preferences::login(), game_display::MESSAGE_PRIVATE, game_display::MESSAGE_PUBLIC, game_config::observer_team_name, recorder, replay::speak(), teams_, and game_display::viewing_team().
void events::menu_handler::do_recruit | ( | const std::string & | name, | |
const unsigned int | team_num, | |||
const gamemap::location & | last_hex | |||
) | [private] |
Referenced by recruit(), and repeat_recruit().
void events::menu_handler::write_game_snapshot | ( | config & | start | ) | const [private] |
Definition at line 816 of file menu_events.cpp.
References config::add_child(), unit_map::begin(), buf, unit_map::end(), gamestate_, config::get_children(), gui_, display::labels(), level_, map_, game_state::players, game_display::playing_team(), status_, teams_, units_, config::values, map_labels::write(), gamemap::write(), gamestatus::write(), game_events::write_events(), write_game(), sound::write_music_play_list(), and WRITE_SNAPSHOT_ONLY.
Referenced by autosave(), and save_game().
bool events::menu_handler::has_friends | ( | ) | const [private] |
Definition at line 966 of file menu_events.cpp.
References gui_, is_observer(), game_display::observers(), teams_, and game_display::viewing_team().
Referenced by send_chat_message(), and speak().
bool events::menu_handler::clear_shroud | ( | const unsigned int | team_num | ) | [private] |
Definition at line 1480 of file menu_events.cpp.
References gui_, map_, teams_, and units_.
Referenced by events::console_handler::do_shroud(), goto_leader(), recall(), and undo().
void events::menu_handler::change_side_controller | ( | const std::string & | side, | |
const std::string & | player, | |||
bool | own_side = false | |||
) | [static, private] |
Definition at line 3006 of file menu_events.cpp.
References config::add_child(), cfg, and network::send_data().
Referenced by events::console_handler::do_control().
void events::menu_handler::scenario_settings_table | ( | int | selected = 0 |
) | [private] |
Definition at line 661 of file menu_events.cpp.
References _, gui::dialog::BUTTON_EXTRA_LEFT, COLUMN_SEPARATOR, game_config::debug, gui::DIALOG_BACK, unit_map::end(), team::get_side_colour_index(), team::get_side_highlight(), gui_, HEADING_PREFIX, IMAGE_PREFIX, team::knows_about_team(), game_display::scroll_to_leader(), gui::menu::basic_sorter::set_redirect_sort(), status_table(), team_leader(), teams_, gui::button::TYPE_PRESS, units_, display::video(), and game_display::viewing_team().
Referenced by status_table().
friend class console_handler [friend] |
Definition at line 166 of file menu_events.hpp.
game_display* events::menu_handler::gui_ [private] |
Definition at line 177 of file menu_events.hpp.
Referenced by add_chat_message(), ai_formula(), autosave(), clear_labels(), clear_messages(), clear_shroud(), clear_undo_stack(), create_unit(), current_unit(), do_ai_formula(), events::console_handler::do_benchmark(), events::console_handler::do_buff(), events::console_handler::do_clear(), events::console_handler::do_control(), events::console_handler::do_create(), events::console_handler::do_droid(), events::console_handler::do_event(), events::console_handler::do_fog(), events::console_handler::do_gold(), events::console_handler::do_refresh(), do_search(), events::console_handler::do_show_var(), events::console_handler::do_shroud(), events::console_handler::do_sunset(), events::console_handler::do_theme(), events::console_handler::do_unbuff(), events::console_handler::do_unit(), end_turn(), end_unit_turn(), goto_leader(), has_friends(), has_team(), label_terrain(), load_game(), move_unit_to_loc(), objectives(), preferences(), recall(), recruit(), redo(), rename_unit(), save_game(), save_map(), scenario_settings_table(), search(), send_chat_message(), set_gui(), show_chat_log(), show_enemy_moves(), show_help(), show_statistics(), speak(), status_table(), toggle_grid(), undo(), unit_description(), unit_hold_position(), unit_list(), user_command(), and write_game_snapshot().
unit_map& events::menu_handler::units_ [private] |
Definition at line 178 of file menu_events.hpp.
Referenced by change_unit_side(), clear_shroud(), clear_undo_stack(), continue_move(), create_unit(), current_unit(), do_ai_formula(), events::console_handler::do_buff(), events::console_handler::do_create(), events::console_handler::do_fog(), do_search(), events::console_handler::do_unbuff(), events::console_handler::do_unit(), end_turn(), end_unit_turn(), get_title_suffix(), goto_leader(), move_unit_to_loc(), recall(), redo(), rename_unit(), scenario_settings_table(), show_enemy_moves(), status_table(), undo(), unit_description(), unit_hold_position(), unit_list(), and write_game_snapshot().
std::vector<team>& events::menu_handler::teams_ [private] |
Definition at line 179 of file menu_events.hpp.
Referenced by clear_shroud(), clear_undo_stack(), create_unit(), current_unit(), do_ai_formula(), events::console_handler::do_control(), events::console_handler::do_create(), events::console_handler::do_droid(), events::console_handler::do_fog(), events::console_handler::do_gold(), do_search(), events::console_handler::do_shroud(), events::console_handler::do_unit(), end_turn(), get_title_suffix(), has_friends(), has_team(), move_unit_to_loc(), objectives(), recall(), recruit(), redo(), scenario_settings_table(), send_chat_message(), show_chat_log(), show_enemy_moves(), show_statistics(), status_table(), toggle_shroud_updates(), undo(), and write_game_snapshot().
const config& events::menu_handler::level_ [private] |
Definition at line 180 of file menu_events.hpp.
Referenced by objectives(), recall(), and write_game_snapshot().
const gamemap& events::menu_handler::map_ [private] |
Definition at line 181 of file menu_events.hpp.
Referenced by clear_shroud(), clear_undo_stack(), create_unit(), current_unit(), do_ai_formula(), events::console_handler::do_create(), events::console_handler::do_fog(), do_search(), events::console_handler::do_unit(), end_turn(), label_terrain(), move_unit_to_loc(), recall(), recruit(), redo(), save_map(), show_enemy_moves(), undo(), unit_list(), and write_game_snapshot().
const config& events::menu_handler::game_config_ [private] |
const gamestatus& events::menu_handler::status_ [private] |
Definition at line 183 of file menu_events.hpp.
Referenced by create_unit(), do_ai_formula(), events::console_handler::do_create(), events::console_handler::do_unit(), recall(), redo(), save_game(), and write_game_snapshot().
game_state& events::menu_handler::gamestate_ [private] |
Definition at line 184 of file menu_events.hpp.
Referenced by do_ai_formula(), events::console_handler::do_set_var(), events::console_handler::do_show_var(), recall(), redo(), save_game(), undo(), and write_game_snapshot().
undo_list& events::menu_handler::undo_stack_ [private] |
Definition at line 186 of file menu_events.hpp.
Referenced by clear_undo_stack(), get_undo_list(), move_unit_to_loc(), recall(), redo(), and undo().
undo_list& events::menu_handler::redo_stack_ [private] |
Definition at line 188 of file menu_events.hpp.
Referenced by ai_formula(), events::console_handler::do_control(), events::console_handler::do_droid(), do_speak(), get_textbox(), search(), speak(), and user_command().
std::string events::menu_handler::last_search_ [private] |
std::string events::menu_handler::last_recruit_ [private] |
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |