#include <hotkey_handler.hpp>
Static Public Attributes | |
static const std::string | wml_menu_hotkey_prefix = "wml_menu:" |
Protected Member Functions | |
display & | get_display () |
game_display * | gui () const |
game_state & | gamestate () |
const game_state & | gamestate () const |
bool | browse () const |
bool | linger () const |
const team & | viewing_team () const |
bool | viewing_team_is_playing () const |
Protected Member Functions inherited from hotkey::command_executor | |
virtual | ~command_executor () |
Protected Attributes | |
play_controller & | play_controller_ |
References to parent object / constituents. More... | |
events::menu_handler & | menu_handler_ |
events::mouse_handler & | mouse_handler_ |
saved_game & | saved_game_ |
Private Types | |
typedef boost::shared_ptr < const game_events::wml_menu_item > | const_item_ptr |
A smart pointer used when retrieving menu items. More... | |
Private Member Functions | |
void | expand_autosaves (std::vector< std::string > &items) |
void | expand_wml_commands (std::vector< std::string > &items) |
Replaces "wml" in items with all active WML menu items for the current field. More... | |
Private Attributes | |
std::vector< std::string > | savenames_ |
std::vector< const_item_ptr > | wml_commands_ |
boost::scoped_ptr< wmi_pager > | wml_command_pager_ |
int | last_context_menu_x_ |
int | last_context_menu_y_ |
Additional Inherited Members | |
Static Protected Attributes inherited from hotkey::command_executor_default | |
static const int | zoom_amount = 4 |
Definition at line 40 of file hotkey_handler.hpp.
|
private |
A smart pointer used when retrieving menu items.
Definition at line 61 of file hotkey_handler.hpp.
play_controller::hotkey_handler::hotkey_handler | ( | play_controller & | pc, |
saved_game & | sg | ||
) |
Definition at line 38 of file hotkey_handler.cpp.
play_controller::hotkey_handler::~hotkey_handler | ( | ) |
Definition at line 50 of file hotkey_handler.cpp.
|
protected |
Definition at line 64 of file hotkey_handler.cpp.
|
virtual |
Check if a command can be executed.
Implements hotkey::command_executor.
Reimplemented in playsingle_controller::hotkey_handler, and playmp_controller::hotkey_handler.
Definition at line 270 of file hotkey_handler.cpp.
References events::commands_disabled, events::menu_handler::current_unit(), events::mouse_handler::get_last_hex(), hotkey::HOTKEY_ACCELERATED, hotkey::HOTKEY_AI_FORMULA, hotkey::HOTKEY_ANIMATE_MAP, hotkey::HOTKEY_BEST_ENEMY_MOVES, hotkey::HOTKEY_CHAT_LOG, hotkey::HOTKEY_CLEAR_MSG, hotkey::HOTKEY_CUSTOM_CMD, hotkey::HOTKEY_CYCLE_BACK_UNITS, hotkey::HOTKEY_CYCLE_UNITS, hotkey::HOTKEY_DESELECT_HEX, hotkey::HOTKEY_FULLSCREEN, hotkey::HOTKEY_HELP, hotkey::HOTKEY_LABEL_SETTINGS, hotkey::HOTKEY_LEADER, hotkey::HOTKEY_LOAD_GAME, hotkey::HOTKEY_MAP_SCREENSHOT, hotkey::HOTKEY_MINIMAP_CODING_TERRAIN, hotkey::HOTKEY_MINIMAP_CODING_UNIT, hotkey::HOTKEY_MINIMAP_DRAW_TERRAIN, hotkey::HOTKEY_MINIMAP_DRAW_UNITS, hotkey::HOTKEY_MINIMAP_DRAW_VILLAGES, hotkey::HOTKEY_MOUSE_SCROLL, hotkey::HOTKEY_MOVE_ACTION, hotkey::HOTKEY_MUTE, hotkey::HOTKEY_NULL, hotkey::HOTKEY_OBJECTIVES, hotkey::HOTKEY_PREFERENCES, hotkey::HOTKEY_QUIT_GAME, hotkey::HOTKEY_QUIT_TO_DESKTOP, hotkey::HOTKEY_REDO, hotkey::HOTKEY_RENAME_UNIT, hotkey::HOTKEY_SAVE_GAME, hotkey::HOTKEY_SAVE_MAP, hotkey::HOTKEY_SAVE_REPLAY, hotkey::HOTKEY_SCREENSHOT, hotkey::HOTKEY_SCROLL_DOWN, hotkey::HOTKEY_SCROLL_LEFT, hotkey::HOTKEY_SCROLL_RIGHT, hotkey::HOTKEY_SCROLL_UP, hotkey::HOTKEY_SEARCH, hotkey::HOTKEY_SELECT_AND_ACTION, hotkey::HOTKEY_SELECT_HEX, hotkey::HOTKEY_SHOW_ENEMY_MOVES, hotkey::HOTKEY_STATISTICS, hotkey::HOTKEY_STATUS_TABLE, hotkey::HOTKEY_TERRAIN_DESCRIPTION, hotkey::HOTKEY_TOGGLE_ELLIPSES, hotkey::HOTKEY_TOGGLE_GRID, hotkey::HOTKEY_UNDO, hotkey::HOTKEY_UNIT_DESCRIPTION, hotkey::HOTKEY_UNIT_LIST, hotkey::HOTKEY_USER_CMD, hotkey::HOTKEY_ZOOM_DEFAULT, hotkey::HOTKEY_ZOOM_IN, hotkey::HOTKEY_ZOOM_OUT, i, hotkey::hotkey_command::id, game_config::images::linger, hotkey::LUA_CONSOLE, play_controller::menu_handler_, play_controller::mouse_handler_, map_location::valid(), and unit_map::iterator_base< iter_types >::valid().
Referenced by playsingle_controller::hotkey_handler::can_execute_command().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 156 of file hotkey_handler.cpp.
References events::mouse_handler::cycle_back_units(), and play_controller::mouse_handler_.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 152 of file hotkey_handler.cpp.
References events::mouse_handler::cycle_units(), and play_controller::mouse_handler_.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 129 of file hotkey_handler.cpp.
References events::mouse_handler::deselect_hex(), and play_controller::mouse_handler_.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 240 of file hotkey_handler.cpp.
References hotkey::hotkey_command::command, execute_command(), game_events::wmi_container::fire_item(), game_state::gamedata_, play_controller::gamestate(), events::mouse_handler::get_last_hex(), controller_base::get_theme(), game_state::get_wml_menu_items(), hotkey::HOTKEY_WML, i, hotkey::hotkey_command::id, mp_ui_alerts::items, play_controller::mouse_handler_, and controller_base::show_menu().
|
private |
Definition at line 380 of file hotkey_handler.cpp.
References _(), saved_game::classification(), compression::format_extension(), i, game_classification::label, preferences::save_compression_format(), savegame::save_game_exists(), play_controller::saved_game_, trim_items(), and play_controller::turn().
|
private |
Replaces "wml" in items with all active WML menu items for the current field.
Definition at line 420 of file hotkey_handler.cpp.
References game_state::board_, game_state::gamedata_, play_controller::gamestate(), events::mouse_handler::get_last_hex(), i, play_controller::mouse_handler_, and game_board::units_.
|
protected |
Definition at line 56 of file hotkey_handler.cpp.
|
protected |
Definition at line 60 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 506 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Reimplemented in playsingle_controller::hotkey_handler.
Definition at line 517 of file hotkey_handler.cpp.
References hotkey::ACTION_OFF, hotkey::ACTION_ON, hotkey::ACTION_STATELESS, hotkey::HOTKEY_DELAY_SHROUD, hotkey::HOTKEY_MINIMAP_CODING_TERRAIN, hotkey::HOTKEY_MINIMAP_CODING_UNIT, hotkey::HOTKEY_MINIMAP_DRAW_TERRAIN, hotkey::HOTKEY_MINIMAP_DRAW_UNITS, hotkey::HOTKEY_MINIMAP_DRAW_VILLAGES, hotkey::HOTKEY_ZOOM_DEFAULT, preferences::minimap_draw_terrain(), preferences::minimap_draw_units(), preferences::minimap_draw_villages(), preferences::minimap_movement_coding(), and preferences::minimap_terrain_coding().
Referenced by playsingle_controller::hotkey_handler::get_action_state().
|
inlineprotectedvirtual |
Implements hotkey::command_executor_default.
Definition at line 43 of file hotkey_handler.hpp.
References play_controller::get_display(), and play_controller_.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 180 of file hotkey_handler.cpp.
References events::menu_handler::goto_leader(), and play_controller::menu_handler_.
|
protected |
Definition at line 52 of file hotkey_handler.cpp.
bool play_controller::hotkey_handler::in_context_menu | ( | hotkey::HOTKEY_COMMAND | command | ) | const |
Determines whether the command should be in the context menu or not.
Independent of whether or not we can actually execute the command.
Definition at line 480 of file hotkey_handler.cpp.
References play_controller::gamestate(), events::mouse_handler::get_last_hex(), hotkey::HOTKEY_RECALL, hotkey::HOTKEY_RECRUIT, hotkey::HOTKEY_REPEAT_RECRUIT, play_controller::mouse_handler_, and game_state::side_can_recruit_on().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 106 of file hotkey_handler.cpp.
References play_controller::mouse_handler_, and events::mouse_handler::mouse_press().
|
protected |
Definition at line 65 of file hotkey_handler.cpp.
|
virtual |
Reimplemented in playsingle_controller::hotkey_handler.
Definition at line 540 of file hotkey_handler.cpp.
Referenced by playsingle_controller::hotkey_handler::load_autosave().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 98 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 125 of file hotkey_handler.cpp.
References play_controller::mouse_handler_, and events::mouse_handler::move_action().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 70 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::objectives().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 102 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::preferences().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 172 of file hotkey_handler.cpp.
|
inlineoverridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 124 of file hotkey_handler.hpp.
References play_controller::toggle_skipping_replay().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 136 of file hotkey_handler.cpp.
References play_controller::mouse_handler_, and events::mouse_handler::mouse_press().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 86 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 94 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 90 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 225 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 230 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 235 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 220 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 200 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::search().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 121 of file hotkey_handler.cpp.
References play_controller::mouse_handler_, and events::mouse_handler::select_or_action().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 132 of file hotkey_handler.cpp.
References play_controller::mouse_handler_, and events::mouse_handler::select_hex().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 160 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::show_chat_log().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 176 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::show_enemy_moves().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 164 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::show_help().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 443 of file hotkey_handler.cpp.
References hotkey::get_hotkey_command(), i, hotkey::hotkey_command::id, controller_base::in_context_menu(), and mp_ui_alerts::items.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 74 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::show_statistics().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 82 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::status_table().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 188 of file hotkey_handler.cpp.
References play_controller::menu_handler_, play_controller::mouse_handler_, and events::menu_handler::terrain_description().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 204 of file hotkey_handler.cpp.
References _(), hotkey::hotkey_command::get_command_by_command(), hotkey::get_names(), hotkey::HOTKEY_ACCELERATED, font::NORMAL_COLOR, preferences::set_turbo(), preferences::turbo(), and vgettext().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 192 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::toggle_ellipses().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 196 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::toggle_grid().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 168 of file hotkey_handler.cpp.
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 184 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::unit_description().
|
virtual |
Reimplemented from hotkey::command_executor.
Definition at line 78 of file hotkey_handler.cpp.
References play_controller::menu_handler_, and events::menu_handler::unit_list().
|
protected |
Definition at line 67 of file hotkey_handler.cpp.
|
protected |
Definition at line 68 of file hotkey_handler.cpp.
|
private |
Definition at line 74 of file hotkey_handler.hpp.
|
private |
Definition at line 75 of file hotkey_handler.hpp.
|
protected |
Definition at line 48 of file hotkey_handler.hpp.
|
protected |
Definition at line 49 of file hotkey_handler.hpp.
|
protected |
References to parent object / constituents.
Definition at line 46 of file hotkey_handler.hpp.
Referenced by get_display().
|
protected |
Definition at line 51 of file hotkey_handler.hpp.
|
private |
Definition at line 66 of file hotkey_handler.hpp.
|
private |
Definition at line 73 of file hotkey_handler.hpp.
|
private |
Definition at line 72 of file hotkey_handler.hpp.
|
static |
Definition at line 88 of file hotkey_handler.hpp.