The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
play_controller::hotkey_handler Class Reference

#include <hotkey_handler.hpp>

Inheritance diagram for play_controller::hotkey_handler:
Inheritance graph

Public Member Functions

 hotkey_handler (play_controller &, saved_game &)
 
 ~hotkey_handler ()
 
virtual void objectives ()
 
virtual void show_statistics ()
 
virtual void unit_list ()
 
virtual void left_mouse_click ()
 
virtual void move_action ()
 
virtual void select_and_action ()
 
virtual void select_hex ()
 
virtual void deselect_hex ()
 
virtual void right_mouse_click ()
 
virtual void status_table ()
 
virtual void save_game ()
 
virtual void save_replay ()
 
virtual void save_map ()
 
virtual void load_game ()
 
virtual void preferences ()
 
virtual void show_chat_log ()
 
virtual void show_help ()
 
virtual void cycle_units ()
 
virtual void cycle_back_units ()
 
virtual void undo ()
 
virtual void redo ()
 
virtual void show_enemy_moves (bool ignore_units)
 
virtual void goto_leader ()
 
virtual void unit_description ()
 
virtual void terrain_description ()
 
virtual void toggle_ellipses ()
 
virtual void toggle_grid ()
 
virtual void search ()
 
virtual void toggle_accelerated_speed ()
 
virtual void scroll_up (bool on)
 
virtual void scroll_down (bool on)
 
virtual void scroll_left (bool on)
 
virtual void scroll_right (bool on)
 
virtual void replay_skip_animation () override
 
virtual std::string get_action_image (hotkey::HOTKEY_COMMAND, int index) const
 
virtual void load_autosave (const std::string &filename)
 
virtual hotkey::ACTION_STATE get_action_state (hotkey::HOTKEY_COMMAND command, int index) const
 
virtual bool can_execute_command (const hotkey::hotkey_command &command, int index=-1) const
 Check if a command can be executed. More...
 
virtual bool execute_command (const hotkey::hotkey_command &command, int index=-1, bool press=true)
 
void show_menu (const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu, display &disp)
 
bool in_context_menu (hotkey::HOTKEY_COMMAND command) const
 Determines whether the command should be in the context menu or not. More...
 
- Public Member Functions inherited from hotkey::command_executor_default
CVideoget_video ()
 
void set_button_state ()
 
void recalculate_minimap ()
 
void lua_console ()
 
void zoom_in ()
 
void zoom_out ()
 
void zoom_default ()
 
void map_screenshot ()
 
void quit_to_main_menu ()
 
- Public Member Functions inherited from hotkey::command_executor
virtual void end_turn ()
 
virtual void unit_hold_position ()
 
virtual void end_unit_turn ()
 
virtual void rename_unit ()
 
virtual void recall ()
 
virtual void recruit ()
 
virtual void repeat_recruit ()
 
virtual void speak ()
 
virtual void whisper ()
 
virtual void shout ()
 
virtual void create_unit ()
 
virtual void change_side ()
 
virtual void kill_unit ()
 
virtual void stop_network ()
 
virtual void start_network ()
 
virtual void label_terrain (bool)
 
virtual void clear_labels ()
 
virtual void label_settings ()
 
virtual void toggle_shroud_updates ()
 
virtual void update_shroud_now ()
 
virtual void continue_move ()
 
virtual void user_command ()
 
virtual void custom_command ()
 
virtual void ai_formula ()
 
virtual void clear_messages ()
 
virtual void change_language ()
 
virtual void play_replay ()
 
virtual void reset_replay ()
 
virtual void stop_replay ()
 
virtual void replay_next_turn ()
 
virtual void replay_next_side ()
 
virtual void replay_next_move ()
 
virtual void replay_show_everything ()
 
virtual void replay_show_each ()
 
virtual void replay_show_team1 ()
 
virtual void replay_exit ()
 
virtual void whiteboard_toggle ()
 
virtual void whiteboard_execute_action ()
 
virtual void whiteboard_execute_all_actions ()
 
virtual void whiteboard_delete_action ()
 
virtual void whiteboard_bump_up_action ()
 
virtual void whiteboard_bump_down_action ()
 
virtual void whiteboard_suppose_dead ()
 
std::string get_menu_image (display &disp, const std::string &command, int index=-1) const
 
std::vector< std::stringget_menu_images (display &, const std::vector< std::string > &items_arg)
 
void execute_action (const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu, display &gui)
 

Static Public Attributes

static const std::string wml_menu_hotkey_prefix = "wml_menu:"
 

Protected Member Functions

displayget_display ()
 
game_displaygui () const
 
game_stategamestate ()
 
const game_stategamestate () const
 
bool browse () const
 
bool linger () const
 
const teamviewing_team () const
 
bool viewing_team_is_playing () const
 
- Protected Member Functions inherited from hotkey::command_executor
virtual ~command_executor ()
 

Protected Attributes

play_controllerplay_controller_
 References to parent object / constituents. More...
 
events::menu_handlermenu_handler_
 
events::mouse_handlermouse_handler_
 
saved_gamesaved_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::stringsavenames_
 
std::vector< const_item_ptrwml_commands_
 
boost::scoped_ptr< wmi_pagerwml_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
 

Detailed Description

Definition at line 40 of file hotkey_handler.hpp.

Member Typedef Documentation

A smart pointer used when retrieving menu items.

Definition at line 61 of file hotkey_handler.hpp.

Constructor & Destructor Documentation

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.

Member Function Documentation

bool play_controller::hotkey_handler::browse ( ) const
protected

Definition at line 64 of file hotkey_handler.cpp.

bool play_controller::hotkey_handler::can_execute_command ( const hotkey::hotkey_command command,
int  index = -1 
) const
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().

void play_controller::hotkey_handler::cycle_back_units ( )
virtual
void play_controller::hotkey_handler::cycle_units ( )
virtual
void play_controller::hotkey_handler::deselect_hex ( )
virtual
bool play_controller::hotkey_handler::execute_command ( const hotkey::hotkey_command command,
int  index = -1,
bool  press = true 
)
virtual
void play_controller::hotkey_handler::expand_autosaves ( std::vector< std::string > &  items)
private
void play_controller::hotkey_handler::expand_wml_commands ( std::vector< std::string > &  items)
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_.

game_state & play_controller::hotkey_handler::gamestate ( )
protected

Definition at line 56 of file hotkey_handler.cpp.

const game_state & play_controller::hotkey_handler::gamestate ( ) const
protected

Definition at line 60 of file hotkey_handler.cpp.

std::string play_controller::hotkey_handler::get_action_image ( hotkey::HOTKEY_COMMAND  command,
int  index 
) const
virtual

Reimplemented from hotkey::command_executor.

Definition at line 506 of file hotkey_handler.cpp.

hotkey::ACTION_STATE play_controller::hotkey_handler::get_action_state ( hotkey::HOTKEY_COMMAND  command,
int  index 
) const
virtual
display& play_controller::hotkey_handler::get_display ( )
inlineprotectedvirtual
void play_controller::hotkey_handler::goto_leader ( )
virtual
game_display * play_controller::hotkey_handler::gui ( ) const
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().

void play_controller::hotkey_handler::left_mouse_click ( )
virtual
bool play_controller::hotkey_handler::linger ( ) const
protected

Definition at line 65 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::load_autosave ( const std::string filename)
virtual
void play_controller::hotkey_handler::load_game ( )
virtual

Reimplemented from hotkey::command_executor.

Definition at line 98 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::move_action ( )
virtual
void play_controller::hotkey_handler::objectives ( )
virtual
void play_controller::hotkey_handler::preferences ( )
virtual
void play_controller::hotkey_handler::redo ( )
virtual

Reimplemented from hotkey::command_executor.

Definition at line 172 of file hotkey_handler.cpp.

virtual void play_controller::hotkey_handler::replay_skip_animation ( )
inlineoverridevirtual

Reimplemented from hotkey::command_executor.

Definition at line 124 of file hotkey_handler.hpp.

References play_controller::toggle_skipping_replay().

void play_controller::hotkey_handler::right_mouse_click ( )
virtual
void play_controller::hotkey_handler::save_game ( )
virtual

Reimplemented from hotkey::command_executor.

Definition at line 86 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::save_map ( )
virtual

Reimplemented from hotkey::command_executor.

Definition at line 94 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::save_replay ( )
virtual

Reimplemented from hotkey::command_executor.

Definition at line 90 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::scroll_down ( bool  on)
virtual

Reimplemented from hotkey::command_executor.

Definition at line 225 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::scroll_left ( bool  on)
virtual

Reimplemented from hotkey::command_executor.

Definition at line 230 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::scroll_right ( bool  on)
virtual

Reimplemented from hotkey::command_executor.

Definition at line 235 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::scroll_up ( bool  on)
virtual

Reimplemented from hotkey::command_executor.

Definition at line 220 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::search ( )
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().

void play_controller::hotkey_handler::select_and_action ( )
virtual
void play_controller::hotkey_handler::select_hex ( )
virtual
void play_controller::hotkey_handler::show_chat_log ( )
virtual
void play_controller::hotkey_handler::show_enemy_moves ( bool  ignore_units)
virtual
void play_controller::hotkey_handler::show_help ( )
virtual
void play_controller::hotkey_handler::show_menu ( const std::vector< std::string > &  items_arg,
int  xloc,
int  yloc,
bool  context_menu,
display disp 
)
virtual
void play_controller::hotkey_handler::show_statistics ( )
virtual
void play_controller::hotkey_handler::status_table ( )
virtual
void play_controller::hotkey_handler::terrain_description ( )
virtual
void play_controller::hotkey_handler::toggle_accelerated_speed ( )
virtual
void play_controller::hotkey_handler::toggle_ellipses ( )
virtual
void play_controller::hotkey_handler::toggle_grid ( )
virtual
void play_controller::hotkey_handler::undo ( )
virtual

Reimplemented from hotkey::command_executor.

Definition at line 168 of file hotkey_handler.cpp.

void play_controller::hotkey_handler::unit_description ( )
virtual
void play_controller::hotkey_handler::unit_list ( )
virtual
const team & play_controller::hotkey_handler::viewing_team ( ) const
protected

Definition at line 67 of file hotkey_handler.cpp.

bool play_controller::hotkey_handler::viewing_team_is_playing ( ) const
protected

Definition at line 68 of file hotkey_handler.cpp.

Member Data Documentation

int play_controller::hotkey_handler::last_context_menu_x_
private

Definition at line 74 of file hotkey_handler.hpp.

int play_controller::hotkey_handler::last_context_menu_y_
private

Definition at line 75 of file hotkey_handler.hpp.

events::menu_handler& play_controller::hotkey_handler::menu_handler_
protected

Definition at line 48 of file hotkey_handler.hpp.

events::mouse_handler& play_controller::hotkey_handler::mouse_handler_
protected

Definition at line 49 of file hotkey_handler.hpp.

play_controller& play_controller::hotkey_handler::play_controller_
protected

References to parent object / constituents.

Definition at line 46 of file hotkey_handler.hpp.

Referenced by get_display().

saved_game& play_controller::hotkey_handler::saved_game_
protected

Definition at line 51 of file hotkey_handler.hpp.

std::vector<std::string> play_controller::hotkey_handler::savenames_
private

Definition at line 66 of file hotkey_handler.hpp.

boost::scoped_ptr<wmi_pager> play_controller::hotkey_handler::wml_command_pager_
private

Definition at line 73 of file hotkey_handler.hpp.

std::vector<const_item_ptr> play_controller::hotkey_handler::wml_commands_
private

Definition at line 72 of file hotkey_handler.hpp.

const std::string play_controller::hotkey_handler::wml_menu_hotkey_prefix = "wml_menu:"
static

Definition at line 88 of file hotkey_handler.hpp.


The documentation for this class was generated from the following files: