15 #ifndef EDITOR_EDITOR_CONTROLLER_HPP_INCLUDED
16 #define EDITOR_EDITOR_CONTROLLER_HPP_INCLUDED
71 private boost::noncopyable,
113 void show_menu(
const std::vector<std::string>& items_arg,
int xloc,
int yloc,
bool context_menu,
display& disp);
160 bool left_click(
int x,
int y,
const bool browse);
232 boost::scoped_ptr<editor_display>
gui_;
235 typedef std::map<std::string, std::pair<std::string ,std::vector<time_of_day> > >
tods_map;
void perform_refresh_delete(editor_action *action, bool drag_part=false)
Peform an action on the current map_context, then refresh the display and delete the pointer...
const editor_display & gui() const
Const version.
bool right_click_show_menu(int x, int y, const bool browse)
Called in the default right_click when the context menu is about to be shown, can be used for preproc...
boost::scoped_ptr< editor_toolkit > toolkit_
void copy_selection()
Copy the selection on the current map to the clipboard.
void save_map()
Save the map, open dialog if not named yet.
editor_display & gui()
Reference to the used display objects.
tooltips::manager tooltip_manager_
void export_selection_coords()
Export the WML-compatible list of selected tiles to the system clipboard.
void do_screenshot(const std::string &screenshot_filename="map_screenshot.bmp")
Takes a screenshot.
bool right_click(int x, int y, const bool browse)
Overridden in derived classes, called on a right click (mousedown).
std::string get_left_button_function()
bool quit_confirm()
Show a quit confirmation dialog and returns true if the user pressed 'yes'.
bool left_click(int x, int y, const bool browse)
Overridden in derived classes, called on a left click (mousedown).
void custom_tods_dialog()
Display the settings dialog, used to control e.g.
editor_display & get_display()
Get a reference to a display member a derived class uses.
void redo()
Redos an action in the current map context.
void left_drag_end(int x, int y, const bool browse)
Called whenever the left mouse drag has "ended".
void save_area()
Save the current selection to the active area.
bool can_execute_command(const hotkey::hotkey_command &command, int index=-1) const
command_executor override
Stores all information related to functions that can be bound to hotkeys.
hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const
command_executor override
void add_area()
Add a new area to the current context, filled with the selection if any.
boost::scoped_ptr< font::floating_label_context > floating_label_manager_
GLint GLint GLint GLint GLint GLint y
controller_base framework: controller_base is roughly analogous to a "dialog" class in a GUI toolkit ...
boost::scoped_ptr< context_manager > context_manager_
The editor_controller class contains the mouse and keyboard event handling routines for the editor...
void scroll_up(bool on)
Handle hotkeys to scroll map.
editor::menu_type active_menu_
void load_tooltips()
Load editor-specific tooltips.
void scroll_right(bool on)
void scroll_left(bool on)
void right_drag_end(int x, int y, const bool browse)
Called whenever the right mouse drag has "ended".
void toggle_grid()
Grid toggle.
bool allow_mouse_wheel_scroll(int x, int y)
Derived classes can override this to disable mousewheel scrolling under some circumstances, e.g.
void terrain_description()
void init_tods(const config &game_config)
init the available time-of-day settings
Implements a quit confirmation dialog.
mouse_action * get_mouse_action()
Get the current mouse action.
void preferences()
Show the preferences dialog.
boost::scoped_ptr< reports > reports_
Reports object.
void scroll_down(bool on)
virtual hotkey::command_executor * get_hotkey_command_executor()
Get (optionally) a command executor to handle context menu events.
editor_controller(const config &game_config, CVideo &video)
The constructor.
void refresh_image_cache()
Reload images.
Manage the empty-palette in the editor.
void show_menu(const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu, display &disp)
controller_base override
void undo()
Undos an action in the current map context.
static const map_location & null_location()
boost::scoped_ptr< help::help_manager > help_manager_
Encapsulates the map of the game.
void process_keyup_event(const SDL_Event &event)
Process keyup (always).
boost::scoped_ptr< editor_display > gui_
The display object used and owned by the editor.
void init_gui()
init the display object and general set-up
Game configuration data as global variables.
structure which will hide all current floating labels, and cause floating labels instantiated after i...
Base class for all editor actions.
virtual std::vector< std::string > additional_actions_pressed() override
void cut_selection()
Cut the selection from the current map to the clipboard.
GLint GLint GLint GLint GLint x
void left_mouse_up(int x, int y, const bool browse)
Called when the left mouse button is up.
void display_redraw_callback(display &)
Callback function passed to display to be called on each redraw_everything run.
std::vector< sound::music_track > music_tracks_
void mouse_motion(int x, int y, const bool browse, bool update, map_location new_loc=map_location::null_location())
Called when a mouse motion event takes place.
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.
mouse_handler_base & get_mouse_handler_base()
Get a reference to a mouse handler member a derived class uses.
void perform_delete(editor_action *action)
Perform an action, then delete the action object.
void update_mouse_action_highlights()
bool do_quit_
Quit main loop flag.
EXIT_STATUS main_loop()
Editor main loop.
bool execute_command(const hotkey::hotkey_command &command, int index=-1, bool press=true)
command_executor override
void init_music(const config &game_config)
init background music for the editor
A mouse action receives events from the controller, and responds to them by creating an appropriate e...
A config object defines a single node in a WML file, with access to child nodes.
void hotkey_quit()
Process a hotkey quit command.
GLsizei const GLcharARB ** string
void right_mouse_up(int x, int y, const bool browse)
Called when the right mouse button is up.