The Battle for Wesnoth  1.19.0-dev
Public Member Functions | List of all members
editor::mouse_action_select Class Reference

Select (and deselect) action, by brush or "magic wand" (via keyboard modifier) More...

#include <mouse_action_select.hpp>

Inheritance diagram for editor::mouse_action_select:

Public Member Functions

 mouse_action_select (const brush *const *const brush, const CKey &key, empty_palette &palette)
 
std::set< map_locationaffected_hexes (editor_display &disp, const map_location &hex) override
 Overridden to allow special behavior based on modifier keys. More...
 
std::unique_ptr< editor_actionkey_event (editor_display &disp, const SDL_Event &e) override
 Force a fake "move" event to update brush overlay on key event. More...
 
std::unique_ptr< editor_actionclick_perform_left (editor_display &disp, const std::set< map_location > &hexes) override
 Left click/drag selects. More...
 
std::unique_ptr< editor_actionclick_right (editor_display &disp, int x, int y) override
 Right click does nothing for now. More...
 
std::unique_ptr< editor_actionclick_perform_right (editor_display &disp, const std::set< map_location > &hexes) override
 Right click/drag. More...
 
virtual void set_mouse_overlay (editor_display &disp) override
 Set the mouse overlay for this action. More...
 
virtual bool has_context_menu () const override
 
virtual bool supports_brushes () const override
 Whether we need the brush bar, is used to grey it out. More...
 
- Public Member Functions inherited from editor::brush_drag_mouse_action
 brush_drag_mouse_action (common_palette &palette, const brush *const *const brush, const CKey &key)
 
std::unique_ptr< editor_actionclick_left (editor_display &disp, int x, int y)
 Calls click_perform_left() More...
 
std::unique_ptr< editor_actiondrag_left (editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
 Calls click_perform() for every new hex the mouse is dragged into. More...
 
std::unique_ptr< editor_actiondrag_right (editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
 Calls click_perform for every new hex the mouse is dragged into. More...
 
std::unique_ptr< editor_actiondrag_end (editor_display &disp, int x, int y)
 End of dragging. More...
 
- Public Member Functions inherited from editor::mouse_action
 mouse_action (common_palette &palette, const CKey &key)
 
virtual ~mouse_action ()
 
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::unique_ptr< editor_actiondrag_end_left (editor_display &disp, int x, int y)
 The end of dragging. More...
 
virtual std::unique_ptr< editor_actiondrag_end_right (editor_display &disp, int x, int y)
 
virtual std::unique_ptr< editor_actionup_left (editor_display &disp, int x, int y)
 
virtual std::unique_ptr< editor_actionup_right (editor_display &disp, int x, int y)
 
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::menutoolbar_button () const
 Getter for the (possibly nullptr) associated menu/button. More...
 
common_paletteget_palette ()
 Getter for the associated palette. More...
 

Additional Inherited Members

- Protected Member Functions inherited from editor::brush_drag_mouse_action
const brushget_brush ()
 Brush accessor. More...
 
- 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::terrain_code &fg, const t_translation::terrain_code &bg)
 Helper function for derived classes that need a active-terrain mouse overlay. More...
 
- Protected Attributes inherited from editor::brush_drag_mouse_action
map_location previous_drag_hex_
 The previous hex dragged into. More...
 
- Protected Attributes inherited from editor::mouse_action
map_location previous_move_hex_
 The hex previously used in move operations. More...
 
const CKeykey_
 Key presses, used for modifiers (alt, shift) in some operations. More...
 

Detailed Description

Select (and deselect) action, by brush or "magic wand" (via keyboard modifier)

Definition at line 27 of file mouse_action_select.hpp.

Constructor & Destructor Documentation

◆ mouse_action_select()

editor::mouse_action_select::mouse_action_select ( const brush *const *const  brush,
const CKey key,
empty_palette palette 
)
inline

Definition at line 30 of file mouse_action_select.hpp.

Member Function Documentation

◆ affected_hexes()

std::set< map_location > editor::mouse_action_select::affected_hexes ( editor_display disp,
const map_location hex 
)
overridevirtual

◆ click_perform_left()

std::unique_ptr< editor_action > editor::mouse_action_select::click_perform_left ( editor_display disp,
const std::set< map_location > &  hexes 
)
overridevirtual

Left click/drag selects.

Implements editor::brush_drag_mouse_action.

Definition at line 41 of file mouse_action_select.cpp.

References editor::mouse_action::has_ctrl_modifier().

◆ click_perform_right()

std::unique_ptr< editor_action > editor::mouse_action_select::click_perform_right ( editor_display disp,
const std::set< map_location > &  hexes 
)
overridevirtual

Right click/drag.

Implements editor::brush_drag_mouse_action.

Definition at line 52 of file mouse_action_select.cpp.

◆ click_right()

std::unique_ptr< editor_action > editor::mouse_action_select::click_right ( editor_display disp,
int  x,
int  y 
)
overridevirtual

Right click does nothing for now.

Reimplemented from editor::brush_drag_mouse_action.

Definition at line 58 of file mouse_action_select.cpp.

◆ has_context_menu()

virtual bool editor::mouse_action_select::has_context_menu ( ) const
inlineoverridevirtual

Reimplemented from editor::mouse_action.

Definition at line 63 of file mouse_action_select.hpp.

◆ key_event()

std::unique_ptr< editor_action > editor::mouse_action_select::key_event ( editor_display disp,
const SDL_Event &  e 
)
overridevirtual

Force a fake "move" event to update brush overlay on key event.

Reimplemented from editor::mouse_action.

Definition at line 33 of file mouse_action_select.cpp.

References editor::mouse_action::key_event(), editor::mouse_action::previous_move_hex_, and editor::mouse_action::update_brush_highlights().

◆ set_mouse_overlay()

void editor::mouse_action_select::set_mouse_overlay ( editor_display disp)
overridevirtual

Set the mouse overlay for this action.

Defaults to an empty overlay.

Reimplemented from editor::mouse_action.

Definition at line 63 of file mouse_action_select.cpp.

References image::get_texture(), editor::mouse_action::has_shift_modifier(), and editor::editor_display::set_mouseover_hex_overlay().

◆ supports_brushes()

virtual bool editor::mouse_action_select::supports_brushes ( ) const
inlineoverridevirtual

Whether we need the brush bar, is used to grey it out.

Reimplemented from editor::mouse_action.

Definition at line 64 of file mouse_action_select.hpp.


The documentation for this class was generated from the following files: