Used as the main parameter for can_execute_command/do_execute_command These functions are used to execute hotkeys but also to execute menu items, (Most menu items point to the same action as a hotkey but not all) More...
#include <command_executor.hpp>
Public Member Functions | |
ui_command (hotkey::HOTKEY_COMMAND hotkey_command, std::string_view id, int index=-1) | |
ui_command (const hotkey::hotkey_command &cmd, int index=-1) | |
ui_command (std::string_view id, int index=-1) | |
Public Attributes | |
hotkey::HOTKEY_COMMAND | hotkey_command |
The hotkey::HOTKEY_COMMAND associated with this action, HOTKEY_NULL for actions that don't allow hotkey binding. More... | |
std::string | id |
The string command, never empty, describes the action uniquely. More... | |
int | index |
When this action was the result of a menu click, this is the index of the clicked item in the menu. More... | |
Used as the main parameter for can_execute_command/do_execute_command These functions are used to execute hotkeys but also to execute menu items, (Most menu items point to the same action as a hotkey but not all)
Definition at line 43 of file command_executor.hpp.
|
inline |
Definition at line 56 of file command_executor.hpp.
|
inlineexplicit |
Definition at line 62 of file command_executor.hpp.
|
inlineexplicit |
Definition at line 67 of file command_executor.hpp.
hotkey::HOTKEY_COMMAND hotkey::ui_command::hotkey_command |
The hotkey::HOTKEY_COMMAND associated with this action, HOTKEY_NULL for actions that don't allow hotkey binding.
different actions of the ame type might have the same HOTKEY_COMMAND (like different wml menu items that allow hotkey bindings.). This is preferred to be used for comparision over id (for example being an enum makes it impossible to make typos in the id and its faster, plus c++ unfortunately doesn't allow switch statements with strings)
Definition at line 50 of file command_executor.hpp.
Referenced by replay_controller::can_execute_command(), playsingle_controller::hotkey_handler::can_execute_command(), editor::editor_controller::can_execute_command(), play_controller::hotkey_handler::can_execute_command(), playmp_controller::hotkey_handler::can_execute_command(), hotkey::command_executor::do_execute_command(), editor::editor_controller::do_execute_command(), play_controller::hotkey_handler::get_action_state(), playsingle_controller::hotkey_handler::get_action_state(), editor::editor_controller::get_action_state(), and play_controller::hotkey_handler::in_context_menu().
std::string hotkey::ui_command::id |
The string command, never empty, describes the action uniquely.
when the action is the result of a menu click this matches the id element of the clicked item (the id parameter of show_menu)
Definition at line 53 of file command_executor.hpp.
Referenced by playsingle_controller::hotkey_handler::can_execute_command(), and play_controller::hotkey_handler::do_execute_command().
int hotkey::ui_command::index |
When this action was the result of a menu click, this is the index of the clicked item in the menu.
Definition at line 55 of file command_executor.hpp.
Referenced by editor::editor_controller::can_execute_command(), editor::editor_controller::do_execute_command(), and editor::editor_controller::get_action_state().