The editor_controller class contains the mouse and keyboard event handling routines for the editor. More...
#include <editor_controller.hpp>
Public Member Functions | |
editor_controller (const editor_controller &)=delete | |
editor_controller & | operator= (const editor_controller &)=delete |
editor_controller (bool clear_id) | |
The constructor. More... | |
~editor_controller () | |
EXIT_STATUS | main_loop () |
Editor main loop. More... | |
void | do_screenshot (const std::string &screenshot_filename="map_screenshot.png") |
Takes a screenshot. More... | |
bool | quit_confirm () |
Show a quit confirmation dialog and returns true if the user pressed 'yes'. More... | |
void | custom_tods_dialog () |
Display the settings dialog, used to control e.g. More... | |
void | save_map () override |
Save the map, open dialog if not named yet. More... | |
bool | can_execute_command (const hotkey::ui_command &command) const override |
command_executor override More... | |
hotkey::ACTION_STATE | get_action_state (const hotkey::ui_command &command) const override |
command_executor override More... | |
bool | do_execute_command (const hotkey::ui_command &command, bool press=true, bool release=false) override |
command_executor override More... | |
void | show_menu (const std::vector< config > &items_arg, int xloc, int yloc, bool context_menu, display &disp) override |
controller_base override More... | |
void | show_help () override |
void | status_table () override |
void | preferences () override |
Show the preferences dialog. More... | |
void | scroll_up (bool on) override |
Handle hotkeys to scroll map. More... | |
void | scroll_down (bool on) override |
void | scroll_left (bool on) override |
void | scroll_right (bool on) override |
void | toggle_grid () override |
Grid toggle. More... | |
void | terrain_description () override |
void | unit_description () override |
void | change_unit_id () |
void | rename_unit () override |
void | unit_list () override |
void | copy_selection () |
Copy the selection on the current map to the clipboard. More... | |
void | cut_selection () |
Cut the selection from the current map to the clipboard. More... | |
void | export_selection_coords () |
Export the WML-compatible list of selected tiles to the system clipboard. More... | |
void | save_area () |
Save the current selection to the active area. More... | |
void | add_area () |
Add a new area to the current context, filled with the selection if any. More... | |
void | mouse_motion (int x, int y, const bool browse, bool update, map_location new_loc=map_location::null_location()) override |
Called when a mouse motion event takes place. More... | |
void | touch_motion (int x, int y, const bool browse, bool update=false, map_location new_loc=map_location::null_location()) override |
editor_display & | gui () override |
Reference to the used display objects. More... | |
const editor_display & | gui () const override |
Const version of gui. More... | |
bool | allow_mouse_wheel_scroll (int x, int y) override |
Derived classes can override this to disable mousewheel scrolling under some circumstances, e.g. More... | |
bool | right_click_show_menu (int x, int y, const bool browse) override |
Called in the default right_click when the context menu is about to be shown, can be used for preprocessing and preventing the menu from being displayed without rewriting the right click function. More... | |
bool | left_click (int x, int y, const bool browse) override |
Overridden in derived classes, called on a left click (mousedown). More... | |
void | left_drag_end (int x, int y, const bool browse) override |
Called whenever the left mouse drag has "ended". More... | |
void | left_mouse_up (int x, int y, const bool browse) override |
Called when the left mouse button is up. More... | |
bool | right_click (int x, int y, const bool browse) override |
Overridden in derived classes, called on a right click (mousedown). More... | |
void | right_drag_end (int x, int y, const bool browse) override |
Called whenever the right mouse drag has "ended". More... | |
void | right_mouse_up (int x, int y, const bool browse) override |
Called when the right mouse button is up. More... | |
virtual hotkey::command_executor * | get_hotkey_command_executor () override |
Optionally get a command executor to handle context menu events. More... | |
map_context & | get_current_map_context () const |
![]() | |
controller_base () | |
virtual | ~controller_base () |
virtual void | play_slice (bool is_delay_enabled=true) |
void | apply_keyboard_scroll (int x, int y) |
void | set_scroll_up (bool on) |
void | set_scroll_down (bool on) |
void | set_scroll_left (bool on) |
void | set_scroll_right (bool on) |
![]() | |
virtual void | handle_window_event (const SDL_Event &) |
virtual void | process_event () |
virtual bool | requires_event_focus (const SDL_Event *=nullptr) const |
virtual void | process_tooltip_string (int, int) |
virtual void | join () |
virtual void | join (context &c) |
virtual void | join_same (sdl_handler *parent) |
virtual void | leave () |
virtual void | join_global () |
virtual void | leave_global () |
virtual bool | has_joined () |
virtual bool | has_joined_global () |
sdl_handler & | operator= (sdl_handler &&)=delete |
Moving would require two instances' context membership to be handled, it's simpler to delete these and require the two instances to be separately constructed / destructed. More... | |
sdl_handler (sdl_handler &&)=delete | |
![]() | |
pump_monitor () | |
virtual | ~pump_monitor () |
![]() | |
void | set_button_state () |
void | recalculate_minimap () |
void | lua_console () |
void | zoom_in () |
void | zoom_out () |
void | zoom_default () |
void | map_screenshot () |
void | quit_to_main_menu () |
![]() | |
virtual void | cycle_units () |
virtual void | cycle_back_units () |
virtual void | end_turn () |
virtual void | goto_leader () |
virtual void | unit_hold_position () |
virtual void | end_unit_turn () |
virtual void | save_game () |
virtual void | save_replay () |
virtual void | load_game () |
virtual void | toggle_ellipses () |
virtual void | recall () |
virtual void | recruit () |
virtual void | repeat_recruit () |
virtual void | speak () |
virtual void | whisper () |
virtual void | shout () |
virtual void | create_unit () |
virtual void | change_side () |
virtual void | kill_unit () |
virtual void | objectives () |
virtual void | show_statistics () |
virtual void | stop_network () |
virtual void | start_network () |
virtual void | label_terrain (bool) |
virtual void | clear_labels () |
virtual void | label_settings () |
virtual void | show_enemy_moves (bool) |
virtual void | toggle_shroud_updates () |
virtual void | update_shroud_now () |
virtual void | continue_move () |
virtual void | search () |
virtual void | show_chat_log () |
virtual void | user_command () |
virtual void | custom_command () |
virtual void | ai_formula () |
virtual void | clear_messages () |
virtual void | change_language () |
virtual void | play_replay () |
virtual void | reset_replay () |
virtual void | stop_replay () |
virtual void | replay_next_turn () |
virtual void | replay_next_side () |
virtual void | replay_next_move () |
virtual void | replay_show_everything () |
virtual void | replay_show_each () |
virtual void | replay_show_team1 () |
virtual void | replay_skip_animation () |
virtual void | replay_exit () |
virtual void | whiteboard_toggle () |
virtual void | whiteboard_execute_action () |
virtual void | whiteboard_execute_all_actions () |
virtual void | whiteboard_delete_action () |
virtual void | whiteboard_bump_up_action () |
virtual void | whiteboard_bump_down_action () |
virtual void | whiteboard_suppose_dead () |
virtual void | select_hex () |
virtual void | deselect_hex () |
virtual void | move_action () |
virtual void | select_and_action () |
virtual void | touch_hex () |
virtual void | left_mouse_click () |
virtual void | right_mouse_click () |
virtual void | toggle_accelerated_speed () |
virtual void | surrender_quit_game () |
virtual std::string | get_action_image (const hotkey::ui_command &) const |
std::string | get_menu_image (display &disp, const std::string &command, int index=-1) const |
void | get_menu_images (display &, std::vector< config > &items) |
void | surrender_game () |
void | execute_action (const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu, display &gui) |
void | queue_command (const SDL_Event &event, int index=-1) |
bool | run_queued_commands () |
void | execute_quit_command () |
void | handle_keyup () |
![]() | |
mouse_handler_base () | |
virtual | ~mouse_handler_base () |
bool | dragging_started () const |
If mouse/finger has moved far enough to consider it move/swipe, and not a click/touch. More... | |
bool | is_dragging () const |
virtual int | drag_threshold () const |
Minimum dragging distance to fire the drag&drop. More... | |
void | mouse_motion_event (const SDL_MouseMotionEvent &event, const bool browse) |
void | touch_motion_event (const SDL_TouchFingerEvent &event, const bool browse) |
void | mouse_update (const bool browse, map_location loc) |
Update the mouse with a fake mouse motion. More... | |
bool | get_show_menu () const |
bool | mouse_motion_default (int x, int y, bool update) |
This handles minimap scrolling and click-drag. More... | |
virtual void | mouse_press (const SDL_MouseButtonEvent &event, const bool browse) |
virtual bool | mouse_button_event (const SDL_MouseButtonEvent &event, uint8_t button, map_location loc, bool click=false) |
bool | is_left_click (const SDL_MouseButtonEvent &event) const |
bool | is_middle_click (const SDL_MouseButtonEvent &event) const |
bool | is_right_click (const SDL_MouseButtonEvent &event) const |
bool | is_touch_click (const SDL_MouseButtonEvent &event) const |
virtual void | mouse_wheel (int xscroll, int yscroll, bool browse) |
Called when scrolling with the mouse wheel. More... | |
virtual void | move_action (bool) |
Overridden in derived class. More... | |
virtual void | touch_action (const map_location hex, bool browse) |
virtual void | mouse_wheel_up (int, int, const bool) |
Called when the mouse wheel is scrolled up. More... | |
virtual void | mouse_wheel_down (int, int, const bool) |
Called when the mouse wheel is scrolled down. More... | |
virtual void | mouse_wheel_left (int, int, const bool) |
Called when the mouse wheel is scrolled left. More... | |
virtual void | mouse_wheel_right (int, int, const bool) |
Called when the mouse wheel is scrolled right. More... | |
void | set_scroll_start (int x, int y) |
Called when the middle click scrolling. More... | |
const SDL_Point | get_scroll_start () const |
bool | scroll_started () const |
Public Attributes | |
const std::unique_ptr< context_manager > | context_manager_ |
Static Public Attributes | |
static std::string | current_addon_id_ = "" |
Protected Member Functions | |
void | process_keyup_event (const SDL_Event &event) override |
Process keyup (always). More... | |
mouse_handler_base & | get_mouse_handler_base () override |
Get a reference to a mouse handler member a derived class uses. More... | |
editor_display & | get_display () override |
Get a reference to a display member a derived class uses. More... | |
const mouse_action & | get_mouse_action () const |
Get the current mouse action. More... | |
mouse_action & | get_mouse_action () |
Get the current mouse action. More... | |
void | perform_delete (std::unique_ptr< editor_action > action) |
Perform an action, then delete the action object. More... | |
void | perform_refresh_delete (std::unique_ptr< editor_action > action, bool drag_part=false) |
Peform an action on the current map_context, then refresh the display and delete the pointer. More... | |
virtual std::vector< std::string > | additional_actions_pressed () override |
![]() | |
virtual bool | is_browsing () const |
virtual soundsource::manager * | get_soundsource_man () |
Get (optionally) a soundsources manager a derived class uses. More... | |
virtual plugins_context * | get_plugins_context () |
Get (optionally) a plugins context a derived class uses. More... | |
virtual bool | have_keyboard_focus () |
Derived classes should override this to return false when arrow keys should not scroll the map, hotkeys not processed etc, for example when a textbox is active. More... | |
bool | handle_scroll (int mousex, int mousey, int mouse_flags) |
Handle scrolling by keyboard, joystick and moving mouse near map edges. More... | |
void | handle_event (const SDL_Event &event) override |
Process mouse- and keypress-events from SDL. More... | |
virtual void | process_focus_keydown_event (const SDL_Event &) |
Process keydown (only when the general map display does not have focus). More... | |
virtual void | process (events::pump_info &) override |
virtual void | process_keydown_event (const SDL_Event &) |
Process keydown (always). More... | |
virtual void | execute_action (const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu) |
virtual bool | in_context_menu (const hotkey::ui_command &cmd) const |
void | long_touch_callback (int x, int y) |
![]() | |
sdl_handler (const bool auto_join=true) | |
sdl_handler (const sdl_handler &) | |
sdl_handler & | operator= (const sdl_handler &) |
virtual | ~sdl_handler () |
virtual std::vector< sdl_handler * > | handler_members () |
![]() | |
virtual | ~command_executor () |
![]() | |
void | cancel_dragging () |
void | clear_dragging (const SDL_MouseButtonEvent &event, bool browse) |
void | clear_drag_from_hex () |
void | init_dragging (bool &dragging_flag) |
Private Types | |
typedef std::map< std::string, std::pair< std::string,std::vector< time_of_day > > > | tods_map |
Pre-defined time of day lighting settings for the settings dialog. More... | |
Private Member Functions | |
void | init_gui () |
init the display object and general set-up More... | |
void | init_tods (const game_config_view &game_config) |
init the available time-of-day settings More... | |
void | init_music (const game_config_view &game_config) |
init background music for the editor More... | |
void | refresh_image_cache () |
Reload images. More... | |
void | display_redraw_callback (display &) |
Callback function passed to display to be called on queue_rerender. More... | |
void | undo () override |
Undos an action in the current map context. More... | |
void | redo () override |
Redos an action in the current map context. More... | |
![]() | |
quit_confirmation (const std::function< bool()> &prompt=&quit_confirmation::default_prompt) | |
~quit_confirmation () | |
Private Attributes | |
editor::menu_type | active_menu_ |
const std::unique_ptr< reports > | reports_ |
Reports object. More... | |
const std::unique_ptr< editor_display > | gui_ |
The display object used and owned by the editor. More... | |
tods_map | tods_ |
std::unique_ptr< editor_toolkit > | toolkit_ |
tooltips::manager | tooltip_manager_ |
std::unique_ptr< font::floating_label_context > | floating_label_manager_ |
std::unique_ptr< help::help_manager > | help_manager_ |
bool | do_quit_ |
Quit main loop flag. More... | |
EXIT_STATUS | quit_mode_ |
std::vector< sound::music_track > | music_tracks_ |
Additional Inherited Members | |
![]() | |
const game_config_view & | game_config_ |
CKey | key_ |
bool | scrolling_ |
bool | scroll_up_ |
bool | scroll_down_ |
bool | scroll_left_ |
bool | scroll_right_ |
uint32_t | last_scroll_tick_ |
double | scroll_carry_x_ |
double | scroll_carry_y_ |
![]() | |
bool | simple_warp_ |
MMB click (on game map) state flag. More... | |
bool | minimap_scrolling_ |
minimap scrolling (scroll-drag) state flag More... | |
bool | dragging_left_ |
LMB drag init flag. More... | |
bool | dragging_touch_ |
Finger drag init flag. More... | |
bool | dragging_started_ |
Actual drag flag. More... | |
bool | dragging_right_ |
RMB drag init flag. More... | |
int | drag_from_x_ |
Drag start position x. More... | |
int | drag_from_y_ |
Drag start position y. More... | |
map_location | drag_from_hex_ |
Drag start or mouse-down map location. More... | |
map_location | last_hex_ |
last highlighted hex More... | |
bool | show_menu_ |
Show context menu flag. More... | |
int | scroll_start_x_ |
Relative to middle click scrolling. More... | |
int | scroll_start_y_ |
bool | scroll_started_ |
![]() | |
static bool | quit () |
Shows the quit confirmation if needed. More... | |
static void | quit_to_title () |
static void | quit_to_desktop () |
static bool | show_prompt (const std::string &message) |
static bool | default_prompt () |
The editor_controller class contains the mouse and keyboard event handling routines for the editor.
It also serves as the main editor class with the general logic.
Definition at line 67 of file editor_controller.hpp.
|
private |
Pre-defined time of day lighting settings for the settings dialog.
Definition at line 236 of file editor_controller.hpp.
|
delete |
editor::editor_controller::editor_controller | ( | bool | clear_id | ) |
The constructor.
A initial map context can be specified here, the controller will assume ownership and delete the pointer during destruction, but changes to the map can be retrieved between the main loop's end and the controller's destruction.
Definition at line 69 of file editor_controller.cpp.
References context_manager_, current_addon_id_, controller_base::game_config_, get_current_map_context(), gui(), gui_, help_manager_, init_gui(), init_music(), init_tods(), controller_base::key_, cursor::NORMAL, display::queue_rerender(), cursor::set(), editor::map_context::set_starting_position_labels(), and toolkit_.
editor::editor_controller::~editor_controller | ( | ) |
Definition at line 171 of file editor_controller.cpp.
References resources::classification, resources::filter_con, and resources::tod_manager.
void editor::editor_controller::add_area | ( | ) |
Add a new area to the current context, filled with the selection if any.
Definition at line 1243 of file editor_controller.cpp.
References get_current_map_context(), editor::map_context::map(), editor::map_context::new_area(), and editor::editor_map::selection().
Referenced by do_execute_command().
|
overrideprotectedvirtual |
Reimplemented from controller_base.
Definition at line 1471 of file editor_controller.cpp.
References toolkit_.
|
overridevirtual |
Derived classes can override this to disable mousewheel scrolling under some circumstances, e.g.
when the mouse wheel controls something else, but the event is also received by this class
Reimplemented from events::mouse_handler_base.
Definition at line 1346 of file editor_controller.cpp.
References get_current_map_context(), gui(), editor::map_context::map(), and gamemap_base::on_board_with_border().
|
overridevirtual |
command_executor override
Implements hotkey::command_executor.
Definition at line 244 of file editor_controller.cpp.
References active_menu_, editor::ADDON, editor::AREA, editor::map_context::can_redo(), editor::map_context::can_undo(), context_manager_, unit_map::empty(), unit_map::end(), editor::editor_map::everything_selected(), unit_map::find(), tod_manager::get_area_ids(), get_current_map_context(), editor::map_context::get_filename(), get_mouse_action(), editor::map_context::get_time_manager(), gui(), gui_, hotkey::HOTKEY_ANIMATE_MAP, hotkey::ui_command::hotkey_command, hotkey::HOTKEY_DELETE_UNIT, hotkey::HOTKEY_EDITOR_AREA_ADD, hotkey::HOTKEY_EDITOR_AREA_REMOVE, hotkey::HOTKEY_EDITOR_AREA_RENAME, hotkey::HOTKEY_EDITOR_AREA_SAVE, hotkey::HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_BRUSH_1, hotkey::HOTKEY_EDITOR_BRUSH_2, hotkey::HOTKEY_EDITOR_BRUSH_3, hotkey::HOTKEY_EDITOR_BRUSH_NEXT, hotkey::HOTKEY_EDITOR_BRUSH_NW_SE, hotkey::HOTKEY_EDITOR_BRUSH_SW_NE, hotkey::HOTKEY_EDITOR_CHANGE_ADDON_ID, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_HORIZONTAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_VERTICAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_PASTE, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CCW, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CW, hotkey::HOTKEY_EDITOR_CUSTOM_TODS, hotkey::HOTKEY_EDITOR_DRAW_COORDINATES, hotkey::HOTKEY_EDITOR_DRAW_NUM_OF_BITMAPS, hotkey::HOTKEY_EDITOR_DRAW_TERRAIN_CODES, hotkey::HOTKEY_EDITOR_LOCAL_TIME, hotkey::HOTKEY_EDITOR_MAP_APPLY_MASK, hotkey::HOTKEY_EDITOR_MAP_CLOSE, hotkey::HOTKEY_EDITOR_MAP_CREATE_MASK_TO, hotkey::HOTKEY_EDITOR_MAP_GENERATE, hotkey::HOTKEY_EDITOR_MAP_LOAD, hotkey::HOTKEY_EDITOR_MAP_NEW, hotkey::HOTKEY_EDITOR_MAP_RESIZE, hotkey::HOTKEY_EDITOR_MAP_REVERT, hotkey::HOTKEY_EDITOR_MAP_SAVE, hotkey::HOTKEY_EDITOR_MAP_SAVE_ALL, hotkey::HOTKEY_EDITOR_MAP_SAVE_AS, hotkey::HOTKEY_EDITOR_MAP_SWITCH, hotkey::HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_PALETTE_DOWNSCROLL, hotkey::HOTKEY_EDITOR_PALETTE_GROUPS, hotkey::HOTKEY_EDITOR_PALETTE_ITEM_SWAP, hotkey::HOTKEY_EDITOR_PALETTE_UPSCROLL, hotkey::HOTKEY_EDITOR_PARTIAL_UNDO, hotkey::HOTKEY_EDITOR_PARTIAL_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_PBL, hotkey::HOTKEY_EDITOR_PLAYLIST, hotkey::HOTKEY_EDITOR_REFRESH, hotkey::HOTKEY_EDITOR_REFRESH_IMAGE_CACHE, hotkey::HOTKEY_EDITOR_REMOVE_LOCATION, hotkey::HOTKEY_EDITOR_SCENARIO_EDIT, hotkey::HOTKEY_EDITOR_SCENARIO_NEW, hotkey::HOTKEY_EDITOR_SCENARIO_SAVE_AS, hotkey::HOTKEY_EDITOR_SCHEDULE, hotkey::HOTKEY_EDITOR_SELECT_ALL, hotkey::HOTKEY_EDITOR_SELECT_INVERSE, hotkey::HOTKEY_EDITOR_SELECT_NONE, hotkey::HOTKEY_EDITOR_SELECTION_COPY, hotkey::HOTKEY_EDITOR_SELECTION_CUT, hotkey::HOTKEY_EDITOR_SELECTION_EXPORT, hotkey::HOTKEY_EDITOR_SELECTION_FILL, hotkey::HOTKEY_EDITOR_SELECTION_FLIP, hotkey::HOTKEY_EDITOR_SELECTION_RANDOMIZE, hotkey::HOTKEY_EDITOR_SELECTION_ROTATE, hotkey::HOTKEY_EDITOR_SIDE_EDIT, hotkey::HOTKEY_EDITOR_SIDE_NEW, hotkey::HOTKEY_EDITOR_SIDE_REMOVE, hotkey::HOTKEY_EDITOR_TOOL_FILL, hotkey::HOTKEY_EDITOR_TOOL_ITEM, hotkey::HOTKEY_EDITOR_TOOL_LABEL, hotkey::HOTKEY_EDITOR_TOOL_NEXT, hotkey::HOTKEY_EDITOR_TOOL_PAINT, hotkey::HOTKEY_EDITOR_TOOL_SELECT, hotkey::HOTKEY_EDITOR_TOOL_STARTING_POSITION, hotkey::HOTKEY_EDITOR_TOOL_UNIT, hotkey::HOTKEY_EDITOR_TOOL_VILLAGE, hotkey::HOTKEY_EDITOR_UNIT_CHANGE_ID, hotkey::HOTKEY_EDITOR_UNIT_FACING, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_CANRECRUIT, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_LOYAL, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_RENAMEABLE, hotkey::HOTKEY_EDITOR_UPDATE_TRANSITIONS, hotkey::HOTKEY_FULLSCREEN, hotkey::HOTKEY_HELP, hotkey::HOTKEY_MAP_SCREENSHOT, hotkey::HOTKEY_MINIMAP_CODING_TERRAIN, hotkey::HOTKEY_MINIMAP_CODING_UNIT, hotkey::HOTKEY_MINIMAP_DRAW_TERRAIN, hotkey::HOTKEY_MINIMAP_DRAW_UNITS, hotkey::HOTKEY_MINIMAP_DRAW_VILLAGES, hotkey::HOTKEY_MOUSE_SCROLL, hotkey::HOTKEY_MUTE, hotkey::HOTKEY_NULL, hotkey::HOTKEY_PREFERENCES, hotkey::HOTKEY_QUIT_GAME, hotkey::HOTKEY_QUIT_TO_DESKTOP, hotkey::HOTKEY_REDO, hotkey::HOTKEY_RENAME_UNIT, hotkey::HOTKEY_SCREENSHOT, hotkey::HOTKEY_SCROLL_DOWN, hotkey::HOTKEY_SCROLL_LEFT, hotkey::HOTKEY_SCROLL_RIGHT, hotkey::HOTKEY_SCROLL_UP, hotkey::HOTKEY_STATUS_TABLE, hotkey::HOTKEY_TERRAIN_DESCRIPTION, hotkey::HOTKEY_TOGGLE_GRID, hotkey::HOTKEY_UNDO, hotkey::HOTKEY_UNIT_DESCRIPTION, hotkey::HOTKEY_UNIT_LIST, hotkey::HOTKEY_ZOOM_DEFAULT, hotkey::HOTKEY_ZOOM_IN, hotkey::HOTKEY_ZOOM_OUT, i, hotkey::ui_command::index, utf8::index(), editor::map_context::is_pure_map(), editor::LOAD_MRU, editor::LOCAL_SCHEDULE, editor::LOCAL_TIME, editor::MAP, editor::map_context::map(), editor::map_context::modified(), display::mouseover_hex(), editor::MUSIC, editor::PALETTE, editor::SCHEDULE, editor::editor_map::selection(), editor::SIDE, utf8::size(), editor::mouse_action::supports_brushes(), editor::map_context::teams(), editor::TIME, hotkey::TITLE_SCREEN__RELOAD_WML, toolkit_, editor::UNIT_FACING, editor::map_context::units(), and map_location::valid().
Referenced by show_menu().
void editor::editor_controller::change_unit_id | ( | ) |
Definition at line 1191 of file editor_controller.cpp.
References unit_map::end(), unit_map::find(), get_current_map_context(), gui_, label, N_, and editor::map_context::units().
Referenced by do_execute_command().
void editor::editor_controller::copy_selection | ( | ) |
Copy the selection on the current map to the clipboard.
Definition at line 1183 of file editor_controller.cpp.
References context_manager_, and get_current_map_context().
Referenced by cut_selection(), and do_execute_command().
void editor::editor_controller::custom_tods_dialog | ( | ) |
Display the settings dialog, used to control e.g.
the lighting settings
Definition at line 226 of file editor_controller.cpp.
References _(), context_manager_, get_current_map_context(), tod_manager::get_current_time(), editor::map_context::get_time_manager(), gui_, gui2::show_error_message(), tod_manager::times(), and tods_.
Referenced by do_execute_command().
void editor::editor_controller::cut_selection | ( | ) |
Cut the selection from the current map to the clipboard.
Definition at line 1231 of file editor_controller.cpp.
References context_manager_, copy_selection(), get_current_map_context(), and editor::get_selected_bg_terrain().
Referenced by do_execute_command().
|
private |
Callback function passed to display to be called on queue_rerender.
Redraws toolbar, brush bar and related items.
Definition at line 1287 of file editor_controller.cpp.
References get_current_map_context(), editor::map_context::get_labels(), map_labels::recalculate_labels(), hotkey::command_executor_default::set_button_state(), and toolkit_.
Referenced by init_gui().
|
overridevirtual |
command_executor override
Reimplemented from hotkey::command_executor.
Definition at line 602 of file editor_controller.cpp.
References active_menu_, add_area(), editor::map_context::add_to_playlist(), editor::ADDON, editor::AREA, b, change_unit_id(), context_manager_, copy_selection(), current_addon_id_, custom_tods_dialog(), cut_selection(), display::DEBUG_COORDINATES, display::DEBUG_NUM_BITMAPS, display::DEBUG_TERRAIN_CODES, hotkey::command_executor::do_execute_command(), do_quit_, editor::EXIT_NORMAL, editor::EXIT_RELOAD_DATA, export_selection_coords(), unit_map::find(), tod_manager::get_area_by_index(), get_current_map_context(), editor::map_context::get_labels(), editor::map_context::get_time_manager(), gui(), gui_, hotkey::ui_command::hotkey_command, hotkey::HOTKEY_DELETE_UNIT, hotkey::HOTKEY_EDITOR_AREA_ADD, hotkey::HOTKEY_EDITOR_AREA_REMOVE, hotkey::HOTKEY_EDITOR_AREA_RENAME, hotkey::HOTKEY_EDITOR_AREA_SAVE, hotkey::HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_BRUSH_1, hotkey::HOTKEY_EDITOR_BRUSH_2, hotkey::HOTKEY_EDITOR_BRUSH_3, hotkey::HOTKEY_EDITOR_BRUSH_NEXT, hotkey::HOTKEY_EDITOR_BRUSH_NW_SE, hotkey::HOTKEY_EDITOR_BRUSH_SW_NE, hotkey::HOTKEY_EDITOR_CHANGE_ADDON_ID, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_HORIZONTAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_VERTICAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_PASTE, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CCW, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CW, hotkey::HOTKEY_EDITOR_CUSTOM_TODS, hotkey::HOTKEY_EDITOR_DRAW_COORDINATES, hotkey::HOTKEY_EDITOR_DRAW_NUM_OF_BITMAPS, hotkey::HOTKEY_EDITOR_DRAW_TERRAIN_CODES, hotkey::HOTKEY_EDITOR_MAP_APPLY_MASK, hotkey::HOTKEY_EDITOR_MAP_CLOSE, hotkey::HOTKEY_EDITOR_MAP_CREATE_MASK_TO, hotkey::HOTKEY_EDITOR_MAP_GENERATE, hotkey::HOTKEY_EDITOR_MAP_LOAD, hotkey::HOTKEY_EDITOR_MAP_NEW, hotkey::HOTKEY_EDITOR_MAP_RESIZE, hotkey::HOTKEY_EDITOR_MAP_REVERT, hotkey::HOTKEY_EDITOR_MAP_SAVE, hotkey::HOTKEY_EDITOR_MAP_SAVE_ALL, hotkey::HOTKEY_EDITOR_MAP_SAVE_AS, hotkey::HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_PALETTE_DOWNSCROLL, hotkey::HOTKEY_EDITOR_PALETTE_GROUPS, hotkey::HOTKEY_EDITOR_PALETTE_ITEM_SWAP, hotkey::HOTKEY_EDITOR_PALETTE_UPSCROLL, hotkey::HOTKEY_EDITOR_PARTIAL_UNDO, hotkey::HOTKEY_EDITOR_PARTIAL_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_PBL, hotkey::HOTKEY_EDITOR_REFRESH, hotkey::HOTKEY_EDITOR_REFRESH_IMAGE_CACHE, hotkey::HOTKEY_EDITOR_REMOVE_LOCATION, hotkey::HOTKEY_EDITOR_SCENARIO_EDIT, hotkey::HOTKEY_EDITOR_SCENARIO_NEW, hotkey::HOTKEY_EDITOR_SCENARIO_SAVE_AS, hotkey::HOTKEY_EDITOR_SELECT_ALL, hotkey::HOTKEY_EDITOR_SELECT_INVERSE, hotkey::HOTKEY_EDITOR_SELECT_NONE, hotkey::HOTKEY_EDITOR_SELECTION_COPY, hotkey::HOTKEY_EDITOR_SELECTION_CUT, hotkey::HOTKEY_EDITOR_SELECTION_EXPORT, hotkey::HOTKEY_EDITOR_SELECTION_FILL, hotkey::HOTKEY_EDITOR_SELECTION_RANDOMIZE, hotkey::HOTKEY_EDITOR_SIDE_EDIT, hotkey::HOTKEY_EDITOR_SIDE_NEW, hotkey::HOTKEY_EDITOR_SIDE_REMOVE, hotkey::HOTKEY_EDITOR_TOGGLE_TRANSITIONS, hotkey::HOTKEY_EDITOR_TOOL_FILL, hotkey::HOTKEY_EDITOR_TOOL_ITEM, hotkey::HOTKEY_EDITOR_TOOL_LABEL, hotkey::HOTKEY_EDITOR_TOOL_PAINT, hotkey::HOTKEY_EDITOR_TOOL_SELECT, hotkey::HOTKEY_EDITOR_TOOL_STARTING_POSITION, hotkey::HOTKEY_EDITOR_TOOL_UNIT, hotkey::HOTKEY_EDITOR_TOOL_VILLAGE, hotkey::HOTKEY_EDITOR_UNIT_CHANGE_ID, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_CANRECRUIT, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_RENAMEABLE, hotkey::HOTKEY_EDITOR_UPDATE_TRANSITIONS, hotkey::HOTKEY_NULL, hotkey::HOTKEY_QUIT_GAME, hotkey::HOTKEY_QUIT_TO_DESKTOP, hotkey::HOTKEY_ZOOM_DEFAULT, hotkey::HOTKEY_ZOOM_IN, hotkey::HOTKEY_ZOOM_OUT, i, hotkey::ui_command::index, utf8::index(), editor::initialize_addon(), display::invalidate_all(), mp::ui_alerts::items, editor::LOAD_MRU, editor::LOCAL_SCHEDULE, editor::LOCAL_TIME, editor::MAP, editor::MUSIC, music_tracks_, editor::map_context::new_side(), editor::PALETTE, editor::map_context::partial_undo(), perform_delete(), sound::play_music_once(), quit_confirmation::quit(), quit_mode_, quit_confirmation::quit_to_desktop(), map_labels::recalculate_labels(), refresh_image_cache(), editor::map_context::remove_area(), editor::map_context::remove_side(), editor::map_context::replace_local_schedule(), editor::map_context::replace_schedule(), save_area(), save_map(), editor::SCHEDULE, SCOPE_ED, editor::map_context::select_area(), editor::location_palette::selected_item(), editor::map_context::set_active_area(), preferences::editor::set_draw_hex_coordinates(), preferences::editor::set_draw_num_of_bitmaps(), preferences::editor::set_draw_terrain_codes(), editor::map_context::set_local_starting_time(), editor::map_context::set_starting_time(), show_menu(), editor::SIDE, utf8::size(), editor::map_context::teams(), editor::TIME, hotkey::TITLE_SCREEN__RELOAD_WML, tods_, display::toggle_debug_flag(), toolkit_, undo(), editor::UNIT_FACING, and editor::map_context::units().
void editor::editor_controller::do_screenshot | ( | const std::string & | screenshot_filename = "map_screenshot.png" | ) |
Takes a screenshot.
Definition at line 197 of file editor_controller.cpp.
References e, ERR_ED, gui(), image::save_image(), display::screenshot(), and image::success.
void editor::editor_controller::export_selection_coords | ( | ) |
Export the WML-compatible list of selected tiles to the system clipboard.
Definition at line 1249 of file editor_controller.cpp.
References desktop::clipboard::copy_to_clipboard(), get_current_map_context(), i, editor::map_context::map(), and editor::editor_map::selection().
Referenced by do_execute_command().
|
overridevirtual |
command_executor override
Reimplemented from hotkey::command_executor.
Definition at line 461 of file editor_controller.cpp.
References hotkey::ACTION_DESELECTED, hotkey::ACTION_OFF, hotkey::ACTION_ON, hotkey::ACTION_SELECTED, hotkey::ACTION_STATELESS, active_menu_, editor::ADDON, editor::AREA, context_manager_, display::DEBUG_COORDINATES, display::DEBUG_NUM_BITMAPS, display::DEBUG_TERRAIN_CODES, editor::editor_map::everything_selected(), unit_map::find(), editor::map_context::get_active_area(), tod_manager::get_current_area_time(), get_current_map_context(), tod_manager::get_current_time(), editor::map_context::get_time_manager(), preferences::grid(), gui_, hotkey::ui_command::hotkey_command, hotkey::HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_BRUSH_1, hotkey::HOTKEY_EDITOR_BRUSH_2, hotkey::HOTKEY_EDITOR_BRUSH_3, hotkey::HOTKEY_EDITOR_BRUSH_NW_SE, hotkey::HOTKEY_EDITOR_BRUSH_SW_NE, hotkey::HOTKEY_EDITOR_CLIPBOARD_PASTE, hotkey::HOTKEY_EDITOR_DRAW_COORDINATES, hotkey::HOTKEY_EDITOR_DRAW_NUM_OF_BITMAPS, hotkey::HOTKEY_EDITOR_DRAW_TERRAIN_CODES, hotkey::HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_PARTIAL_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_SELECT_ALL, hotkey::HOTKEY_EDITOR_SELECT_NONE, hotkey::HOTKEY_EDITOR_TOOL_FILL, hotkey::HOTKEY_EDITOR_TOOL_ITEM, hotkey::HOTKEY_EDITOR_TOOL_LABEL, hotkey::HOTKEY_EDITOR_TOOL_PAINT, hotkey::HOTKEY_EDITOR_TOOL_SELECT, hotkey::HOTKEY_EDITOR_TOOL_STARTING_POSITION, hotkey::HOTKEY_EDITOR_TOOL_UNIT, hotkey::HOTKEY_EDITOR_TOOL_VILLAGE, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_CANRECRUIT, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_LOYAL, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_RENAMEABLE, hotkey::HOTKEY_MINIMAP_CODING_TERRAIN, hotkey::HOTKEY_MINIMAP_CODING_UNIT, hotkey::HOTKEY_MINIMAP_DRAW_TERRAIN, hotkey::HOTKEY_MINIMAP_DRAW_UNITS, hotkey::HOTKEY_MINIMAP_DRAW_VILLAGES, hotkey::HOTKEY_NULL, hotkey::HOTKEY_TOGGLE_GRID, hotkey::HOTKEY_ZOOM_DEFAULT, hotkey::ui_command::index, utf8::index(), editor::map_context::is_in_playlist(), editor::LOAD_MRU, editor::LOCAL_SCHEDULE, editor::LOCAL_TIME, editor::MAP, editor::map_context::map(), preferences::minimap_draw_terrain(), preferences::minimap_draw_units(), preferences::minimap_draw_villages(), preferences::minimap_movement_coding(), preferences::minimap_terrain_coding(), editor::MUSIC, music_tracks_, editor::PALETTE, editor::SCHEDULE, editor::editor_map::selection(), editor::SIDE, editor::TIME, tod_manager::times(), tods_, toolkit_, editor::UNIT_FACING, and editor::map_context::units().
|
inline |
Definition at line 166 of file editor_controller.hpp.
References context_manager_.
Referenced by add_area(), allow_mouse_wheel_scroll(), can_execute_command(), change_unit_id(), copy_selection(), custom_tods_dialog(), cut_selection(), display_redraw_callback(), do_execute_command(), editor::mouse_action_map_label::drag_end_left(), editor_controller(), export_selection_coords(), get_action_state(), editor::editor_display::get_overlays(), editor::editor_display::get_time_of_day(), init_gui(), left_click(), mouse_motion(), perform_delete(), quit_confirm(), redo(), rename_unit(), right_click(), save_area(), show_menu(), terrain_description(), undo(), unit_description(), and editor::mouse_action_map_label::up_left().
|
inlineoverrideprotectedvirtual |
Get a reference to a display member a derived class uses.
Implements controller_base.
Definition at line 175 of file editor_controller.hpp.
References gui_.
|
overridevirtual |
Optionally get a command executor to handle context menu events.
Reimplemented from controller_base.
Definition at line 1447 of file editor_controller.cpp.
|
inlineprotected |
Get the current mouse action.
Definition at line 180 of file editor_controller.hpp.
References toolkit_.
|
inlineprotected |
Get the current mouse action.
Definition at line 178 of file editor_controller.hpp.
References toolkit_.
Referenced by can_execute_command(), left_click(), left_drag_end(), left_mouse_up(), mouse_motion(), process_keyup_event(), right_click(), right_click_show_menu(), right_drag_end(), and right_mouse_up().
|
inlineoverrideprotectedvirtual |
Get a reference to a mouse handler member a derived class uses.
Implements controller_base.
Definition at line 174 of file editor_controller.hpp.
|
inlineoverridevirtual |
Const version of gui.
Implements events::mouse_handler_base.
Definition at line 154 of file editor_controller.hpp.
References gui_.
|
inlineoverridevirtual |
Reference to the used display objects.
Derived classes should ensure this is always valid. Note the constructor of this class cannot use this.
Implements events::mouse_handler_base.
Definition at line 153 of file editor_controller.hpp.
References gui_.
Referenced by allow_mouse_wheel_scroll(), can_execute_command(), do_execute_command(), do_screenshot(), editor_controller(), init_gui(), left_click(), mouse_motion(), process_keyup_event(), right_click(), show_menu(), and terrain_description().
|
private |
init the display object and general set-up
Definition at line 103 of file editor_controller.cpp.
References display::DEBUG_COORDINATES, display::DEBUG_NUM_BITMAPS, display::DEBUG_TERRAIN_CODES, display_redraw_callback(), preferences::editor::draw_hex_coordinates(), preferences::editor::draw_num_of_bitmaps(), preferences::editor::draw_terrain_codes(), floating_label_manager_, get_current_map_context(), gui(), gui_, and display::set_debug_flag().
Referenced by editor_controller().
|
private |
init background music for the editor
Definition at line 152 of file editor_controller.cpp.
References config::child_range(), ERR_ED, sound::music_track::file_path(), sound::music_track::id(), music_tracks_, and WRN_ED.
Referenced by editor_controller().
|
private |
init the available time-of-day settings
Definition at line 119 of file editor_controller.cpp.
References config::child_range(), ERR_ED, and tods_.
Referenced by editor_controller().
|
overridevirtual |
Overridden in derived classes, called on a left click (mousedown).
Defaults to process (initiate) minimap scrolling.
Reimplemented from events::mouse_handler_base.
Definition at line 1356 of file editor_controller.cpp.
References a, editor::mouse_action::click_left(), get_current_map_context(), get_mouse_action(), gui(), gui_, display::hex_clicked_on(), LOG_ED, perform_refresh_delete(), hotkey::command_executor_default::set_button_state(), and toolkit_.
|
overridevirtual |
Called whenever the left mouse drag has "ended".
Reimplemented from events::mouse_handler_base.
Definition at line 1377 of file editor_controller.cpp.
References a, editor::mouse_action::drag_end_left(), get_mouse_action(), gui_, and perform_delete().
|
overridevirtual |
Called when the left mouse button is up.
Reimplemented from events::mouse_handler_base.
Definition at line 1383 of file editor_controller.cpp.
References a, context_manager_, get_mouse_action(), gui_, perform_delete(), hotkey::command_executor_default::set_button_state(), toolkit_, and editor::mouse_action::up_left().
EXIT_STATUS editor::editor_controller::main_loop | ( | ) |
Editor main loop.
Definition at line 179 of file editor_controller.cpp.
References _(), do_quit_, e, editor::EXIT_ERROR, controller_base::play_slice(), quit_mode_, and gui2::show_transient_message().
|
overridevirtual |
Called when a mouse motion event takes place.
Derived classes must provide an implementation, possibly using mouse_motion_default().
Implements events::mouse_handler_base.
Definition at line 1306 of file editor_controller.cpp.
References a, context_manager_, events::mouse_handler_base::drag_from_hex_, editor::mouse_action::drag_left(), editor::mouse_action::drag_right(), events::mouse_handler_base::dragging_left_, events::mouse_handler_base::dragging_right_, get_current_map_context(), get_mouse_action(), sdl::get_mouse_button_mask(), gui(), gui_, display::hex_clicked_on(), display::highlight_hex(), events::mouse_handler_base::is_dragging(), editor::map_context::last_undo_action(), editor::mouse_action::move(), partial, editor::map_context::perform_action(), editor::map_context::perform_partial_action(), and draw_manager::update().
|
delete |
|
protected |
Perform an action, then delete the action object.
The pointer can be nullptr, in which case nothing will happen.
Definition at line 1267 of file editor_controller.cpp.
References get_current_map_context(), and editor::map_context::perform_action().
Referenced by do_execute_command(), left_drag_end(), left_mouse_up(), right_drag_end(), and right_mouse_up().
|
protected |
Peform an action on the current map_context, then refresh the display and delete the pointer.
The pointer can be nullptr, in which case nothing will happen.
Definition at line 1274 of file editor_controller.cpp.
References context_manager_.
Referenced by left_click(), process_keyup_event(), and right_click().
|
overridevirtual |
Show the preferences dialog.
Reimplemented from hotkey::command_executor.
Definition at line 1156 of file editor_controller.cpp.
References gui_.
|
overrideprotectedvirtual |
Process keyup (always).
Reimplemented from controller_base.
Definition at line 1440 of file editor_controller.cpp.
References a, get_mouse_action(), gui(), editor::mouse_action::key_event(), perform_refresh_delete(), and toolkit_.
bool editor::editor_controller::quit_confirm | ( | ) |
Show a quit confirmation dialog and returns true if the user pressed 'yes'.
Definition at line 209 of file editor_controller.cpp.
References _(), context_manager_, get_current_map_context(), and quit_confirmation::show_prompt().
|
overrideprivatevirtual |
Redos an action in the current map context.
Reimplemented from hotkey::command_executor.
Definition at line 1300 of file editor_controller.cpp.
References context_manager_, get_current_map_context(), and editor::map_context::redo().
|
private |
Reload images.
Definition at line 1281 of file editor_controller.cpp.
References context_manager_, and image::flush_cache().
Referenced by do_execute_command().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1208 of file editor_controller.cpp.
References unit_map::end(), unit_map::find(), get_current_map_context(), gui_, label, N_, and editor::map_context::units().
|
overridevirtual |
Overridden in derived classes, called on a right click (mousedown).
Defaults to displaying the menu (by setting the appropriate flag) if right_click_show_menu returns true.
Reimplemented from events::mouse_handler_base.
Definition at line 1394 of file editor_controller.cpp.
References a, editor::mouse_action::click_right(), get_current_map_context(), get_mouse_action(), gui(), gui_, display::hex_clicked_on(), LOG_ED, perform_refresh_delete(), hotkey::command_executor_default::set_button_state(), and toolkit_.
|
overridevirtual |
Called in the default right_click when the context menu is about to be shown, can be used for preprocessing and preventing the menu from being displayed without rewriting the right click function.
Reimplemented from events::mouse_handler_base.
Definition at line 1351 of file editor_controller.cpp.
References get_mouse_action(), and editor::mouse_action::has_context_menu().
|
overridevirtual |
Called whenever the right mouse drag has "ended".
Reimplemented from events::mouse_handler_base.
Definition at line 1410 of file editor_controller.cpp.
References a, editor::mouse_action::drag_end_right(), get_mouse_action(), gui_, and perform_delete().
|
overridevirtual |
Called when the right mouse button is up.
Reimplemented from events::mouse_handler_base.
Definition at line 1416 of file editor_controller.cpp.
References a, context_manager_, get_mouse_action(), gui_, perform_delete(), hotkey::command_executor_default::set_button_state(), toolkit_, and editor::mouse_action::up_right().
void editor::editor_controller::save_area | ( | ) |
Save the current selection to the active area.
Definition at line 1237 of file editor_controller.cpp.
References get_current_map_context(), editor::map_context::map(), editor::map_context::save_area(), and editor::editor_map::selection().
Referenced by do_execute_command().
|
inlineoverridevirtual |
Save the map, open dialog if not named yet.
Reimplemented from hotkey::command_executor.
Definition at line 99 of file editor_controller.hpp.
References context_manager_.
Referenced by do_execute_command().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1456 of file editor_controller.cpp.
References controller_base::set_scroll_down().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1461 of file editor_controller.cpp.
References controller_base::set_scroll_left().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1466 of file editor_controller.cpp.
References controller_base::set_scroll_right().
|
overridevirtual |
Handle hotkeys to scroll map.
Reimplemented from hotkey::command_executor.
Definition at line 1451 of file editor_controller.cpp.
References controller_base::set_scroll_up().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1047 of file editor_controller.cpp.
References help::show_help().
|
overridevirtual |
controller_base override
Reimplemented from controller_base.
Definition at line 1052 of file editor_controller.cpp.
References active_menu_, editor::ADDON, editor::AREA, c, can_execute_command(), context_manager_, get_current_map_context(), hotkey::get_hotkey_command(), gui(), hotkey::ui_command::hotkey_command, hotkey::HOTKEY_NULL, controller_base::in_context_menu(), mp::ui_alerts::items, editor::LOAD_MRU, editor::LOCAL_TIME, editor::MAP, editor::MUSIC, music_tracks_, map_location::NDIRECTIONS, editor::PALETTE, editor::SIDE, editor::TIME, toolkit_, editor::UNIT_FACING, and map_location::write_translated_direction().
Referenced by do_execute_command().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 194 of file editor_controller.cpp.
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1430 of file editor_controller.cpp.
References get_current_map_context(), gamemap::get_terrain_info(), gui(), editor::map_context::map(), display::mouseover_hex(), and help::show_terrain_description().
|
overridevirtual |
Grid toggle.
Reimplemented from hotkey::command_executor.
Definition at line 1164 of file editor_controller.cpp.
References preferences::grid(), gui_, and preferences::set_grid().
|
overridevirtual |
Implements events::mouse_handler_base.
Definition at line 1341 of file editor_controller.cpp.
|
overrideprivatevirtual |
Undos an action in the current map context.
Reimplemented from hotkey::command_executor.
Definition at line 1294 of file editor_controller.cpp.
References context_manager_, get_current_map_context(), and editor::map_context::undo().
Referenced by do_execute_command().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1170 of file editor_controller.cpp.
References unit_map::end(), unit_map::find(), get_current_map_context(), gui_, help::show_help(), help::show_unit_help(), and editor::map_context::units().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1226 of file editor_controller.cpp.
References gui_, and gui2::dialogs::show_unit_list().
|
private |
Definition at line 227 of file editor_controller.hpp.
Referenced by can_execute_command(), do_execute_command(), get_action_state(), and show_menu().
const std::unique_ptr<context_manager> editor::editor_controller::context_manager_ |
Definition at line 241 of file editor_controller.hpp.
Referenced by can_execute_command(), copy_selection(), custom_tods_dialog(), cut_selection(), do_execute_command(), editor_controller(), get_action_state(), get_current_map_context(), left_mouse_up(), mouse_motion(), perform_refresh_delete(), quit_confirm(), redo(), refresh_image_cache(), right_mouse_up(), save_map(), show_menu(), and undo().
|
static |
Definition at line 243 of file editor_controller.hpp.
Referenced by do_execute_command(), and editor_controller().
|
private |
Quit main loop flag.
Definition at line 252 of file editor_controller.hpp.
Referenced by do_execute_command(), and main_loop().
|
private |
Definition at line 247 of file editor_controller.hpp.
Referenced by init_gui().
|
private |
The display object used and owned by the editor.
Definition at line 233 of file editor_controller.hpp.
Referenced by can_execute_command(), change_unit_id(), custom_tods_dialog(), do_execute_command(), editor_controller(), get_action_state(), get_display(), gui(), init_gui(), left_click(), left_drag_end(), left_mouse_up(), mouse_motion(), preferences(), rename_unit(), right_click(), right_drag_end(), right_mouse_up(), toggle_grid(), unit_description(), and unit_list().
|
private |
Definition at line 249 of file editor_controller.hpp.
Referenced by editor_controller().
|
private |
Definition at line 255 of file editor_controller.hpp.
Referenced by do_execute_command(), get_action_state(), init_music(), and show_menu().
|
private |
Definition at line 253 of file editor_controller.hpp.
Referenced by do_execute_command(), and main_loop().
|
private |
Reports object.
Must be initialized before the gui_
Definition at line 230 of file editor_controller.hpp.
|
private |
Definition at line 237 of file editor_controller.hpp.
Referenced by custom_tods_dialog(), do_execute_command(), get_action_state(), and init_tods().
|
private |
Definition at line 245 of file editor_controller.hpp.
Referenced by additional_actions_pressed(), can_execute_command(), display_redraw_callback(), do_execute_command(), editor_controller(), get_action_state(), get_mouse_action(), left_click(), left_mouse_up(), process_keyup_event(), right_click(), right_mouse_up(), and show_menu().
|
private |
Definition at line 246 of file editor_controller.hpp.