78 void do_screenshot(
const std::string& screenshot_filename =
"map_screenshot.png");
105 void show_menu(
const std::vector<config>& items_arg,
int xloc,
int yloc,
bool context_menu,
display& disp)
override;
151 bool left_click(
int x,
int y,
const bool browse)
override;
152 void left_drag_end(
int x,
int y,
const bool browse)
override;
153 void left_mouse_up(
int x,
int y,
const bool browse)
override;
154 bool right_click(
int x,
int y,
const bool browse)
override;
219 void undo()
override;
224 void redo()
override;
232 const std::unique_ptr<editor_display>
gui_;
235 typedef std::map<std::string, std::pair<std::string ,std::vector<time_of_day>>>
tods_map;
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
The editor_controller class contains the mouse and keyboard event handling routines for the editor.
const std::unique_ptr< context_manager > context_manager_
void preferences() override
Show the preferences dialog.
void refresh_image_cache()
Reload images.
void rename_unit() override
void right_drag_end(int x, int y, const bool browse) override
Called whenever the right mouse drag has "ended".
void unit_editor_dialog()
Show Unit Editor dialog.
bool can_execute_command(const hotkey::ui_command &command) const override
command_executor override
bool quit_confirm()
Show a quit confirmation dialog and returns true if the user pressed 'yes'.
void unit_list() override
tooltips::manager tooltip_manager_
void scroll_up(bool on) override
Handle hotkeys to scroll map.
void cut_selection()
Cut the selection from the current map to the clipboard.
void display_redraw_callback(display &)
Callback function passed to display to be called on queue_rerender.
std::unique_ptr< font::floating_label_context > floating_label_manager_
void show_menu(const std::vector< config > &items_arg, int xloc, int yloc, bool context_menu, display &disp) override
controller_base override
void undo() override
Undos an action in the current map context.
void left_mouse_up(int x, int y, const bool browse) override
Called when the left mouse button is up.
bool left_click(int x, int y, const bool browse) override
Overridden in derived classes, called on a left click (mousedown).
mouse_handler_base & get_mouse_handler_base() override
Get a reference to a mouse handler member a derived class uses.
bool allow_mouse_wheel_scroll(int x, int y) override
Derived classes can override this to disable mousewheel scrolling under some circumstances,...
void touch_motion(int x, int y, const bool browse, bool update=false, map_location new_loc=map_location::null_location()) override
void unit_description() override
virtual std::vector< std::string > additional_actions_pressed() override
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.
void init_tods(const game_config_view &game_config)
init the available time-of-day settings
bool initialize_addon()
Initialize an addon if the addon id is empty.
const mouse_action & get_mouse_action() const
Get the current mouse action.
void status_table() override
map_context & get_current_map_context() const
std::unique_ptr< editor_toolkit > toolkit_
void scroll_right(bool on) override
void init_music(const game_config_view &game_config)
init background music for the editor
editor_controller & operator=(const editor_controller &)=delete
const std::unique_ptr< editor_display > gui_
The display object used and owned by the editor.
bool do_execute_command(const hotkey::ui_command &command, bool press=true, bool release=false) override
command_executor override
void export_selection_coords()
Export the WML-compatible list of selected tiles to the system clipboard.
void redo() override
Redos an action in the current map context.
editor_display & gui() override
Reference to the used display objects.
void update_map_schedule(std::vector< time_of_day > schedule)
Updates schedule and the map display.
hotkey::ACTION_STATE get_action_state(const hotkey::ui_command &command) const override
command_executor override
void perform_delete(std::unique_ptr< editor_action > action)
Perform an action, then delete the action object.
void right_mouse_up(int x, int y, const bool browse) override
Called when the right mouse button is up.
virtual hotkey::command_executor * get_hotkey_command_executor() override
Optionally get a command executor to handle context menu events.
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.
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.
EXIT_STATUS main_loop()
Editor main loop.
editor_controller(const editor_controller &)=delete
void custom_tods_dialog()
Display the settings dialog, used to control e.g.
void do_screenshot(const std::string &screenshot_filename="map_screenshot.png")
Takes a screenshot.
void toggle_grid() override
Grid toggle.
void scroll_left(bool on) override
bool right_click(int x, int y, const bool browse) override
Overridden in derived classes, called on a right click (mousedown).
void save_area()
Save the current selection to the active area.
void process_keyup_event(const SDL_Event &event) override
Process keyup (always).
editor_display & get_display() override
Get a reference to a display member a derived class uses.
void copy_selection()
Copy the selection on the current map to the clipboard.
mouse_action & get_mouse_action()
Get the current mouse action.
void show_help() override
void init_gui()
init the display object and general set-up
std::unique_ptr< help::help_manager > help_manager_
std::vector< sound::music_track > music_tracks_
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 preproc...
editor::menu_type active_menu_
static std::string current_addon_id_
void add_area()
Add a new area to the current context, filled with the selection if any.
void terrain_description() override
const std::unique_ptr< reports > reports_
Reports object.
void scroll_down(bool on) override
void left_drag_end(int x, int y, const bool browse) override
Called whenever the left mouse drag has "ended".
bool do_quit_
Quit main loop flag.
const editor_display & gui() const override
Const version of gui.
void save_map() override
Save the map, open dialog if not named yet.
This class wraps around a map to provide a concise interface for the editor to work with.
A mouse action receives events from the controller, and responds to them by creating an appropriate e...
A class grating read only view to a vector of config objects, viewed as one config with all children ...
Implements a quit confirmation dialog.
controller_base framework: controller_base is roughly analogous to a "dialog" class in a GUI toolkit ...
Manage the empty-palette in the editor.
Game configuration data as global variables.
structure which will hide all current floating labels, and cause floating labels instantiated after i...
Used as the main paramneter for can_execute_command/do_execute_command These functions are used to ex...
Encapsulates the map of the game.
static const map_location & null_location()