Set starting position action. More...
#include <mouse_action.hpp>
Public Member Functions | |
mouse_action_starting_position (const CKey &key, location_palette &palette) | |
editor_action * | up_left (editor_display &disp, int x, int y) |
Left click displays a player-number-selector dialog and then creates an action or returns nullptr if cancel was pressed or there would be no change. More... | |
editor_action * | click_left (editor_display &disp, int x, int y) |
A click, possibly the beginning of a drag. More... | |
editor_action * | up_right (editor_display &disp, int x, int y) |
Right click only erases the starting position if there is one. More... | |
editor_action * | click_right (editor_display &disp, int x, int y) |
A click, possibly the beginning of a drag. More... | |
virtual void | set_mouse_overlay (editor_display &disp) |
Set the mouse overlay for this action. More... | |
Public Member Functions inherited from editor::mouse_action | |
mouse_action (common_palette &palette, const CKey &key) | |
virtual | ~mouse_action () |
virtual bool | has_context_menu () const |
virtual void | move (editor_display &disp, const map_location &hex) |
Mouse move (not a drag). More... | |
void | update_brush_highlights (editor_display &disp, const map_location &hex) |
Unconditionally update the brush highlights for the current tool when hex is the center location. More... | |
virtual std::set< map_location > | affected_hexes (editor_display &disp, const map_location &hex) |
Locations that would be affected by a click, used by move to update highlights. More... | |
virtual editor_action * | drag_left (editor_display &disp, int x, int y, bool &partial, editor_action *last_undo) |
Drag operation. More... | |
virtual editor_action * | drag_right (editor_display &disp, int x, int y, bool &partial, editor_action *last_undo) |
Drag operation. More... | |
virtual editor_action * | drag_end_left (editor_display &disp, int x, int y) |
The end of dragging. More... | |
virtual editor_action * | drag_end_right (editor_display &disp, int x, int y) |
virtual editor_action * | key_event (editor_display &disp, const SDL_Event &e) |
Function called by the controller on a key event for the current mouse action. More... | |
void | set_toolbar_button (const theme::menu *value) |
Helper variable setter - pointer to a toolbar menu/button used for highlighting the current action. More... | |
const theme::menu * | toolbar_button () const |
Getter for the (possibly nullptr) associated menu/button. More... | |
common_palette & | get_palette () |
Getter for the associated palette. More... | |
virtual bool | supports_brushes () |
Whether we need the brush bar, is used to grey it out. More... | |
Private Attributes | |
bool | click_ |
location_palette & | location_palette_ |
Additional Inherited Members | |
Protected Member Functions inherited from editor::mouse_action | |
bool | has_alt_modifier () const |
bool | has_shift_modifier () const |
bool | has_ctrl_modifier () const |
void | set_terrain_mouse_overlay (editor_display &disp, const t_translation::t_terrain &fg, const t_translation::t_terrain &bg) |
Helper function for derived classes that need a active-terrain mouse overlay. More... | |
Protected Attributes inherited from editor::mouse_action | |
map_location | previous_move_hex_ |
The hex previously used in move operations. More... | |
const CKey & | key_ |
Key presses, used for modifiers (alt, shift) in some operations. More... | |
Set starting position action.
Definition at line 368 of file mouse_action.hpp.
|
inline |
Definition at line 371 of file mouse_action.hpp.
|
virtual |
A click, possibly the beginning of a drag.
Must be overridden.
Implements editor::mouse_action.
Definition at line 427 of file mouse_action.cpp.
References click_.
|
virtual |
A click, possibly the beginning of a drag.
Must be overridden.
Implements editor::mouse_action.
Definition at line 444 of file mouse_action.cpp.
|
virtual |
Set the mouse overlay for this action.
Defaults to an empty overlay.
Reimplemented from editor::mouse_action.
Definition at line 449 of file mouse_action.cpp.
References adjust_surface_alpha(), blit_surface(), create_neutral_surface(), sdl::create_rect(), image::get_image(), display::get_zoom_factor(), scale_surface(), and display::set_mouseover_hex_overlay().
|
virtual |
Left click displays a player-number-selector dialog and then creates an action or returns nullptr if cancel was pressed or there would be no change.
Do this on mouse up to avoid drag issue.
Reimplemented from editor::mouse_action.
Definition at line 393 of file mouse_action.cpp.
References editor::location_palette::add_item(), click_, editor::mouse_action::has_ctrl_modifier(), display::hex_clicked_on(), gamemap::is_starting_position(), location_palette_, editor::editor_display::map(), gamemap::on_board(), editor::location_palette::selected_item(), and editor::mouse_action::update_brush_highlights().
|
virtual |
Right click only erases the starting position if there is one.
Do this on mouse up to avoid drag issue,
Reimplemented from editor::mouse_action.
Definition at line 433 of file mouse_action.cpp.
References display::hex_clicked_on(), gamemap::is_starting_position(), and editor::editor_display::map().
|
private |
Definition at line 395 of file mouse_action.hpp.
Referenced by click_left(), and up_left().
|
private |
Definition at line 396 of file mouse_action.hpp.
Referenced by up_left().