#include <mouse_events.hpp>
Definition at line 38 of file mouse_events.hpp.
events::mouse_handler::mouse_handler | ( | game_display * | gui, | |
std::vector< team > & | teams, | |||
unit_map & | units, | |||
gamemap & | map, | |||
gamestatus & | status, | |||
undo_list & | undo_stack, | |||
undo_list & | redo_stack | |||
) |
Definition at line 690 of file mouse_events.cpp.
References attackmove_, drag_from_x_, drag_from_y_, dragging_, dragging_started_, enemy_paths_, minimap_scrolling_, over_route_, path_turns_, reachmap_invalid_, show_menu_, show_partial_move_, singleton_, team_num_, and undo_.
events::mouse_handler::~mouse_handler | ( | ) |
static mouse_handler* events::mouse_handler::get_singleton | ( | ) | [inline, static] |
Definition at line 43 of file mouse_events.hpp.
References singleton_.
Referenced by unit_display::move_unit(), and unit_display::unit_die().
void events::mouse_handler::set_team | ( | const int | team_number | ) |
Definition at line 716 of file mouse_events.cpp.
References team_num_.
Referenced by play_controller::init_side().
void events::mouse_handler::mouse_motion | ( | const SDL_MouseMotionEvent & | event, | |
const bool | browse | |||
) |
Definition at line 721 of file mouse_events.cpp.
Referenced by play_controller::handle_event(), and mouse_update().
void events::mouse_handler::mouse_update | ( | const bool | browse | ) |
Definition at line 726 of file mouse_events.cpp.
References mouse_motion().
Referenced by cycle_units(), mouse_press(), and play_controller::play_slice().
void events::mouse_handler::mouse_press | ( | const SDL_MouseButtonEvent & | event, | |
const bool | browse | |||
) |
Definition at line 1009 of file mouse_events.cpp.
References attackmove_, events::commands_disabled, theme::context_menu(), drag_from_x_, drag_from_y_, dragging_, dragging_started_, game_display::draw(), unit_map::end(), find_unit(), display::get_theme(), gui_, is_left_click(), is_middle_click(), is_right_click(), last_hex_, left_click(), loc, LOG_STREAM, display::minimap_location_on(), minimap_scrolling_, mouse_update(), display::scroll(), preferences::scroll_speed(), display::scroll_to_tile(), SDL_BUTTON_WHEELDOWN, SDL_BUTTON_WHEELLEFT, SDL_BUTTON_WHEELRIGHT, SDL_BUTTON_WHEELUP, select_hex(), selected_hex_, cursor::set_dragging(), show_menu_, units_, gamemap::location::valid(), lg::warn, and display::WARP.
Referenced by play_controller::handle_event().
void events::mouse_handler::cycle_units | ( | const bool | browse, | |
const bool | reverse = false | |||
) |
Definition at line 1501 of file mouse_events.cpp.
References unit_map::begin(), unit_map::end(), find_unit(), gui_, mouse_update(), next_unit_, display::scroll_to_tile(), select_hex(), unit_in_cycle(), units_, and display::WARP.
Referenced by cycle_back_units(), play_controller::cycle_units(), events::menu_handler::end_unit_turn(), and events::menu_handler::unit_hold_position().
void events::mouse_handler::cycle_back_units | ( | const bool | browse | ) | [inline] |
Definition at line 50 of file mouse_events.hpp.
References cycle_units().
Referenced by play_controller::cycle_back_units().
int events::mouse_handler::get_path_turns | ( | ) | const [inline] |
Definition at line 52 of file mouse_events.hpp.
References path_turns_.
Referenced by play_controller::handle_event().
paths events::mouse_handler::get_current_paths | ( | ) | [inline] |
Definition at line 53 of file mouse_events.hpp.
References current_paths_.
Referenced by play_controller::handle_event().
const gamemap::location& events::mouse_handler::get_last_hex | ( | ) | const [inline] |
Definition at line 54 of file mouse_events.hpp.
References last_hex_.
Referenced by playsingle_controller::can_execute_command(), events::menu_handler::change_unit_side(), events::menu_handler::create_unit(), events::menu_handler::current_unit(), events::console_handler::do_create(), play_controller::execute_command(), play_controller::expand_wml_commands(), play_controller::in_context_menu(), events::menu_handler::label_terrain(), playsingle_controller::recall(), playsingle_controller::recruit(), and playsingle_controller::repeat_recruit().
gamemap::location events::mouse_handler::get_selected_hex | ( | ) | const [inline] |
Definition at line 55 of file mouse_events.hpp.
References selected_hex_.
Referenced by playsingle_controller::can_execute_command(), events::menu_handler::continue_move(), events::menu_handler::current_unit(), events::menu_handler::end_unit_turn(), and events::menu_handler::unit_hold_position().
bool events::mouse_handler::get_undo | ( | ) | const [inline] |
Definition at line 56 of file mouse_events.hpp.
References undo_.
Referenced by play_controller::handle_event().
bool events::mouse_handler::get_show_menu | ( | ) | const [inline] |
Definition at line 57 of file mouse_events.hpp.
References show_menu_.
Referenced by play_controller::handle_event().
void events::mouse_handler::set_path_turns | ( | const int | path_turns | ) | [inline] |
Definition at line 58 of file mouse_events.hpp.
References path_turns_.
Referenced by play_controller::handle_event().
void events::mouse_handler::set_current_paths | ( | paths | new_paths | ) |
Definition at line 1532 of file mouse_events.cpp.
References current_paths_, current_route_, gui_, game_display::set_route(), paths::route::steps, and game_display::unhighlight_reach().
Referenced by events::menu_handler::end_unit_turn(), play_controller::handle_event(), and events::menu_handler::unit_hold_position().
void events::mouse_handler::set_selected_hex | ( | gamemap::location | hex | ) | [inline] |
void events::mouse_handler::deselect_hex | ( | ) |
Definition at line 1263 of file mouse_events.cpp.
References select_hex().
Referenced by play_controller::finish_side_turn(), play_controller::redo(), and play_controller::undo().
void events::mouse_handler::invalidate_reachmap | ( | ) | [inline] |
Definition at line 62 of file mouse_events.hpp.
References reachmap_invalid_.
Referenced by unit_display::move_unit(), and unit_display::unit_die().
void events::mouse_handler::set_gui | ( | game_display * | gui | ) | [inline] |
Definition at line 64 of file mouse_events.hpp.
References gui_.
Referenced by play_controller::init().
void events::mouse_handler::set_undo | ( | const bool | undo | ) | [inline] |
Definition at line 65 of file mouse_events.hpp.
References undo_.
Referenced by play_controller::handle_event().
unit_map::iterator events::mouse_handler::selected_unit | ( | ) |
Definition at line 907 of file mouse_events.cpp.
References unit_map::end(), find_unit(), last_hex_, selected_hex_, and units_.
Referenced by play_controller::handle_event(), and mouse_motion().
paths::route events::mouse_handler::get_route | ( | unit_map::const_iterator | un, | |
gamemap::location | go_to, | |||
team & | team | |||
) |
Definition at line 980 of file mouse_events.cpp.
References a_star_search(), unit_map::end(), find_unit(), team::fogged(), gamemap::h(), team::is_enemy(), map_, route_turns_to_complete(), teams_, units_, viewing_team(), team::villages(), and gamemap::w().
Referenced by mouse_motion(), and events::menu_handler::move_unit_to_loc().
team& events::mouse_handler::viewing_team | ( | ) | [inline, private] |
Definition at line 70 of file mouse_events.hpp.
References teams_.
Referenced by find_unit(), get_route(), mouse_motion(), and select_hex().
const team& events::mouse_handler::viewing_team | ( | ) | const [inline, private] |
team& events::mouse_handler::current_team | ( | ) | [inline, private] |
Definition at line 72 of file mouse_events.hpp.
References team_num_, and teams_.
Referenced by attack_enemy_(), current_unit_attacks_from(), left_click(), mouse_motion(), show_attack_options(), and unit_in_cycle().
void events::mouse_handler::mouse_motion | ( | int | x, | |
int | y, | |||
const bool | browse, | |||
bool | update = false | |||
) | [private] |
Definition at line 733 of file mouse_events.cpp.
References cursor::ATTACK, cursor::ATTACK_DRAG, attackmove_, game_display::clear_attack_indicator(), current_paths_, current_route_, current_team(), current_unit_attacks_from(), drag_from_x_, drag_from_y_, dragging_, dragging_started_, unit_map::end(), enemy_paths_, find_unit(), cursor::get(), get_route(), gui_, game_display::highlight_reach(), last_hex_, loc, map_, minimap_scrolling_, cursor::MOVE, cursor::MOVE_DRAG, cursor::NORMAL, gamemap::on_board(), over_route_, path_turns_, previous_free_hex_, previous_hex_, reachmap_invalid_, paths::routes, select_hex(), selected_hex_, selected_unit(), cursor::set(), game_display::set_attack_indicator(), cursor::set_dragging(), game_display::set_route(), show_partial_move_, paths::route::steps, team_num_, teams_, game_display::unhighlight_reach(), units_, gamemap::location::valid(), viewing_team(), cursor::WAIT, and display::WARP.
bool events::mouse_handler::is_left_click | ( | const SDL_MouseButtonEvent & | event | ) | [private] |
Definition at line 1087 of file mouse_events.cpp.
References events::command_active().
Referenced by mouse_press().
bool events::mouse_handler::is_middle_click | ( | const SDL_MouseButtonEvent & | event | ) | [private] |
bool events::mouse_handler::is_right_click | ( | const SDL_MouseButtonEvent & | event | ) | [private] |
Definition at line 1097 of file mouse_events.cpp.
References events::command_active().
Referenced by mouse_press().
void events::mouse_handler::left_click | ( | const SDL_MouseButtonEvent & | event, | |
const bool | browse | |||
) | [private] |
Definition at line 1102 of file mouse_events.cpp.
References attack_enemy(), unit_map::begin(), clear_shroud(), clear_undo_stack(), events::commands_disabled, current_paths_, current_route_, current_team(), current_unit_attacks_from(), dragging_, dragging_started_, game_display::draw(), unit_map::end(), find_unit(), gui_, game_display::highlight_reach(), display::invalidate_all(), team::is_enemy(), last_hex_, loc, map_, display::minimap_location_on(), minimap_scrolling_, move_unit_along_current_route(), game_events::pump(), game_events::raise(), display::recalculate_minimap(), display::scroll_to_tile(), select_hex(), game_display::select_hex(), selected_hex_, cursor::set_dragging(), paths::route::steps, team_num_, teams_, undo_, game_display::unhighlight_reach(), units_, gamemap::location::valid(), and display::WARP.
Referenced by mouse_press().
void events::mouse_handler::select_hex | ( | const gamemap::location & | hex, | |
const bool | browse | |||
) | [private] |
Definition at line 1225 of file mouse_events.cpp.
References game_display::clear_attack_indicator(), events::commands_disabled, current_paths_, current_route_, unit_map::end(), enemy_paths_, find_unit(), game_events::fire(), gui_, game_display::highlight_reach(), map_, next_unit_, path_turns_, sound::play_UI_sound(), game_display::select_hex(), selected_hex_, game_display::set_route(), show_attack_options(), show_partial_move_, paths::route::steps, team_num_, teams_, game_display::unhighlight_reach(), units_, gamemap::location::valid(), game_display::viewing_team(), and viewing_team().
Referenced by cycle_units(), deselect_hex(), left_click(), mouse_motion(), mouse_press(), and move_unit_along_current_route().
void events::mouse_handler::clear_undo_stack | ( | ) | [private] |
Definition at line 1267 of file mouse_events.cpp.
References apply_shroud_changes(), gui_, map_, team_num_, teams_, undo_stack_, and units_.
Referenced by attack_enemy_(), and left_click().
bool events::mouse_handler::move_unit_along_current_route | ( | bool | check_shroud, | |
bool | attackmove = false | |||
) | [private] |
Definition at line 1274 of file mouse_events.cpp.
References attackmove_, current_paths_, current_route_, gui_, map_, move_unit(), next_unit_, cursor::NORMAL, recorder, redo_stack_, select_hex(), game_display::select_hex(), selected_hex_, cursor::set(), game_display::set_route(), show_partial_move_, paths::route::steps, teams_, undo_stack_, and units_.
Referenced by left_click().
bool events::mouse_handler::attack_enemy | ( | unit_map::iterator | attacker, | |
unit_map::iterator | defender | |||
) | [private] |
Definition at line 1327 of file mouse_events.cpp.
References attack_enemy_(), and lg::wml_error.
Referenced by left_click().
bool events::mouse_handler::attack_enemy_ | ( | unit_map::iterator | attacker, | |
unit_map::iterator | defender | |||
) | [private] |
Definition at line 1338 of file mouse_events.cpp.
References _, replay::add_attack(), dialogs::advance_unit(), battle_context::unit_stats::attack_num, battle_context::better_attack(), font::BOLD_TEXT, battle_context::unit_stats::chance_to_hit, check_victory(), game_display::clear_attack_indicator(), clear_undo_stack(), COLUMN_SEPARATOR, current_paths_, current_team(), battle_context::unit_stats::damage, DEFAULT_ITEM, game_display::draw(), gui_, game_display::highlight_hex(), attack_type::icon(), IMAGE_PREFIX, map_, attack_type::name(), cursor::NORMAL, battle_context::unit_stats::num_blows, gui::OK_CANCEL, attack_type::range(), recorder, redo_stack_, cursor::set(), team::set_action_bonus_count(), attack_type::set_specials_context(), dialogs::unit_preview_pane::SHOW_BASIC, gui::show_dialog(), status_, teams_, game_display::unhighlight_reach(), units_, battle_context::unit_stats::weapon, and attack_type::weapon_specials().
Referenced by attack_enemy().
void events::mouse_handler::show_attack_options | ( | unit_map::const_iterator | u | ) | [private] |
Definition at line 1469 of file mouse_events.cpp.
References unit_map::begin(), current_paths_, current_team(), distance_between(), unit_map::end(), team::is_enemy(), paths::routes, team_num_, teams_, and units_.
Referenced by select_hex().
gamemap::location events::mouse_handler::current_unit_attacks_from | ( | const gamemap::location & | loc | ) | [private] |
Definition at line 927 of file mouse_events.cpp.
References current_paths_, current_team(), unit_map::end(), find_unit(), get_adjacent_tiles(), gamemap::location::get_relative_dir(), team::is_enemy(), map_, gamemap::location::NDIRECTIONS, gamemap::on_board(), previous_free_hex_, previous_hex_, paths::routes, selected_hex_, team_num_, units_, and gamemap::location::valid().
Referenced by left_click(), and mouse_motion().
unit_map::const_iterator events::mouse_handler::find_unit | ( | const gamemap::location & | hex | ) | const [private] |
Definition at line 922 of file mouse_events.cpp.
References find_visible_unit(), map_, teams_, units_, and viewing_team().
Referenced by current_unit_attacks_from(), cycle_units(), get_route(), left_click(), mouse_motion(), mouse_press(), select_hex(), and selected_unit().
unit_map::iterator events::mouse_handler::find_unit | ( | const gamemap::location & | hex | ) | [private] |
Definition at line 917 of file mouse_events.cpp.
References find_visible_unit(), map_, teams_, units_, and viewing_team().
bool events::mouse_handler::unit_in_cycle | ( | unit_map::const_iterator | it | ) | [private] |
Definition at line 1484 of file mouse_events.cpp.
References current_team(), unit_map::end(), display::fogged(), gui_, team::is_enemy(), map_, team_num_, teams_, unit_can_move(), units_, and game_display::viewing_team().
Referenced by cycle_units().
game_display* events::mouse_handler::gui_ [private] |
Definition at line 93 of file mouse_events.hpp.
Referenced by attack_enemy_(), clear_undo_stack(), cycle_units(), left_click(), mouse_motion(), mouse_press(), move_unit_along_current_route(), select_hex(), set_current_paths(), set_gui(), and unit_in_cycle().
std::vector<team>& events::mouse_handler::teams_ [private] |
Definition at line 94 of file mouse_events.hpp.
Referenced by attack_enemy_(), clear_undo_stack(), current_team(), find_unit(), get_route(), left_click(), mouse_motion(), move_unit_along_current_route(), select_hex(), show_attack_options(), unit_in_cycle(), and viewing_team().
unit_map& events::mouse_handler::units_ [private] |
Definition at line 95 of file mouse_events.hpp.
Referenced by attack_enemy_(), clear_undo_stack(), current_unit_attacks_from(), cycle_units(), find_unit(), get_route(), left_click(), mouse_motion(), mouse_press(), move_unit_along_current_route(), select_hex(), selected_unit(), show_attack_options(), and unit_in_cycle().
gamemap& events::mouse_handler::map_ [private] |
Definition at line 96 of file mouse_events.hpp.
Referenced by attack_enemy_(), clear_undo_stack(), current_unit_attacks_from(), find_unit(), get_route(), left_click(), mouse_motion(), move_unit_along_current_route(), select_hex(), and unit_in_cycle().
gamestatus& events::mouse_handler::status_ [private] |
undo_list& events::mouse_handler::undo_stack_ [private] |
Definition at line 98 of file mouse_events.hpp.
Referenced by clear_undo_stack(), and move_unit_along_current_route().
undo_list& events::mouse_handler::redo_stack_ [private] |
Definition at line 99 of file mouse_events.hpp.
Referenced by attack_enemy_(), and move_unit_along_current_route().
bool events::mouse_handler::minimap_scrolling_ [private] |
Definition at line 101 of file mouse_events.hpp.
Referenced by left_click(), mouse_handler(), mouse_motion(), and mouse_press().
bool events::mouse_handler::dragging_ [private] |
Definition at line 102 of file mouse_events.hpp.
Referenced by left_click(), mouse_handler(), mouse_motion(), and mouse_press().
bool events::mouse_handler::dragging_started_ [private] |
Definition at line 103 of file mouse_events.hpp.
Referenced by left_click(), mouse_handler(), mouse_motion(), and mouse_press().
int events::mouse_handler::drag_from_x_ [private] |
Definition at line 104 of file mouse_events.hpp.
Referenced by mouse_handler(), mouse_motion(), and mouse_press().
int events::mouse_handler::drag_from_y_ [private] |
Definition at line 105 of file mouse_events.hpp.
Referenced by mouse_handler(), mouse_motion(), and mouse_press().
Definition at line 108 of file mouse_events.hpp.
Referenced by get_last_hex(), left_click(), mouse_motion(), mouse_press(), and selected_unit().
Definition at line 111 of file mouse_events.hpp.
Referenced by current_unit_attacks_from(), and mouse_motion().
Definition at line 112 of file mouse_events.hpp.
Referenced by current_unit_attacks_from(), and mouse_motion().
Definition at line 113 of file mouse_events.hpp.
Referenced by current_unit_attacks_from(), get_selected_hex(), left_click(), mouse_motion(), mouse_press(), move_unit_along_current_route(), select_hex(), selected_unit(), and set_selected_hex().
Definition at line 114 of file mouse_events.hpp.
Referenced by cycle_units(), move_unit_along_current_route(), and select_hex().
Definition at line 115 of file mouse_events.hpp.
Referenced by left_click(), mouse_motion(), move_unit_along_current_route(), select_hex(), and set_current_paths().
paths events::mouse_handler::current_paths_ [private] |
Definition at line 116 of file mouse_events.hpp.
Referenced by attack_enemy_(), current_unit_attacks_from(), get_current_paths(), left_click(), mouse_motion(), move_unit_along_current_route(), select_hex(), set_current_paths(), and show_attack_options().
bool events::mouse_handler::enemy_paths_ [private] |
Definition at line 117 of file mouse_events.hpp.
Referenced by mouse_handler(), mouse_motion(), and select_hex().
int events::mouse_handler::path_turns_ [private] |
Definition at line 118 of file mouse_events.hpp.
Referenced by get_path_turns(), mouse_handler(), mouse_motion(), select_hex(), and set_path_turns().
unsigned int events::mouse_handler::team_num_ [private] |
Definition at line 119 of file mouse_events.hpp.
Referenced by clear_undo_stack(), current_team(), current_unit_attacks_from(), left_click(), mouse_handler(), mouse_motion(), select_hex(), set_team(), show_attack_options(), and unit_in_cycle().
bool events::mouse_handler::enemies_visible_ [private] |
Definition at line 123 of file mouse_events.hpp.
bool events::mouse_handler::undo_ [private] |
Definition at line 124 of file mouse_events.hpp.
Referenced by get_undo(), left_click(), mouse_handler(), and set_undo().
bool events::mouse_handler::show_menu_ [private] |
Definition at line 125 of file mouse_events.hpp.
Referenced by get_show_menu(), mouse_handler(), and mouse_press().
bool events::mouse_handler::over_route_ [private] |
bool events::mouse_handler::attackmove_ [private] |
Definition at line 127 of file mouse_events.hpp.
Referenced by mouse_handler(), mouse_motion(), mouse_press(), and move_unit_along_current_route().
bool events::mouse_handler::reachmap_invalid_ [private] |
Definition at line 128 of file mouse_events.hpp.
Referenced by invalidate_reachmap(), mouse_handler(), and mouse_motion().
bool events::mouse_handler::show_partial_move_ [private] |
Definition at line 129 of file mouse_events.hpp.
Referenced by mouse_handler(), mouse_motion(), move_unit_along_current_route(), and select_hex().
mouse_handler * events::mouse_handler::singleton_ = NULL [static, private] |
Definition at line 131 of file mouse_events.hpp.
Referenced by get_singleton(), mouse_handler(), and ~mouse_handler().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |