The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Attributes | List of all members
editor::mouse_action_fill Class Reference

Fill action. More...

#include <mouse_action.hpp>

Inheritance diagram for editor::mouse_action_fill:
Inheritance graph

Public Member Functions

 mouse_action_fill (const CKey &key, terrain_palette &terrain_palette)
 
std::set< map_locationaffected_hexes (editor_display &disp, const map_location &hex)
 Tiles that will be painted to, possibly use modifier keys here. More...
 
editor_actionclick_left (editor_display &disp, int x, int y)
 Left / right click fills with the respective terrain. More...
 
editor_actionclick_right (editor_display &disp, int x, int y)
 Left / right click fills with the respective terrain. 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 editor_actiondrag_left (editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
 Drag operation. More...
 
virtual editor_actiondrag_right (editor_display &disp, int x, int y, bool &partial, editor_action *last_undo)
 Drag operation. More...
 
virtual editor_actiondrag_end_left (editor_display &disp, int x, int y)
 The end of dragging. More...
 
virtual editor_actiondrag_end_right (editor_display &disp, int x, int y)
 
virtual editor_actionup_left (editor_display &disp, int x, int y)
 
virtual editor_actionup_right (editor_display &disp, int x, int y)
 
virtual editor_actionkey_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::menutoolbar_button () const
 Getter for the (possibly nullptr) associated menu/button. More...
 
common_paletteget_palette ()
 Getter for the associated palette. More...
 
virtual bool supports_brushes ()
 Whether we need the brush bar, is used to grey it out. More...
 

Protected Attributes

terrain_paletteterrain_palette_
 
- 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...
 

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...
 

Detailed Description

Fill action.

No dragging capabilities. Uses keyboard modifiers for one-layer painting.

Definition at line 334 of file mouse_action.hpp.

Constructor & Destructor Documentation

editor::mouse_action_fill::mouse_action_fill ( const CKey key,
terrain_palette terrain_palette 
)
inline

Definition at line 337 of file mouse_action.hpp.

Member Function Documentation

std::set< map_location > editor::mouse_action_fill::affected_hexes ( editor_display disp,
const map_location hex 
)
virtual

Tiles that will be painted to, possibly use modifier keys here.

Reimplemented from editor::mouse_action.

Definition at line 351 of file mouse_action.cpp.

References editor::editor_map::get_contiguous_terrain_tiles(), and editor::editor_display::map().

editor_action * editor::mouse_action_fill::click_left ( editor_display disp,
int  x,
int  y 
)
virtual

Left / right click fills with the respective terrain.

Todo:
only take the base terrain into account when searching for contiguous terrain when painting base only

Implements editor::mouse_action.

Definition at line 357 of file mouse_action.cpp.

References gamemap::get_terrain(), editor::mouse_action::has_ctrl_modifier(), editor::mouse_action::has_shift_modifier(), display::hex_clicked_on(), editor::editor_display::map(), editor::terrain_palette::select_fg_item(), editor::terrain_palette::selected_fg_item(), and terrain_palette_.

editor_action * editor::mouse_action_fill::click_right ( editor_display disp,
int  x,
int  y 
)
virtual

Left / right click fills with the respective terrain.

Todo:
only take the base terrain into account when searching for contiguous terrain when painting base only

Implements editor::mouse_action.

Definition at line 372 of file mouse_action.cpp.

References gamemap::get_terrain(), editor::mouse_action::has_ctrl_modifier(), editor::mouse_action::has_shift_modifier(), display::hex_clicked_on(), editor::editor_display::map(), editor::terrain_palette::select_bg_item(), editor::terrain_palette::selected_bg_item(), and terrain_palette_.

void editor::mouse_action_fill::set_mouse_overlay ( editor_display disp)
virtual

Set the mouse overlay for this action.

Defaults to an empty overlay.

Reimplemented from editor::mouse_action.

Definition at line 387 of file mouse_action.cpp.

References editor::terrain_palette::selected_bg_item(), editor::terrain_palette::selected_fg_item(), editor::mouse_action::set_terrain_mouse_overlay(), and terrain_palette_.

Member Data Documentation

terrain_palette& editor::mouse_action_fill::terrain_palette_
protected

Definition at line 362 of file mouse_action.hpp.

Referenced by click_left(), click_right(), and set_mouse_overlay().


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