The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
editor::editor_controller Class Reference

The editor_controller class contains the mouse and keyboard event handling routines for the editor. More...

#include <editor_controller.hpp>

Inheritance diagram for editor::editor_controller:

Public Member Functions

 editor_controller (const editor_controller &)=delete
 
editor_controlleroperator= (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 unit_editor_dialog ()
 Show Unit Editor dialog. More...
 
void custom_tods_dialog ()
 Display the settings dialog, used to control e.g. More...
 
void update_map_schedule (std::vector< time_of_day > schedule)
 Updates schedule and the map display. 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_displaygui () override
 Reference to the used display objects. More...
 
const editor_displaygui () 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_executorget_hotkey_command_executor () override
 Optionally get a command executor to handle context menu events. More...
 
map_contextget_current_map_context () const
 
- Public Member Functions inherited from controller_base
 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)
 
- Public Member Functions inherited from events::sdl_handler
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_handleroperator= (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
 
- Public Member Functions inherited from events::pump_monitor
 pump_monitor ()
 
virtual ~pump_monitor ()
 
- Public Member Functions inherited from hotkey::command_executor_default
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 ()
 
- Public Member Functions inherited from hotkey::command_executor
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 select_teleport ()
 
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 ()
 
- Public Member Functions inherited from events::mouse_handler_base
 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_managercontext_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_baseget_mouse_handler_base () override
 Get a reference to a mouse handler member a derived class uses. More...
 
editor_displayget_display () override
 Get a reference to a display member a derived class uses. More...
 
const mouse_actionget_mouse_action () const
 Get the current mouse action. More...
 
mouse_actionget_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
 
- Protected Member Functions inherited from controller_base
virtual bool is_browsing () const
 
virtual soundsource::managerget_soundsource_man ()
 Get (optionally) a soundsources manager a derived class uses. More...
 
virtual plugins_contextget_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)
 
- Protected Member Functions inherited from events::sdl_handler
 sdl_handler (const bool auto_join=true)
 
 sdl_handler (const sdl_handler &)
 
sdl_handleroperator= (const sdl_handler &)
 
virtual ~sdl_handler ()
 
virtual std::vector< sdl_handler * > handler_members ()
 
- Protected Member Functions inherited from hotkey::command_executor
virtual ~command_executor ()
 
- Protected Member Functions inherited from events::mouse_handler_base
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...
 
- Private Member Functions inherited from quit_confirmation
 quit_confirmation (const std::function< bool()> &prompt=&quit_confirmation::default_prompt)
 
 ~quit_confirmation ()
 

Private Attributes

editor::menu_type active_menu_
 
const std::unique_ptr< reportsreports_
 Reports object. More...
 
const std::unique_ptr< editor_displaygui_
 The display object used and owned by the editor. More...
 
tods_map tods_
 
std::unique_ptr< editor_toolkittoolkit_
 
tooltips::manager tooltip_manager_
 
std::unique_ptr< font::floating_label_contextfloating_label_manager_
 
std::unique_ptr< help::help_managerhelp_manager_
 
bool do_quit_
 Quit main loop flag. More...
 
EXIT_STATUS quit_mode_
 
std::vector< sound::music_trackmusic_tracks_
 

Additional Inherited Members

- Protected Attributes inherited from controller_base
const game_config_viewgame_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_
 
- Protected Attributes inherited from events::mouse_handler_base
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 Private Member Functions inherited from quit_confirmation
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 ()
 

Detailed Description

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 58 of file editor_controller.hpp.

Member Typedef Documentation

◆ tods_map

typedef std::map<std::string, std::pair<std::string ,std::vector<time_of_day> > > editor::editor_controller::tods_map
private

Pre-defined time of day lighting settings for the settings dialog.

Definition at line 233 of file editor_controller.hpp.

Constructor & Destructor Documentation

◆ editor_controller() [1/2]

editor::editor_controller::editor_controller ( const editor_controller )
delete

◆ editor_controller() [2/2]

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 66 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_controller()

editor::editor_controller::~editor_controller ( )

Member Function Documentation

◆ add_area()

void editor::editor_controller::add_area ( )

Add a new area to the current context, filled with the selection if any.

Definition at line 1308 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().

◆ additional_actions_pressed()

std::vector< std::string > editor::editor_controller::additional_actions_pressed ( )
overrideprotectedvirtual

Reimplemented from controller_base.

Definition at line 1536 of file editor_controller.cpp.

References toolkit_.

◆ allow_mouse_wheel_scroll()

bool editor::editor_controller::allow_mouse_wheel_scroll ( int  ,
int   
)
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 1411 of file editor_controller.cpp.

References get_current_map_context(), gui(), editor::map_context::map(), and gamemap_base::on_board_with_border().

◆ can_execute_command()

bool editor::editor_controller::can_execute_command ( const hotkey::ui_command command) const
overridevirtual

command_executor override

Implements hotkey::command_executor.

Definition at line 302 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_EDIT_UNIT, 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().

◆ change_unit_id()

void editor::editor_controller::change_unit_id ( )

◆ copy_selection()

void editor::editor_controller::copy_selection ( )

Copy the selection on the current map to the clipboard.

Definition at line 1248 of file editor_controller.cpp.

References context_manager_, and get_current_map_context().

Referenced by cut_selection(), and do_execute_command().

◆ custom_tods_dialog()

void editor::editor_controller::custom_tods_dialog ( )

◆ cut_selection()

void editor::editor_controller::cut_selection ( )

Cut the selection from the current map to the clipboard.

Definition at line 1296 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().

◆ display_redraw_callback()

void editor::editor_controller::display_redraw_callback ( display )
private

Callback function passed to display to be called on queue_rerender.

Redraws toolbar, brush bar and related items.

Definition at line 1352 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().

◆ do_execute_command()

bool editor::editor_controller::do_execute_command ( const hotkey::ui_command command,
bool  press = true,
bool  release = false 
)
overridevirtual

command_executor override

Reimplemented from hotkey::command_executor.

Definition at line 664 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_EDIT_UNIT, 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(), unit_editor_dialog(), editor::UNIT_FACING, and editor::map_context::units().

◆ do_screenshot()

void editor::editor_controller::do_screenshot ( const std::string &  screenshot_filename = "map_screenshot.png")

Takes a screenshot.

Definition at line 194 of file editor_controller.cpp.

References e, ERR_ED, gui(), image::save_image(), display::screenshot(), and image::success.

◆ export_selection_coords()

void editor::editor_controller::export_selection_coords ( )

Export the WML-compatible list of selected tiles to the system clipboard.

Definition at line 1314 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().

◆ get_action_state()

hotkey::ACTION_STATE editor::editor_controller::get_action_state ( const hotkey::ui_command command) const
overridevirtual

command_executor override

Reimplemented from hotkey::command_executor.

Definition at line 523 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().

◆ get_current_map_context()

map_context& editor::editor_controller::get_current_map_context ( ) const
inline

◆ get_display()

editor_display& editor::editor_controller::get_display ( )
inlineoverrideprotectedvirtual

Get a reference to a display member a derived class uses.

Implements controller_base.

Definition at line 172 of file editor_controller.hpp.

References gui_.

◆ get_hotkey_command_executor()

hotkey::command_executor * editor::editor_controller::get_hotkey_command_executor ( )
overridevirtual

Optionally get a command executor to handle context menu events.

Reimplemented from controller_base.

Definition at line 1512 of file editor_controller.cpp.

◆ get_mouse_action() [1/2]

mouse_action& editor::editor_controller::get_mouse_action ( )
inlineprotected

Get the current mouse action.

Definition at line 177 of file editor_controller.hpp.

References toolkit_.

◆ get_mouse_action() [2/2]

const mouse_action& editor::editor_controller::get_mouse_action ( ) const
inlineprotected

◆ get_mouse_handler_base()

mouse_handler_base& editor::editor_controller::get_mouse_handler_base ( )
inlineoverrideprotectedvirtual

Get a reference to a mouse handler member a derived class uses.

Implements controller_base.

Definition at line 171 of file editor_controller.hpp.

◆ gui() [1/2]

const editor_display& editor::editor_controller::gui ( ) const
inlineoverridevirtual

Const version of gui.

Implements events::mouse_handler_base.

Definition at line 151 of file editor_controller.hpp.

References gui_.

◆ gui() [2/2]

editor_display& editor::editor_controller::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 150 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().

◆ init_gui()

void editor::editor_controller::init_gui ( )
private

◆ init_music()

void editor::editor_controller::init_music ( const game_config_view game_config)
private

init background music for the editor

Definition at line 149 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().

◆ init_tods()

void editor::editor_controller::init_tods ( const game_config_view game_config)
private

init the available time-of-day settings

Definition at line 116 of file editor_controller.cpp.

References config::child_range(), ERR_ED, and tods_.

Referenced by editor_controller().

◆ left_click()

bool editor::editor_controller::left_click ( int  x,
int  y,
const bool  browse 
)
overridevirtual

Overridden in derived classes, called on a left click (mousedown).

Defaults to process (initiate) minimap scrolling.

Returns
true when the click should not process the event further. This means do not treat the call as a start of drag movement. FIXME: This return value is currently ignored

Reimplemented from events::mouse_handler_base.

Definition at line 1421 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_.

◆ left_drag_end()

void editor::editor_controller::left_drag_end ( int  ,
int  ,
const bool  browse 
)
overridevirtual

Called whenever the left mouse drag has "ended".

Reimplemented from events::mouse_handler_base.

Definition at line 1442 of file editor_controller.cpp.

References a, editor::mouse_action::drag_end_left(), get_mouse_action(), gui_, and perform_delete().

◆ left_mouse_up()

void editor::editor_controller::left_mouse_up ( int  ,
int  ,
const bool   
)
overridevirtual

◆ main_loop()

EXIT_STATUS editor::editor_controller::main_loop ( )

◆ mouse_motion()

void editor::editor_controller::mouse_motion ( int  x,
int  y,
const bool  browse,
bool  update,
map_location  new_loc = map_location::null_location() 
)
overridevirtual

◆ operator=()

editor_controller& editor::editor_controller::operator= ( const editor_controller )
delete

◆ perform_delete()

void editor::editor_controller::perform_delete ( std::unique_ptr< editor_action action)
protected

Perform an action, then delete the action object.

The pointer can be nullptr, in which case nothing will happen.

Definition at line 1332 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().

◆ perform_refresh_delete()

void editor::editor_controller::perform_refresh_delete ( std::unique_ptr< editor_action action,
bool  drag_part = false 
)
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 1339 of file editor_controller.cpp.

References context_manager_.

Referenced by left_click(), process_keyup_event(), and right_click().

◆ preferences()

void editor::editor_controller::preferences ( )
overridevirtual

Show the preferences dialog.

Reimplemented from hotkey::command_executor.

Definition at line 1221 of file editor_controller.cpp.

References gui_.

◆ process_keyup_event()

void editor::editor_controller::process_keyup_event ( const SDL_Event &  )
overrideprotectedvirtual

Process keyup (always).

  • Overridden in derived classes

Reimplemented from controller_base.

Definition at line 1505 of file editor_controller.cpp.

References a, get_mouse_action(), gui(), editor::mouse_action::key_event(), perform_refresh_delete(), and toolkit_.

◆ quit_confirm()

bool editor::editor_controller::quit_confirm ( )

Show a quit confirmation dialog and returns true if the user pressed 'yes'.

Definition at line 206 of file editor_controller.cpp.

References _(), context_manager_, get_current_map_context(), and quit_confirmation::show_prompt().

◆ redo()

void editor::editor_controller::redo ( )
overrideprivatevirtual

Redos an action in the current map context.

Reimplemented from hotkey::command_executor.

Definition at line 1365 of file editor_controller.cpp.

References context_manager_, get_current_map_context(), and editor::map_context::redo().

◆ refresh_image_cache()

void editor::editor_controller::refresh_image_cache ( )
private

Reload images.

Definition at line 1346 of file editor_controller.cpp.

References context_manager_, and image::flush_cache().

Referenced by do_execute_command().

◆ rename_unit()

void editor::editor_controller::rename_unit ( )
overridevirtual

◆ right_click()

bool editor::editor_controller::right_click ( int  x,
int  y,
const bool  browse 
)
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.

Returns
true when the click should not process the event further. This means do not treat the call as a start of drag movement.

Reimplemented from events::mouse_handler_base.

Definition at line 1459 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_.

◆ right_click_show_menu()

bool editor::editor_controller::right_click_show_menu ( int  ,
int  ,
const bool   
)
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.

Returns
true when the menu should be displayed and false otherwise FIXME: This return value is currently ignored

Reimplemented from events::mouse_handler_base.

Definition at line 1416 of file editor_controller.cpp.

References get_mouse_action(), and editor::mouse_action::has_context_menu().

◆ right_drag_end()

void editor::editor_controller::right_drag_end ( int  ,
int  ,
const bool   
)
overridevirtual

Called whenever the right mouse drag has "ended".

Reimplemented from events::mouse_handler_base.

Definition at line 1475 of file editor_controller.cpp.

References a, editor::mouse_action::drag_end_right(), get_mouse_action(), gui_, and perform_delete().

◆ right_mouse_up()

void editor::editor_controller::right_mouse_up ( int  x,
int  y,
const bool  browse 
)
overridevirtual

◆ save_area()

void editor::editor_controller::save_area ( )

Save the current selection to the active area.

Definition at line 1302 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().

◆ save_map()

void editor::editor_controller::save_map ( )
inlineoverridevirtual

Save the map, open dialog if not named yet.

Reimplemented from hotkey::command_executor.

Definition at line 96 of file editor_controller.hpp.

References context_manager_.

Referenced by do_execute_command().

◆ scroll_down()

void editor::editor_controller::scroll_down ( bool  on)
overridevirtual

Reimplemented from hotkey::command_executor.

Definition at line 1521 of file editor_controller.cpp.

References controller_base::set_scroll_down().

◆ scroll_left()

void editor::editor_controller::scroll_left ( bool  on)
overridevirtual

Reimplemented from hotkey::command_executor.

Definition at line 1526 of file editor_controller.cpp.

References controller_base::set_scroll_left().

◆ scroll_right()

void editor::editor_controller::scroll_right ( bool  on)
overridevirtual

Reimplemented from hotkey::command_executor.

Definition at line 1531 of file editor_controller.cpp.

References controller_base::set_scroll_right().

◆ scroll_up()

void editor::editor_controller::scroll_up ( bool  on)
overridevirtual

Handle hotkeys to scroll map.

Reimplemented from hotkey::command_executor.

Definition at line 1516 of file editor_controller.cpp.

References controller_base::set_scroll_up().

◆ show_help()

void editor::editor_controller::show_help ( )
overridevirtual

Reimplemented from hotkey::command_executor.

Definition at line 1112 of file editor_controller.cpp.

References help::show_help().

◆ show_menu()

void editor::editor_controller::show_menu ( const std::vector< config > &  items_arg,
int  xloc,
int  yloc,
bool  context_menu,
display disp 
)
overridevirtual

◆ status_table()

void editor::editor_controller::status_table ( )
overridevirtual

Reimplemented from hotkey::command_executor.

Definition at line 191 of file editor_controller.cpp.

◆ terrain_description()

void editor::editor_controller::terrain_description ( )
overridevirtual

◆ toggle_grid()

void editor::editor_controller::toggle_grid ( )
overridevirtual

Grid toggle.

Reimplemented from hotkey::command_executor.

Definition at line 1229 of file editor_controller.cpp.

References preferences::grid(), gui_, and preferences::set_grid().

◆ touch_motion()

void editor::editor_controller::touch_motion ( int  x,
int  y,
const bool  browse,
bool  update = false,
map_location  new_loc = map_location::null_location() 
)
overridevirtual

Implements events::mouse_handler_base.

Definition at line 1406 of file editor_controller.cpp.

◆ undo()

void editor::editor_controller::undo ( )
overrideprivatevirtual

Undos an action in the current map context.

Reimplemented from hotkey::command_executor.

Definition at line 1359 of file editor_controller.cpp.

References context_manager_, get_current_map_context(), and editor::map_context::undo().

Referenced by do_execute_command().

◆ unit_description()

void editor::editor_controller::unit_description ( )
overridevirtual

◆ unit_editor_dialog()

void editor::editor_controller::unit_editor_dialog ( )

◆ unit_list()

void editor::editor_controller::unit_list ( )
overridevirtual

Reimplemented from hotkey::command_executor.

Definition at line 1291 of file editor_controller.cpp.

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

◆ update_map_schedule()

void editor::editor_controller::update_map_schedule ( std::vector< time_of_day schedule)

Updates schedule and the map display.

Definition at line 295 of file editor_controller.cpp.

References context_manager_, get_current_map_context(), gui_, and editor::map_context::replace_schedule().

Referenced by custom_tods_dialog().

Member Data Documentation

◆ active_menu_

editor::menu_type editor::editor_controller::active_menu_
private

◆ context_manager_

const std::unique_ptr<context_manager> editor::editor_controller::context_manager_

◆ current_addon_id_

std::string editor::editor_controller::current_addon_id_ = ""
static

◆ do_quit_

bool editor::editor_controller::do_quit_
private

Quit main loop flag.

Definition at line 249 of file editor_controller.hpp.

Referenced by do_execute_command(), and main_loop().

◆ floating_label_manager_

std::unique_ptr<font::floating_label_context> editor::editor_controller::floating_label_manager_
private

Definition at line 244 of file editor_controller.hpp.

Referenced by init_gui().

◆ gui_

const std::unique_ptr<editor_display> editor::editor_controller::gui_
private

◆ help_manager_

std::unique_ptr<help::help_manager> editor::editor_controller::help_manager_
private

Definition at line 246 of file editor_controller.hpp.

Referenced by editor_controller().

◆ music_tracks_

std::vector<sound::music_track> editor::editor_controller::music_tracks_
private

Definition at line 252 of file editor_controller.hpp.

Referenced by do_execute_command(), get_action_state(), init_music(), and show_menu().

◆ quit_mode_

EXIT_STATUS editor::editor_controller::quit_mode_
private

Definition at line 250 of file editor_controller.hpp.

Referenced by do_execute_command(), and main_loop().

◆ reports_

const std::unique_ptr<reports> editor::editor_controller::reports_
private

Reports object.

Must be initialized before the gui_

Definition at line 227 of file editor_controller.hpp.

◆ tods_

tods_map editor::editor_controller::tods_
private

◆ toolkit_

std::unique_ptr<editor_toolkit> editor::editor_controller::toolkit_
private

◆ tooltip_manager_

tooltips::manager editor::editor_controller::tooltip_manager_
private

Definition at line 243 of file editor_controller.hpp.


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