The Battle for Wesnoth  1.15.1+dev
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
events::console_handler Class Reference
Inheritance diagram for events::console_handler:
Inheritance graph

Public Types

typedef map_command_handler< console_handlerchmap
 
- Public Types inherited from events::map_command_handler< console_handler >
typedef void(console_handler ::* command_handler) ()
 
typedef std::map< std::string, command > command_map
 
typedef std::map< std::string, std::string > command_alias_map
 

Public Member Functions

 console_handler (menu_handler &menu_handler)
 
- Public Member Functions inherited from events::map_command_handler< console_handler >
 map_command_handler ()
 
virtual ~map_command_handler ()
 
bool empty () const
 
void dispatch (std::string cmd)
 
std::vector< std::string > get_commands_list () const
 
void command_failed (const std::string &message, bool=false)
 

Protected Member Functions

virtual void register_command (const std::string &cmd, chat_command_handler::command_handler h, const std::string &help="", const std::string &usage="", const std::string &flags="")
 
virtual void register_alias (const std::string &to_cmd, const std::string &cmd)
 
virtual std::string get_arg (unsigned i) const
 
virtual std::string get_cmd () const
 
virtual std::string get_data (unsigned n=1) const
 
void do_refresh ()
 
void do_droid ()
 
void do_idle ()
 
void do_theme ()
 
void do_control ()
 
void do_controller ()
 
void do_clear ()
 
void do_foreground ()
 
void do_layers ()
 
void do_fps ()
 
void do_benchmark ()
 
void do_save ()
 
void do_save_quit ()
 
void do_quit ()
 
void do_ignore_replay_errors ()
 
void do_nosaves ()
 
void do_next_level ()
 
void do_choose_level ()
 
void do_turn ()
 
void do_turn_limit ()
 
void do_debug ()
 
void do_nodebug ()
 
void do_lua ()
 
void do_unsafe_lua ()
 
void do_custom ()
 
void do_set_alias ()
 
void do_set_var ()
 
void do_show_var ()
 
void do_inspect ()
 
void do_control_dialog ()
 
void do_unit ()
 
void do_discover ()
 
void do_undiscover ()
 
void do_create ()
 Implements the (debug mode) console command that creates a unit. More...
 
void do_fog ()
 
void do_shroud ()
 
void do_gold ()
 
void do_event ()
 
void do_toggle_draw_coordinates ()
 
void do_toggle_draw_terrain_codes ()
 
void do_toggle_draw_num_of_bitmaps ()
 
void do_toggle_whiteboard ()
 
void do_whiteboard_options ()
 
std::string get_flags_description () const
 
std::string get_command_flags_description (const chmap::command &c) const
 
bool is_enabled (const chmap::command &c) const
 
void print (const std::string &title, const std::string &message)
 
void init_map ()
 
- Protected Member Functions inherited from events::map_command_handler< console_handler >
void init_map_default ()
 
virtual std::string get_command_flags_description (const command &) const
 
virtual bool is_enabled (const command &) const
 
virtual void parse_cmd (const std::string &cmd_string)
 
void command_failed_need_arg (int argn)
 
void print_usage ()
 
std::string get_actual_cmd (const std::string &cmd) const
 
const command * get_command (const std::string &cmd) const
 
command * get_command (const std::string &cmd)
 
void help ()
 
bool help_command (const std::string &acmd)
 
virtual void register_command (const std::string &cmd, command_handler h, const std::string &help="", const std::string &usage="", const std::string &flags="")
 

Private Attributes

menu_handlermenu_handler_
 
const unsigned int team_num_
 
- Private Attributes inherited from events::map_command_handler< chat_command_handler >
cmd_arg_parser cap_
 

Additional Inherited Members

- Static Protected Member Functions inherited from events::map_command_handler< console_handler >
static void set_help_on_unknown (bool value)
 
static void set_cmd_prefix (std::string value)
 
static const std::vector< std::string > get_aliases (const std::string &cmd)
 
- Protected Attributes inherited from events::map_command_handler< console_handler >
cmd_arg_parser cap_
 
- Private Types inherited from events::chat_command_handler
typedef map_command_handler< chat_command_handlermap
 
- Private Types inherited from events::map_command_handler< chat_command_handler >
typedef void(chat_command_handler ::* command_handler) ()
 
typedef std::map< std::string, command > command_map
 
typedef std::map< std::string, std::string > command_alias_map
 
- Private Member Functions inherited from events::chat_command_handler
 chat_command_handler (chat_handler &chathandler, bool allies_only)
 
void do_emote ()
 
void do_network_send ()
 
void do_network_send_req_arg ()
 
void do_room_query ()
 
void do_room_query_noarg ()
 
void do_gen_room_query ()
 
void do_whisper ()
 
void do_chanmsg ()
 
void do_log ()
 
void do_ignore ()
 
void do_friend ()
 
void do_remove ()
 
void do_display ()
 
void do_version ()
 
void do_register ()
 Ask the server to register the currently used nick. More...
 
void do_drop ()
 Ask the server do drop the currently used (and registered) nick. More...
 
void do_set ()
 Update details for the currently used username. More...
 
void do_info ()
 Request information about a user from the server. More...
 
void do_details ()
 Request a list of details that can be set for a username as these might vary depending on the configuration of the server. More...
 
std::string get_command_flags_description (const map_command_handler< chat_command_handler >::command &c) const
 
bool is_enabled (const map_command_handler< chat_command_handler >::command &c) const
 
- Private Member Functions inherited from events::map_command_handler< chat_command_handler >
 map_command_handler ()
 
virtual ~map_command_handler ()
 
bool empty () const
 
void dispatch (std::string cmd)
 
std::vector< std::string > get_commands_list () const
 
void command_failed (const std::string &message, bool=false)
 
void init_map_default ()
 
virtual std::string get_command_flags_description (const command &) const
 
virtual bool is_enabled (const command &) const
 
virtual void parse_cmd (const std::string &cmd_string)
 
void command_failed_need_arg (int argn)
 
void print_usage ()
 
std::string get_actual_cmd (const std::string &cmd) const
 
const command * get_command (const std::string &cmd) const
 
command * get_command (const std::string &cmd)
 
void help ()
 
bool help_command (const std::string &acmd)
 
- Static Private Member Functions inherited from events::map_command_handler< chat_command_handler >
static void set_help_on_unknown (bool value)
 
static void set_cmd_prefix (std::string value)
 
static const std::vector< std::string > get_aliases (const std::string &cmd)
 

Detailed Description

Definition at line 1046 of file menu_events.cpp.

Member Typedef Documentation

◆ chmap

Definition at line 1050 of file menu_events.cpp.

Constructor & Destructor Documentation

◆ console_handler()

events::console_handler::console_handler ( menu_handler menu_handler)
inline

Definition at line 1051 of file menu_events.cpp.

References dispatch().

Member Function Documentation

◆ do_benchmark()

void events::console_handler::do_benchmark ( )
protected

Definition at line 1649 of file menu_events.cpp.

Referenced by init_map().

◆ do_choose_level()

void events::console_handler::do_choose_level ( )
protected

◆ do_clear()

void events::console_handler::do_clear ( )
protected

Definition at line 1613 of file menu_events.cpp.

Referenced by init_map().

◆ do_control()

void events::console_handler::do_control ( )
protected

Definition at line 1540 of file menu_events.cpp.

References resources::gameboard, lexical_cast(), events::menu_handler::teams(), and VGETTEXT.

Referenced by init_map().

◆ do_control_dialog()

void events::console_handler::do_control_dialog ( )
protected

Definition at line 1856 of file menu_events.cpp.

References gui2::dialogs::modal_dialog::show().

Referenced by init_map().

◆ do_controller()

void events::console_handler::do_controller ( )
protected

Definition at line 1581 of file menu_events.cpp.

References lexical_cast(), print(), and VGETTEXT.

Referenced by init_map().

◆ do_create()

void events::console_handler::do_create ( )
protected

Implements the (debug mode) console command that creates a unit.

Definition at line 1920 of file menu_events.cpp.

References _(), unit_type_data::find(), events::mouse_handler::get_last_hex(), play_controller::get_mouse_handler_base(), events::mouse_handler::pc_, and unit_types.

Referenced by init_map().

◆ do_custom()

void events::console_handler::do_custom ( )
protected

Definition at line 1795 of file menu_events.cpp.

References preferences::set_custom_command().

Referenced by init_map().

◆ do_debug()

void events::console_handler::do_debug ( )
protected

Definition at line 1751 of file menu_events.cpp.

References _(), game_config::mp_debug, print(), and game_config::set_debug().

Referenced by init_map().

◆ do_discover()

void events::console_handler::do_discover ( )
protected

Definition at line 1903 of file menu_events.cpp.

References preferences::encountered_units(), i, unit_type_data::types(), and unit_types.

Referenced by init_map().

◆ do_droid()

void events::console_handler::do_droid ( )
protected

Definition at line 1421 of file menu_events.cpp.

References print(), and VGETTEXT.

Referenced by init_map().

◆ do_event()

void events::console_handler::do_event ( )
protected

Definition at line 1953 of file menu_events.cpp.

References synced_context::run_and_throw().

Referenced by init_map().

◆ do_fog()

void events::console_handler::do_fog ( )
protected

Definition at line 1938 of file menu_events.cpp.

References synced_context::run_and_throw().

Referenced by init_map().

◆ do_foreground()

void events::console_handler::do_foreground ( )
protected

Definition at line 1618 of file menu_events.cpp.

Referenced by init_map().

◆ do_fps()

void events::console_handler::do_fps ( )
protected

Definition at line 1644 of file menu_events.cpp.

References preferences::set_show_fps(), and preferences::show_fps().

Referenced by init_map().

◆ do_gold()

void events::console_handler::do_gold ( )
protected

Definition at line 1948 of file menu_events.cpp.

References synced_context::run_and_throw().

Referenced by init_map().

◆ do_idle()

void events::console_handler::do_idle ( )
protected

Definition at line 1482 of file menu_events.cpp.

References VGETTEXT.

Referenced by init_map().

◆ do_ignore_replay_errors()

void events::console_handler::do_ignore_replay_errors ( )
protected

Definition at line 1670 of file menu_events.cpp.

References game_config::ignore_replay_errors.

Referenced by init_map().

◆ do_inspect()

void events::console_handler::do_inspect ( )
protected

◆ do_layers()

void events::console_handler::do_layers ( )
protected

◆ do_lua()

void events::console_handler::do_lua ( )
protected

Definition at line 1769 of file menu_events.cpp.

References synced_context::run_and_throw().

Referenced by init_map().

◆ do_next_level()

void events::console_handler::do_next_level ( )
protected

Definition at line 1680 of file menu_events.cpp.

References synced_context::run_and_throw().

Referenced by init_map().

◆ do_nodebug()

void events::console_handler::do_nodebug ( )
protected

Definition at line 1761 of file menu_events.cpp.

References _(), game_config::debug, print(), and game_config::set_debug().

Referenced by init_map().

◆ do_nosaves()

void events::console_handler::do_nosaves ( )
protected

Definition at line 1675 of file menu_events.cpp.

References game_config::disable_autosave.

Referenced by init_map().

◆ do_quit()

void events::console_handler::do_quit ( )
protected

Definition at line 1665 of file menu_events.cpp.

References throw_quit_game_exception().

Referenced by init_map().

◆ do_refresh()

void events::console_handler::do_refresh ( )
protected

Definition at line 1412 of file menu_events.cpp.

References sound::flush_cache(), and image::flush_cache().

Referenced by init_map().

◆ do_save()

void events::console_handler::do_save ( )
protected

Definition at line 1654 of file menu_events.cpp.

Referenced by init_map().

◆ do_save_quit()

void events::console_handler::do_save_quit ( )
protected

Definition at line 1659 of file menu_events.cpp.

Referenced by init_map().

◆ do_set_alias()

void events::console_handler::do_set_alias ( )
protected

◆ do_set_var()

void events::console_handler::do_set_var ( )
protected

Definition at line 1825 of file menu_events.cpp.

References _(), gui2::event::find(), name(), and synced_context::run_and_throw().

Referenced by init_map().

◆ do_show_var()

void events::console_handler::do_show_var ( )
protected

Definition at line 1843 of file menu_events.cpp.

References gui2::show_transient_message().

Referenced by init_map().

◆ do_shroud()

void events::console_handler::do_shroud ( )
protected

Definition at line 1943 of file menu_events.cpp.

References synced_context::run_and_throw().

Referenced by init_map().

◆ do_theme()

void events::console_handler::do_theme ( )
protected

Definition at line 1520 of file menu_events.cpp.

References preferences::show_theme_dialog().

Referenced by init_map().

◆ do_toggle_draw_coordinates()

void events::console_handler::do_toggle_draw_coordinates ( )
protected

Definition at line 1958 of file menu_events.cpp.

Referenced by init_map().

◆ do_toggle_draw_num_of_bitmaps()

void events::console_handler::do_toggle_draw_num_of_bitmaps ( )
protected

Definition at line 1969 of file menu_events.cpp.

Referenced by init_map().

◆ do_toggle_draw_terrain_codes()

void events::console_handler::do_toggle_draw_terrain_codes ( )
protected

Definition at line 1963 of file menu_events.cpp.

Referenced by init_map().

◆ do_toggle_whiteboard()

void events::console_handler::do_toggle_whiteboard ( )
protected

Definition at line 1975 of file menu_events.cpp.

References _(), and print().

Referenced by init_map().

◆ do_turn()

void events::console_handler::do_turn ( )
protected

Definition at line 1733 of file menu_events.cpp.

References synced_context::run_and_throw(), and tod_manager::turn().

Referenced by init_map().

◆ do_turn_limit()

void events::console_handler::do_turn_limit ( )
protected

Definition at line 1745 of file menu_events.cpp.

References synced_context::run_and_throw().

Referenced by init_map().

◆ do_undiscover()

void events::console_handler::do_undiscover ( )
protected

◆ do_unit()

void events::console_handler::do_unit ( )
protected

◆ do_unsafe_lua()

void events::console_handler::do_unsafe_lua ( )
protected

Definition at line 1778 of file menu_events.cpp.

References _(), gui2::OK, gui2::dialogs::message::ok_cancel_buttons, print(), and gui2::show_message().

Referenced by init_map().

◆ do_whiteboard_options()

void events::console_handler::do_whiteboard_options ( )
protected

Definition at line 1988 of file menu_events.cpp.

Referenced by init_map().

◆ get_arg()

virtual std::string events::console_handler::get_arg ( unsigned  i) const
inlineprotectedvirtual

Reimplemented from events::map_command_handler< console_handler >.

Definition at line 1080 of file menu_events.cpp.

◆ get_cmd()

virtual std::string events::console_handler::get_cmd ( ) const
inlineprotectedvirtual

Reimplemented from events::map_command_handler< console_handler >.

Definition at line 1085 of file menu_events.cpp.

◆ get_command_flags_description()

std::string events::console_handler::get_command_flags_description ( const chmap::command &  c) const
inlineprotected

Definition at line 1154 of file menu_events.cpp.

References _().

◆ get_data()

virtual std::string events::console_handler::get_data ( unsigned  n = 1) const
inlineprotectedvirtual

Reimplemented from events::map_command_handler< console_handler >.

Definition at line 1090 of file menu_events.cpp.

References n.

◆ get_flags_description()

std::string events::console_handler::get_flags_description ( ) const
inlineprotectedvirtual

◆ init_map()

void events::console_handler::init_map ( )
inlineprotectedvirtual

◆ is_enabled()

bool events::console_handler::is_enabled ( const chmap::command &  c) const
inlineprotected

◆ print()

void events::console_handler::print ( const std::string &  title,
const std::string &  message 
)
inlineprotectedvirtual

Reimplemented from events::chat_command_handler.

Definition at line 1172 of file menu_events.cpp.

◆ register_alias()

virtual void events::console_handler::register_alias ( const std::string &  to_cmd,
const std::string &  cmd 
)
inlineprotectedvirtual

Reimplemented from events::map_command_handler< console_handler >.

Definition at line 1075 of file menu_events.cpp.

◆ register_command()

virtual void events::console_handler::register_command ( const std::string &  cmd,
chat_command_handler::command_handler  h,
const std::string &  help = "",
const std::string &  usage = "",
const std::string &  flags = "" 
)
inlineprotectedvirtual

Reimplemented from events::map_command_handler< chat_command_handler >.

Definition at line 1066 of file menu_events.cpp.

Member Data Documentation

◆ menu_handler_

menu_handler& events::console_handler::menu_handler_
private

Definition at line 1279 of file menu_events.cpp.

◆ team_num_

const unsigned int events::console_handler::team_num_
private

Definition at line 1280 of file menu_events.cpp.


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