The Battle for Wesnoth  1.15.0-dev
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)
 
virtual ~menu_handler ()
 
gui::floating_textboxget_textbox ()
 
void set_gui (game_display *gui)
 
void objectives ()
 
void show_statistics (int side_num)
 
void unit_list ()
 
void status_table ()
 
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::string > get_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, map_location &target_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
 
game_stategamestate () const
 
game_datagamedata ()
 
game_boardboard () const
 
unit_mapunits ()
 
std::vector< team > & teams () const
 
const gamemapmap () const
 

Protected Member Functions

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

Private Member Functions

bool has_friends () const
 
- 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 45 of file menu_events.hpp.

Constructor & Destructor Documentation

◆ menu_handler()

events::menu_handler::menu_handler ( game_display gui,
play_controller pc 
)

Definition at line 91 of file menu_events.cpp.

◆ ~menu_handler()

events::menu_handler::~menu_handler ( )
virtual

Definition at line 101 of file menu_events.cpp.

Member Function Documentation

◆ add_chat_message()

void events::menu_handler::add_chat_message ( const std::time_t &  time,
const std::string &  speaker,
int  side,
const std::string &  message,
events::chat_handler::MESSAGE_TYPE  type = events::chat_handler::MESSAGE_PRIVATE 
)
overrideprotectedvirtual

◆ ai_formula()

void events::menu_handler::ai_formula ( )

◆ board()

game_board & events::menu_handler::board ( ) const

◆ change_side()

void events::menu_handler::change_side ( mouse_handler mousehandler)

◆ clear_labels()

void events::menu_handler::clear_labels ( )

◆ clear_messages()

void events::menu_handler::clear_messages ( )

◆ continue_move()

void events::menu_handler::continue_move ( mouse_handler mousehandler,
int  side_num 
)

◆ create_unit()

void events::menu_handler::create_unit ( mouse_handler mousehandler)

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

Definition at line 718 of file menu_events.cpp.

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

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

◆ current_unit() [1/2]

unit_map::iterator events::menu_handler::current_unit ( )

◆ current_unit() [2/2]

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

◆ custom_command()

void events::menu_handler::custom_command ( )

◆ do_ai_formula()

void events::menu_handler::do_ai_formula ( const std::string &  str,
int  side_num,
mouse_handler mousehandler 
)

Definition at line 1962 of file menu_events.cpp.

References add_chat_message(), and ai::manager::get_singleton().

Referenced by play_controller::enter_textbox().

◆ do_command()

void events::menu_handler::do_command ( const std::string &  str)

◆ do_recruit()

bool events::menu_handler::do_recruit ( const std::string &  name,
int  side_num,
map_location target_hex 
)

◆ do_search()

void events::menu_handler::do_search ( const std::string &  new_search)

◆ do_speak()

void events::menu_handler::do_speak ( )

◆ end_turn()

bool events::menu_handler::end_turn ( int  side_num)

◆ end_unit_turn()

void events::menu_handler::end_unit_turn ( mouse_handler mousehandler,
int  side_num 
)

◆ execute_gotos()

void events::menu_handler::execute_gotos ( mouse_handler mousehandler,
int  side_num 
)

◆ gamedata()

game_data & events::menu_handler::gamedata ( )

Definition at line 110 of file menu_events.cpp.

References game_state::gamedata_, and gamestate().

Referenced by end_turn().

◆ gamestate()

game_state & events::menu_handler::gamestate ( ) const

Definition at line 105 of file menu_events.cpp.

References play_controller::gamestate(), and pc_.

Referenced by board(), gamedata(), map(), objectives(), teams(), and units().

◆ get_commands_list()

std::vector< std::string > events::menu_handler::get_commands_list ( )

◆ get_textbox()

gui::floating_textbox & events::menu_handler::get_textbox ( )

◆ goto_leader()

void events::menu_handler::goto_leader ( int  side_num)

◆ has_friends()

bool events::menu_handler::has_friends ( ) const
private

Definition at line 239 of file menu_events.cpp.

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

Referenced by send_chat_message(), and speak().

◆ kill_unit()

void events::menu_handler::kill_unit ( mouse_handler mousehandler)

◆ label_settings()

void events::menu_handler::label_settings ( )

◆ label_terrain()

void events::menu_handler::label_terrain ( mouse_handler mousehandler,
bool  team_only 
)

◆ map()

const gamemap & events::menu_handler::map ( ) const

◆ move_unit_to_loc()

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 
)

◆ objectives()

void events::menu_handler::objectives ( )

◆ preferences()

void events::menu_handler::preferences ( )

◆ recall()

void events::menu_handler::recall ( int  side_num,
const map_location last_hex 
)

◆ recruit()

void events::menu_handler::recruit ( int  side_num,
const map_location last_hex 
)

◆ rename_unit()

void events::menu_handler::rename_unit ( )

◆ repeat_recruit()

void events::menu_handler::repeat_recruit ( int  side_num,
const map_location last_hex 
)

◆ request_control_change()

void events::menu_handler::request_control_change ( int  side_num,
const std::string &  player 
)

◆ save_map()

void events::menu_handler::save_map ( )

◆ search()

void events::menu_handler::search ( )

◆ send_chat_message()

void events::menu_handler::send_chat_message ( const std::string &  message,
bool  allies_only = false 
)
overrideprotectedvirtual

◆ send_to_server()

void events::menu_handler::send_to_server ( const config cfg)
overridevirtual

Implements events::chat_handler.

Definition at line 2009 of file menu_events.cpp.

References pc_, and play_controller::send_to_wesnothd().

◆ set_gui()

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

Definition at line 52 of file menu_events.hpp.

References preferences::custom_command(), and help::show_help().

Referenced by play_controller::init().

◆ shout()

void events::menu_handler::shout ( )

◆ show_chat_log()

void events::menu_handler::show_chat_log ( )

◆ show_enemy_moves()

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

◆ show_help()

void events::menu_handler::show_help ( )

Definition at line 213 of file menu_events.cpp.

References help::show_help().

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

◆ show_statistics()

void events::menu_handler::show_statistics ( int  side_num)

Definition at line 150 of file menu_events.cpp.

References board().

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

◆ speak()

void events::menu_handler::speak ( )

◆ status_table()

void events::menu_handler::status_table ( )

◆ teams()

std::vector< team > & events::menu_handler::teams ( ) const

◆ terrain_description()

void events::menu_handler::terrain_description ( mouse_handler mousehandler)

◆ toggle_ellipses()

void events::menu_handler::toggle_ellipses ( )

◆ toggle_grid()

void events::menu_handler::toggle_grid ( )

◆ toggle_shroud_updates()

void events::menu_handler::toggle_shroud_updates ( int  side_num)

◆ unit_description()

void events::menu_handler::unit_description ( )

◆ unit_hold_position()

void events::menu_handler::unit_hold_position ( mouse_handler mousehandler,
int  side_num 
)

◆ unit_list()

void events::menu_handler::unit_list ( )

Definition at line 155 of file menu_events.cpp.

References gui_, and gui2::dialogs::show_unit_list().

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

◆ units()

unit_map & events::menu_handler::units ( )

◆ update_shroud_now()

void events::menu_handler::update_shroud_now ( int  side_num)

◆ user_command()

void events::menu_handler::user_command ( )

◆ whisper()

void events::menu_handler::whisper ( )

Friends And Related Function Documentation

◆ console_handler

friend class console_handler
friend

Definition at line 137 of file menu_events.hpp.

Member Data Documentation

◆ game_config_

const config& events::menu_handler::game_config_
private

Definition at line 146 of file menu_events.hpp.

Referenced by preferences().

◆ gui_

game_display* events::menu_handler::gui_
private

◆ last_search_

std::string events::menu_handler::last_search_
private

Definition at line 149 of file menu_events.hpp.

Referenced by do_search(), and search().

◆ last_search_hit_

map_location events::menu_handler::last_search_hit_
private

Definition at line 150 of file menu_events.hpp.

Referenced by do_search(), and search().

◆ pc_

play_controller& events::menu_handler::pc_
private

◆ textbox_info_

gui::floating_textbox events::menu_handler::textbox_info_
private

Definition at line 148 of file menu_events.hpp.

Referenced by ai_formula(), do_speak(), get_textbox(), search(), speak(), and user_command().


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