20 #include <SDL2/SDL_events.h>
173 virtual void show_menu(
const std::vector<config>& items_arg,
int xloc,
int yloc,
bool context_menu,
display&
gui);
176 void execute_action(
const std::vector<std::string>& items_arg,
int xloc,
int yloc,
bool context_menu,
display&
gui);
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
virtual display & get_display()=0
void recalculate_minimap()
virtual void scroll_right(bool)
virtual void repeat_recruit()
virtual void replay_skip_animation()
virtual void set_button_state()
virtual void replay_next_side()
virtual void rename_unit()
virtual void clear_labels()
virtual void replay_show_team1()
virtual void preferences()
virtual void zoom_default()
virtual void scroll_up(bool)
void execute_quit_command()
virtual void scroll_left(bool)
virtual void whiteboard_execute_all_actions()
void get_menu_images(display &, std::vector< config > &items)
virtual void toggle_grid()
virtual void replay_next_move()
virtual bool do_execute_command(const hotkey::ui_command &command, bool press=true, bool release=false)
virtual void whiteboard_execute_action()
virtual void reset_replay()
void execute_action(const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu, display &gui)
virtual void show_enemy_moves(bool)
std::vector< queued_command > command_queue_
virtual void lua_console()
std::string get_menu_image(display &disp, const std::string &command, int index=-1) const
virtual void status_table()
virtual ACTION_STATE get_action_state(const hotkey::ui_command &) const
virtual void save_replay()
virtual void select_teleport()
virtual void toggle_shroud_updates()
virtual void whiteboard_bump_down_action()
void execute_command_wrap(const queued_command &command)
virtual void whiteboard_delete_action()
virtual void move_action()
virtual void user_command()
virtual void label_settings()
virtual void ai_formula()
virtual void show_statistics()
virtual void replay_exit()
virtual void replay_show_everything()
virtual void toggle_accelerated_speed()
virtual void whiteboard_suppose_dead()
virtual void show_menu(const std::vector< config > &items_arg, int xloc, int yloc, bool context_menu, display &gui)
virtual void scroll_down(bool)
virtual void play_replay()
virtual void deselect_hex()
virtual void stop_replay()
virtual void surrender_quit_game()
virtual void custom_command()
virtual void cycle_units()
virtual void cycle_back_units()
virtual void show_chat_log()
virtual void select_hex()
virtual void clear_messages()
virtual void unit_description()
virtual void select_and_action()
virtual void change_side()
virtual void label_terrain(bool)
virtual void start_network()
virtual void toggle_ellipses()
virtual void whiteboard_bump_up_action()
virtual void continue_move()
virtual void unit_hold_position()
virtual void goto_leader()
virtual void objectives()
virtual void create_unit()
virtual void terrain_description()
virtual void recalculate_minimap()
virtual void whiteboard_toggle()
virtual void replay_show_each()
virtual std::string get_action_image(const hotkey::ui_command &) const
virtual void left_mouse_click()
virtual bool can_execute_command(const hotkey::ui_command &command) const =0
bool run_queued_commands()
std::vector< queued_command > filter_command_queue()
void queue_command(const SDL_Event &event, int index=-1)
virtual void right_mouse_click()
virtual void replay_next_turn()
virtual ~command_executor()
virtual void end_unit_turn()
virtual void update_shroud_now()
virtual void stop_network()
virtual void change_language()
virtual void map_screenshot()
Keyboard shortcuts for game actions.
void jhat_event(const SDL_Event &event, command_executor *executor)
const hotkey_command & get_hotkey_command(const std::string &command)
returns the hotkey_command with the given name
void key_event(const SDL_Event &event, command_executor *executor)
void mbutton_event(const SDL_Event &event, command_executor *executor)
void run_events(command_executor *executor)
void jbutton_event(const SDL_Event &event, command_executor *executor)
void keyup_event(const SDL_Event &, command_executor *executor)
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
queued_command(const hotkey_command &command_, int index_, bool press_, bool release_)
const hotkey_command * command
Stores all information related to functions that can be bound to hotkeys.
HOTKEY_COMMAND command
The command associated with this hotkey.
static const hotkey_command & get_command_by_command(HOTKEY_COMMAND command)
the execute_command argument was changed from HOTKEY_COMMAND to hotkey_command, to be able to call it...
Used as the main paramneter for can_execute_command/do_execute_command These functions are used to ex...
ui_command(hotkey::HOTKEY_COMMAND hotkey_command, std::string_view id, int index=-1)
ui_command(const hotkey::hotkey_command &cmd, int index=-1)
hotkey::HOTKEY_COMMAND hotkey_command
The hotkey::HOTKEY_COMMAND associated with this action, HOTKEY_NULL for actions that don't allow hotk...
int index
When this action was the result of a menu click, this is the index of the clicked item in the menu.
std::string id
The string command, never empty, describes the action uniquely. when the action is the result of a me...
ui_command(std::string_view id, int index=-1)