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

#include <menu_events.hpp>

Inheritance diagram for events::menu_handler:
Inheritance graph

Public Member Functions

 menu_handler (game_display *gui, play_controller &pc, const config &game_config)
 
virtual ~menu_handler ()
 
gui::floating_textboxget_textbox ()
 
void set_gui (game_display *gui)
 
std::string get_title_suffix (int side_num)
 
void objectives (int side_num)
 
void show_statistics (int side_num)
 
void unit_list ()
 
void status_table (int selected=0)
 
void save_map ()
 
void preferences ()
 
void show_chat_log ()
 
void show_help ()
 
void speak ()
 
void whisper ()
 
void shout ()
 
void recruit (int side_num, const map_location &last_hex)
 
void repeat_recruit (int side_num, const map_location &last_hex)
 
void recall (int side_num, const map_location &last_hex)
 
void show_enemy_moves (bool ignore_units, int side_num)
 
void toggle_shroud_updates (int side_num)
 
void update_shroud_now (int side_num)
 
bool end_turn (int side_num)
 
void goto_leader (int side_num)
 
void unit_description ()
 
void terrain_description (mouse_handler &mousehandler)
 
void rename_unit ()
 
void create_unit (mouse_handler &mousehandler)
 Creates a unit (in debug mode via hotkey or context menu). More...
 
void change_side (mouse_handler &mousehandler)
 
void kill_unit (mouse_handler &mousehandler)
 
void label_terrain (mouse_handler &mousehandler, bool team_only)
 
void clear_labels ()
 
void label_settings ()
 
void continue_move (mouse_handler &mousehandler, int side_num)
 
void execute_gotos (mouse_handler &mousehandler, int side_num)
 
void toggle_ellipses ()
 
void toggle_grid ()
 
void unit_hold_position (mouse_handler &mousehandler, int side_num)
 
void end_unit_turn (mouse_handler &mousehandler, int side_num)
 
void search ()
 
void request_control_change (int side_num, const std::string &player)
 
void user_command ()
 
void custom_command ()
 
void ai_formula ()
 
void clear_messages ()
 
std::vector< std::stringget_commands_list ()
 
unit_map::iterator current_unit ()
 
unit_map::const_iterator current_unit () const
 
void move_unit_to_loc (const unit_map::iterator &ui, const map_location &target, bool continue_move, int side_num, mouse_handler &mousehandler)
 
bool do_recruit (const std::string &name, int side_num, const map_location &last_hex)
 
void do_speak ()
 
void do_search (const std::string &new_search)
 
void do_command (const std::string &str)
 
void do_ai_formula (const std::string &str, int side_num, mouse_handler &mousehandler)
 
void send_to_server (const config &cfg) override
 

Protected Member Functions

void add_chat_message (const time_t &time, const std::string &speaker, int side, const std::string &message, events::chat_handler::MESSAGE_TYPE type=events::chat_handler::MESSAGE_PRIVATE)
 
void send_chat_message (const std::string &message, bool allies_only=false)
 

Private Member Functions

bool has_friends () const
 
void scenario_settings_table (int selected=0)
 
game_stategamestate () const
 
game_datagamedata ()
 
game_boardboard () const
 
unit_mapunits ()
 
std::vector< team > & teams () const
 
const gamemapmap ()
 
- Private Member Functions inherited from events::chat_handler
 chat_handler ()
 
virtual ~chat_handler ()
 
void send_command (const std::string &cmd, const std::string &args="")
 
void do_speak (const std::string &message, bool allies_only=false)
 
virtual void send_whisper (const std::string &receiver, const std::string &message)
 
virtual void add_whisper_sent (const std::string &receiver, const std::string &message)
 
virtual void add_whisper_received (const std::string &sender, const std::string &message)
 
virtual void send_chat_room_message (const std::string &room, const std::string &message)
 
virtual void add_chat_room_message_sent (const std::string &room, const std::string &message)
 
virtual void add_chat_room_message_received (const std::string &room, const std::string &speaker, const std::string &message)
 
virtual void user_relation_changed (const std::string &name)
 Called when a processed command results in a relation (friend/ignore) change for a user whose name is passed as the 'name' arg. More...
 
void change_logging (const std::string &data)
 Change the log level of a log domain. More...
 

Private Attributes

game_displaygui_
 
play_controllerpc_
 
const configgame_config_
 
gui::floating_textbox textbox_info_
 
std::string last_search_
 
map_location last_search_hit_
 

Friends

class console_handler
 

Additional Inherited Members

- Private Types inherited from events::chat_handler
enum  MESSAGE_TYPE { MESSAGE_PUBLIC, MESSAGE_PRIVATE }
 

Detailed Description

Definition at line 43 of file menu_events.hpp.

Constructor & Destructor Documentation

events::menu_handler::menu_handler ( game_display gui,
play_controller pc,
const config game_config 
)

Definition at line 94 of file menu_events.cpp.

events::menu_handler::~menu_handler ( )
virtual

Definition at line 104 of file menu_events.cpp.

Member Function Documentation

void events::menu_handler::add_chat_message ( const time_t &  time,
const std::string speaker,
int  side,
const std::string message,
events::chat_handler::MESSAGE_TYPE  type = events::chat_handler::MESSAGE_PRIVATE 
)
protectedvirtual
void events::menu_handler::ai_formula ( )
game_board & events::menu_handler::board ( ) const
private
void events::menu_handler::change_side ( mouse_handler mousehandler)
void events::menu_handler::clear_labels ( )
void events::menu_handler::clear_messages ( )
void events::menu_handler::continue_move ( mouse_handler mousehandler,
int  side_num 
)
void events::menu_handler::create_unit ( mouse_handler mousehandler)

Creates a unit (in debug mode via hotkey or context menu).

Definition at line 949 of file menu_events.cpp.

References events::mouse_handler::get_last_hex(), gui_, map(), and units().

Referenced by playsingle_controller::hotkey_handler::create_unit().

unit_map::iterator events::menu_handler::current_unit ( )
unit_map::const_iterator events::menu_handler::current_unit ( ) const
inline

Definition at line 96 of file menu_events.hpp.

References current_unit().

void events::menu_handler::custom_command ( )
void events::menu_handler::do_ai_formula ( const std::string str,
int  side_num,
mouse_handler mousehandler 
)
void events::menu_handler::do_command ( const std::string str)
bool events::menu_handler::do_recruit ( const std::string name,
int  side_num,
const map_location last_hex 
)
void events::menu_handler::do_search ( const std::string new_search)
void events::menu_handler::do_speak ( )
bool events::menu_handler::end_turn ( int  side_num)
void events::menu_handler::end_unit_turn ( mouse_handler mousehandler,
int  side_num 
)
void events::menu_handler::execute_gotos ( mouse_handler mousehandler,
int  side_num 
)
game_data & events::menu_handler::gamedata ( )
private
game_state & events::menu_handler::gamestate ( ) const
private
std::vector< std::string > events::menu_handler::get_commands_list ( )
gui::floating_textbox & events::menu_handler::get_textbox ( )
std::string events::menu_handler::get_title_suffix ( int  side_num)

Definition at line 119 of file menu_events.cpp.

References unit_map::end(), unit_map::find_leader(), i, game_logic::msg(), teams(), and units().

Referenced by recall().

void events::menu_handler::goto_leader ( int  side_num)
bool events::menu_handler::has_friends ( ) const
private

Definition at line 509 of file menu_events.cpp.

References board(), gui_, game_display::observers(), teams(), and display::viewing_team().

Referenced by send_chat_message(), and speak().

void events::menu_handler::kill_unit ( mouse_handler mousehandler)
void events::menu_handler::label_settings ( )
void events::menu_handler::label_terrain ( mouse_handler mousehandler,
bool  team_only 
)
const gamemap & events::menu_handler::map ( )
private
void events::menu_handler::move_unit_to_loc ( const unit_map::iterator ui,
const map_location target,
bool  continue_move,
int  side_num,
mouse_handler mousehandler 
)
void events::menu_handler::objectives ( int  side_num)
void events::menu_handler::preferences ( )
void events::menu_handler::recall ( int  side_num,
const map_location last_hex 
)
void events::menu_handler::recruit ( int  side_num,
const map_location last_hex 
)
void events::menu_handler::rename_unit ( )
void events::menu_handler::repeat_recruit ( int  side_num,
const map_location last_hex 
)

Definition at line 557 of file menu_events.cpp.

References do_recruit(), and teams().

Referenced by playsingle_controller::hotkey_handler::repeat_recruit().

void events::menu_handler::request_control_change ( int  side_num,
const std::string player 
)
void events::menu_handler::save_map ( )
void events::menu_handler::scenario_settings_table ( int  selected = 0)
private
void events::menu_handler::search ( )
void events::menu_handler::send_chat_message ( const std::string message,
bool  allies_only = false 
)
protectedvirtual
void events::menu_handler::send_to_server ( const config cfg)
overridevirtual

Implements events::chat_handler.

Definition at line 2235 of file menu_events.cpp.

References pc_, and play_controller::send_to_wesnothd().

void events::menu_handler::set_gui ( game_display gui)
inline

Definition at line 50 of file menu_events.hpp.

References gui_.

Referenced by play_controller::init().

void events::menu_handler::shout ( )
void events::menu_handler::show_chat_log ( )
void events::menu_handler::show_enemy_moves ( bool  ignore_units,
int  side_num 
)
void events::menu_handler::show_help ( )

Definition at line 485 of file menu_events.cpp.

References gui_, help::show_help(), and display::video().

Referenced by play_controller::hotkey_handler::show_help().

void events::menu_handler::show_statistics ( int  side_num)
void events::menu_handler::speak ( )
void events::menu_handler::status_table ( int  selected = 0)
std::vector< team > & events::menu_handler::teams ( ) const
private
void events::menu_handler::terrain_description ( mouse_handler mousehandler)
void events::menu_handler::toggle_ellipses ( )
void events::menu_handler::toggle_grid ( )
void events::menu_handler::toggle_shroud_updates ( int  side_num)
void events::menu_handler::unit_description ( )
void events::menu_handler::unit_hold_position ( mouse_handler mousehandler,
int  side_num 
)
void events::menu_handler::unit_list ( )

Definition at line 167 of file menu_events.cpp.

References gui_, and dialogs::show_unit_list().

Referenced by play_controller::hotkey_handler::unit_list().

unit_map & events::menu_handler::units ( )
private
void events::menu_handler::update_shroud_now ( int  side_num)
void events::menu_handler::user_command ( )
void events::menu_handler::whisper ( )

Friends And Related Function Documentation

friend class console_handler
friend

Definition at line 115 of file menu_events.hpp.

Member Data Documentation

const config& events::menu_handler::game_config_
private

Definition at line 132 of file menu_events.hpp.

Referenced by events::console_handler::do_choose_level(), and preferences().

game_display* events::menu_handler::gui_
private
std::string events::menu_handler::last_search_
private

Definition at line 135 of file menu_events.hpp.

Referenced by do_search(), and search().

map_location events::menu_handler::last_search_hit_
private

Definition at line 136 of file menu_events.hpp.

Referenced by do_search(), and search().

play_controller& events::menu_handler::pc_
private
gui::floating_textbox events::menu_handler::textbox_info_
private

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