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) | |
~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 (const 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... | |
bool | keep_menu_open () const override |
command_executor override More... | |
void | show_menu (const std::vector< config > &items_arg, const point &menu_loc, bool context_menu) override |
command_executor 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 |
void | select_addon () |
Show dialog to select active addon or create a new one. More... | |
bool | initialize_addon () |
Show dialog to select active addon or create a new one if one is not yet initialized. More... | |
![]() | |
controller_base () | |
virtual | ~controller_base () |
virtual void | play_slice () |
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 () |
![]() | |
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 | toggle_accelerated_speed () |
virtual void | surrender_quit_game () |
void | surrender_game () |
void | execute_quit_command () |
void | execute_action (const std::vector< std::string > &items_arg) |
void | queue_command (const SDL_Event &event, int index=-1) |
bool | run_queued_commands () |
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 |
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 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 () override |
virtual void | process_keydown_event (const SDL_Event &) |
Process keydown (always). More... | |
bool | show_menu (const theme::menu *menu, const point &loc, bool context_menu) |
virtual void | execute_action (const std::vector< std::string > &items_arg) |
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 () |
virtual bool | in_context_menu (const hotkey::ui_command &) const |
Determines whether the command should be in the context menu or not. More... | |
![]() | |
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 | |
enum class | menu_type { map , load_mru , palette , area , side , time , local_time , schedule , local_schedule , music , unit_facing , none } |
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 | 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 | |
menu_type | active_menu_ |
The currently invoked dropdown menu. More... | |
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< std::shared_ptr< sound::music_track > > | music_tracks_ |
Additional Inherited Members | |
![]() | |
const game_config_view & | game_config_ |
bool | scrolling_ |
bool | scroll_up_ |
bool | scroll_down_ |
bool | scroll_left_ |
bool | scroll_right_ |
std::chrono::steady_clock::time_point | 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... | |
point | drag_from_ |
Drag start position. 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 42 of file editor_controller.hpp.
|
private |
Pre-defined time of day lighting settings for the settings dialog.
Definition at line 235 of file editor_controller.hpp.
|
strongprivate |
Enumerator | |
---|---|
map | |
load_mru | |
palette | |
area | |
side | |
time | |
local_time | |
schedule | |
local_schedule | |
music | |
unit_facing | |
none |
Definition at line 185 of file editor_controller.hpp.
|
delete |
editor::editor_controller::editor_controller | ( | bool | clear_id | ) |
Definition at line 89 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_tods(), 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 1387 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 1615 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 1490 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 306 of file editor_controller.cpp.
References active_menu_, area, editor::map_context::can_redo(), editor::map_context::can_undo(), context_manager_, current_addon_id_, dummy, 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_HELP_TEXT_SHOWN, 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_MAP_TO_SCENARIO, hotkey::HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_OPEN_ADDON, 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_ADDON, 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(), load_mru, loc, local_schedule, local_time, map, editor::map_context::map(), editor::map_context::modified(), display::mouseover_hex(), music, none, palette, schedule, editor::editor_map::selection(), side, utf8::size(), editor::mouse_action::supports_brushes(), editor::map_context::teams(), time, hotkey::TITLE_SCREEN__RELOAD_WML, toolkit_, unit_facing, editor::map_context::units(), and map_location::valid().
Referenced by show_menu().
void editor::editor_controller::change_unit_id | ( | ) |
Definition at line 1319 of file editor_controller.cpp.
References unit_map::end(), unit_map::find(), get_current_map_context(), gui_, label, loc, 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 1311 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 234 of file editor_controller.cpp.
References _(), context_manager_, current_addon_id_, chrono::format_local_timestamp(), get_current_map_context(), tod_manager::get_current_time(), gui2::dialogs::custom_tod::get_schedule(), editor::map_context::get_time_manager(), gui_, gui2::dialogs::custom_tod::register_callback(), editor::map_context::replace_schedule(), editor::map_context::save_schedule(), gui2::dialogs::modal_dialog::show(), gui2::show_error_message(), tod_manager::times(), timestamp, tods_, and update_map_schedule().
Referenced by do_execute_command().
void editor::editor_controller::cut_selection | ( | ) |
Cut the selection from the current map to the clipboard.
Definition at line 1375 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 1431 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 673 of file editor_controller.cpp.
References _(), active_menu_, add_area(), area, gui2::dialogs::message::auto_close, 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(), prefs::get(), tod_manager::get_area_by_index(), filesystem::get_current_editor_dir(), 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_HELP_TEXT_SHOWN, 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_TO_SCENARIO, hotkey::HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_OPEN_ADDON, 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_ADDON, 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_LOYAL, 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(), initialize_addon(), display::invalidate_all(), filesystem::is_cfg(), filesystem::is_map(), load_mru, loc, local_schedule, local_time, map, music, music_tracks_, editor::map_context::new_side(), none, desktop::open_object(), desktop::open_object_is_supported(), palette, editor::map_context::partial_undo(), gui2::dialogs::file_dialog::path(), 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(), schedule, SCOPE_ED, select_addon(), editor::map_context::select_area(), editor::location_palette::selected_item(), editor::map_context::set_active_area(), editor::editor_display::set_help_string_enabled(), editor::map_context::set_local_starting_time(), gui2::dialogs::file_dialog::set_path(), editor::map_context::set_starting_time(), gui2::dialogs::file_dialog::set_title(), gui2::dialogs::modal_dialog::show(), gui2::show_error_message(), gui2::show_message(), side, utf8::size(), editor::map_context::teams(), time, hotkey::TITLE_SCREEN__RELOAD_WML, tods_, display::toggle_debug_flag(), editor::map_context::toggle_track(), toolkit_, undo(), unit_editor_dialog(), 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 1393 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 543 of file editor_controller.cpp.
References active_menu_, area, context_manager_, display::DEBUG_COORDINATES, display::DEBUG_NUM_BITMAPS, display::DEBUG_TERRAIN_CODES, unit_map::find(), prefs::get(), editor::map_context::get_active_area(), get_current_map_context(), editor::map_context::get_time_manager(), 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_HELP_TEXT_SHOWN, 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(), load_mru, local_schedule, local_time, map, music, music_tracks_, none, hotkey::on, hotkey::on_if(), palette, schedule, hotkey::selected_if(), side, hotkey::stateless, time, tod_manager::times(), tods_, toolkit_, unit_facing, and editor::map_context::units().
|
inline |
Definition at line 144 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(), editor::mouse_action_map_label::up_left(), and update_map_schedule().
|
inlineoverrideprotectedvirtual |
Get a reference to a display member a derived class uses.
Implements controller_base.
Definition at line 163 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 1591 of file editor_controller.cpp.
|
inlineprotected |
Get the current mouse action.
Definition at line 168 of file editor_controller.hpp.
References toolkit_.
|
inlineprotected |
Get the current mouse action.
Definition at line 166 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 162 of file editor_controller.hpp.
|
inlineoverridevirtual |
Const version of gui.
Implements events::mouse_handler_base.
Definition at line 132 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 131 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(), terrain_description(), and unit_list().
|
private |
init the display object and general set-up
Definition at line 121 of file editor_controller.cpp.
References display::add_redraw_observer(), display::change_display_context(), display::DEBUG_COORDINATES, display::DEBUG_NUM_BITMAPS, display::DEBUG_TERRAIN_CODES, display_redraw_callback(), floating_label_manager_, prefs::get(), get_current_map_context(), gui(), display::set_debug_flag(), and editor::editor_display::set_help_string_enabled().
Referenced by editor_controller().
|
private |
init the available time-of-day settings
Definition at line 138 of file editor_controller.cpp.
References config::child_range(), ERR_ED, and tods_.
Referenced by editor_controller().
bool editor::editor_controller::initialize_addon | ( | ) |
Show dialog to select active addon or create a new one if one is not yet initialized.
Does nothing otherwise.
Definition at line 1152 of file editor_controller.cpp.
References current_addon_id_, and select_addon().
Referenced by do_execute_command().
|
overridevirtual |
command_executor override
Reimplemented from hotkey::command_executor.
Definition at line 1167 of file editor_controller.cpp.
References active_menu_, and music.
|
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 1500 of file editor_controller.cpp.
References 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 1521 of file editor_controller.cpp.
References 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 1527 of file editor_controller.cpp.
References 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 1450 of file editor_controller.cpp.
References 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 1411 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 1418 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 1284 of file editor_controller.cpp.
References gui_.
|
overrideprotectedvirtual |
Process keyup (always).
Reimplemented from controller_base.
Definition at line 1584 of file editor_controller.cpp.
References 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 1444 of file editor_controller.cpp.
References context_manager_, get_current_map_context(), and editor::map_context::redo().
|
private |
Reload images.
Definition at line 1425 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 1336 of file editor_controller.cpp.
References unit_map::end(), unit_map::find(), get_current_map_context(), gui_, label, loc, 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 1538 of file editor_controller.cpp.
References 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 1495 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 1554 of file editor_controller.cpp.
References 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 1560 of file editor_controller.cpp.
References 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 1381 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 74 of file editor_controller.hpp.
References context_manager_.
Referenced by do_execute_command().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1600 of file editor_controller.cpp.
References hotkey::on, and controller_base::set_scroll_down().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1605 of file editor_controller.cpp.
References hotkey::on, and controller_base::set_scroll_left().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1610 of file editor_controller.cpp.
References hotkey::on, and controller_base::set_scroll_right().
|
overridevirtual |
Handle hotkeys to scroll map.
Reimplemented from hotkey::command_executor.
Definition at line 1595 of file editor_controller.cpp.
References hotkey::on, and controller_base::set_scroll_up().
void editor::editor_controller::select_addon | ( | ) |
Show dialog to select active addon or create a new one.
Definition at line 1146 of file editor_controller.cpp.
References context_manager_, current_addon_id_, and editor::initialize_addon().
Referenced by do_execute_command(), and initialize_addon().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1162 of file editor_controller.cpp.
References help::show_help().
|
overridevirtual |
command_executor override
Reimplemented from hotkey::command_executor.
Definition at line 1173 of file editor_controller.cpp.
References active_menu_, area, c, can_execute_command(), context_manager_, get_current_map_context(), gui(), hotkey::HOTKEY_NULL, hotkey::command_executor::in_context_menu(), map_location::indeterminate, load_mru, local_time, map, music, music_tracks_, none, ON_SCOPE_EXIT, palette, side, time, toolkit_, utils::views::transform, unit_facing, and map_location::write_translated_direction().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 194 of file editor_controller.cpp.
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1574 of file editor_controller.cpp.
References get_current_map_context(), gamemap::get_terrain_info(), gui(), loc, editor::map_context::map(), display::mouseover_hex(), and help::show_terrain_description().
|
overridevirtual |
Grid toggle.
Reimplemented from hotkey::command_executor.
Definition at line 1292 of file editor_controller.cpp.
References prefs::get(), and gui_.
|
overridevirtual |
Implements events::mouse_handler_base.
Definition at line 1485 of file editor_controller.cpp.
|
overrideprivatevirtual |
Undos an action in the current map context.
Reimplemented from hotkey::command_executor.
Definition at line 1438 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 1298 of file editor_controller.cpp.
References unit_map::end(), unit_map::find(), get_current_map_context(), gui_, loc, help::show_help(), help::show_unit_description(), and editor::map_context::units().
void editor::editor_controller::unit_editor_dialog | ( | ) |
Show Unit Editor dialog.
Definition at line 226 of file editor_controller.cpp.
References current_addon_id_, controller_base::game_config_, gui2::dialogs::modal_dialog::show(), and gui2::dialogs::editor_edit_unit::write().
Referenced by do_execute_command().
|
overridevirtual |
Reimplemented from hotkey::command_executor.
Definition at line 1354 of file editor_controller.cpp.
References unit_map::begin(), gui2::dialogs::units_dialog::build_unit_list_dialog(), display::context(), unit_map::end(), gui(), i, loc, display::scroll_to_tile(), display::select_hex(), display_context::units(), and display::WARP.
void editor::editor_controller::update_map_schedule | ( | const std::vector< time_of_day > & | schedule | ) |
Updates schedule and the map display.
Definition at line 299 of file editor_controller.cpp.
References context_manager_, get_current_map_context(), gui_, and editor::map_context::replace_schedule().
Referenced by custom_tods_dialog().
|
private |
The currently invoked dropdown menu.
Outside of show_menu, this will be menu_type::none.
Definition at line 226 of file editor_controller.hpp.
Referenced by can_execute_command(), do_execute_command(), get_action_state(), keep_menu_open(), and show_menu().
const std::unique_ptr<context_manager> editor::editor_controller::context_manager_ |
Definition at line 240 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(), select_addon(), show_menu(), undo(), and update_map_schedule().
|
static |
Definition at line 242 of file editor_controller.hpp.
Referenced by can_execute_command(), custom_tods_dialog(), do_execute_command(), editor_controller(), initialize_addon(), editor::context_manager::load_map(), editor::context_manager::load_map_dialog(), editor::context_manager::save_map_as_dialog(), editor::context_manager::save_scenario_as_dialog(), select_addon(), and unit_editor_dialog().
|
private |
Quit main loop flag.
Definition at line 251 of file editor_controller.hpp.
Referenced by do_execute_command(), and main_loop().
|
private |
Definition at line 246 of file editor_controller.hpp.
Referenced by init_gui().
|
private |
The display object used and owned by the editor.
Definition at line 232 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(), 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 update_map_schedule().
|
private |
Definition at line 248 of file editor_controller.hpp.
Referenced by editor_controller().
|
private |
Definition at line 254 of file editor_controller.hpp.
Referenced by do_execute_command(), get_action_state(), and show_menu().
|
private |
Definition at line 252 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 229 of file editor_controller.hpp.
|
private |
Definition at line 236 of file editor_controller.hpp.
Referenced by custom_tods_dialog(), do_execute_command(), get_action_state(), and init_tods().
|
private |
Definition at line 244 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 245 of file editor_controller.hpp.