172 , previous_drag_hex_()
185 virtual std::unique_ptr<editor_action> click_perform_left(
editor_display& disp,
const std::set<map_location>& hexes) = 0;
190 virtual std::unique_ptr<editor_action> click_perform_right(
editor_display& disp,
const std::set<map_location>& hexes) = 0;
218 std::unique_ptr<editor_action> drag_end(
editor_display& disp,
int x,
int y);
222 const brush& get_brush();
236 template <std::unique_ptr<editor_action> (brush_drag_mouse_action::*perform_func)(editor_display&, const std::set<map_location>&)>
257 , terrain_palette_(palette)
274 std::unique_ptr<editor_action> click_perform_left(
editor_display& disp,
const std::set<map_location>& hexes)
override;
279 std::unique_ptr<editor_action> click_perform_right(
editor_display& disp,
const std::set<map_location>& hexes)
override;
339 , terrain_palette_(terrain_palette)
371 :
mouse_action(palette, key), click_(false), location_palette_(palette)
Brush paint mouse action.
terrain_palette & terrain_palette_
virtual std::unique_ptr< editor_action > drag_end_left(editor_display &disp, int x, int y)
The end of dragging.
const CKey & key_
Key presses, used for modifiers (alt, shift) in some operations.
A map fragment – a collection of locations and information abut them.
map_location previous_move_hex_
The hex previously used in move operations.
virtual std::unique_ptr< editor_action > click_right(editor_display &disp, int x, int y)=0
A click, possibly the beginning of a drag.
const brush *const *const brush_
Current brush handle.
std::vector< color_t > palette(const color_range &cr)
Creates a reference color palette from a color range.
mouse_action_fill(const CKey &key, terrain_palette &terrain_palette)
Palette where the terrain to be drawn can be selected.
common_palette & palette_
Pointer to an associated palette, if such exists.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
void set_terrain_mouse_overlay(editor_display &disp, const t_translation::terrain_code &fg, const t_translation::terrain_code &bg)
Helper function for derived classes that need a active-terrain mouse overlay.
Base class for editor actions.
List of starting locations and location ids.
virtual std::unique_ptr< editor_action > up_right(editor_display &disp, int x, int y)
virtual std::unique_ptr< editor_action > drag_end_right(editor_display &disp, int x, int y)
mouse_action_paste(const map_fragment &paste, const CKey &key, common_palette &palette)
A brush-drag mouse action base class which adds brush and drag processing to a basic mouse action...
map_location previous_drag_hex_
The previous hex dragged into.
location_palette & location_palette_
const map_fragment & paste_
Reference to the buffer used for pasting (e.g.
virtual std::unique_ptr< 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.
brush_drag_mouse_action(common_palette &palette, const brush *const *const brush, const CKey &key)
mouse_action_starting_position(const CKey &key, location_palette &palette)
virtual bool has_context_menu() const
common_palette & get_palette()
Getter for the associated palette.
bool has_shift_modifier() const
mouse_action_paint(const brush *const *const brush, const CKey &key, terrain_palette &palette)
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...
The brush class represents a single brush – a set of relative locations around a "hotspot"...
Manage the empty-palette in the editor.
virtual bool supports_brushes() const
Whether we need the brush bar, is used to grey it out.
terrain_palette & terrain_palette_
Encapsulates the map of the game.
virtual bool supports_brushes() const override
Whether we need the brush bar, is used to grey it out.
void set_toolbar_button(const theme::menu *value)
Helper variable setter - pointer to a toolbar menu/button used for highlighting the current action...
Base class for all editor actions.
Definitions related to theme-support.
virtual std::unique_ptr< editor_action > up_left(editor_display &disp, int x, int y)
virtual void set_mouse_overlay(editor_display &disp)
Set the mouse overlay for this action.
const theme::menu * toolbar_button() const
Getter for the (possibly nullptr) associated menu/button.
const theme::menu * toolbar_button_
Pointer to an associated menu/button, if such exists.
virtual void move(editor_display &disp, const map_location &hex)
Mouse move (not a drag).
virtual std::unique_ptr< editor_action > click_left(editor_display &disp, int x, int y)=0
A click, possibly the beginning of a drag.
Set starting position action.
bool has_ctrl_modifier() const
mouse_action(common_palette &palette, const CKey &key)
virtual std::unique_ptr< editor_action > drag_left(editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
Drag operation.
A mouse action receives events from the controller, and responds to them by creating an appropriate e...
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.
There are still moves and/or attacks possible, but the unit doesn't fit in the "unmoved" status...
Class that keeps track of all the keys on the keyboard.
virtual std::unique_ptr< editor_action > drag_right(editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
Drag operation.
bool has_alt_modifier() const