The Battle for Wesnoth  1.15.1+dev
Public Member Functions | List of all members
editor::mouse_action_village Class Reference

Editor mouse action class. More...

#include <mouse_action_village.hpp>

Inheritance diagram for editor::mouse_action_village:
Inheritance graph

Public Member Functions

 mouse_action_village (const CKey &key, empty_palette &palette)
 
editor_actionclick_left (editor_display &, int, int)
 No action. More...
 
editor_actionup_left (editor_display &disp, int x, int y)
 If clicked on a village hex field, assigns the ownership of it to the current side. More...
 
editor_actionclick_right (editor_display &, int, int)
 No action. More...
 
editor_actionup_right (editor_display &disp, int x, int y)
 If clicked on a village hex field, unassigns it's ownership. 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_locationaffected_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_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_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 () const
 Whether we need the brush bar, is used to grey it out. 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::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::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

Editor mouse action class.

Called by the editor tool to assign village ownership to defined sides.

Definition at line 28 of file mouse_action_village.hpp.

Constructor & Destructor Documentation

◆ mouse_action_village()

editor::mouse_action_village::mouse_action_village ( const CKey key,
empty_palette palette 
)
inline

Definition at line 31 of file mouse_action_village.hpp.

Member Function Documentation

◆ click_left()

editor_action* editor::mouse_action_village::click_left ( editor_display ,
int  ,
int   
)
inlinevirtual

No action.

Implements editor::mouse_action.

Definition at line 39 of file mouse_action_village.hpp.

References up_left().

◆ click_right()

editor_action* editor::mouse_action_village::click_right ( editor_display ,
int  ,
int   
)
inlinevirtual

No action.

Implements editor::mouse_action.

Definition at line 49 of file mouse_action_village.hpp.

References set_mouse_overlay(), and up_right().

◆ set_mouse_overlay()

void editor::mouse_action_village::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 40 of file mouse_action_village.cpp.

References adjust_surface_alpha(), image::get_image(), display::get_zoom_factor(), scale_surface(), sdl_blit(), display::set_mouseover_hex_overlay(), and utf8::size().

Referenced by click_right().

◆ up_left()

editor_action * editor::mouse_action_village::up_left ( editor_display disp,
int  x,
int  y 
)
virtual

If clicked on a village hex field, assigns the ownership of it to the current side.

Reimplemented from editor::mouse_action.

Definition at line 22 of file mouse_action_village.cpp.

References display::get_map(), display::hex_clicked_on(), gamemap::is_village(), gamemap::on_board(), and display::playing_team().

Referenced by click_left().

◆ up_right()

editor_action * editor::mouse_action_village::up_right ( editor_display disp,
int  x,
int  y 
)
virtual

If clicked on a village hex field, unassigns it's ownership.

Reimplemented from editor::mouse_action.

Definition at line 31 of file mouse_action_village.cpp.

References display::get_map(), display::hex_clicked_on(), gamemap::is_village(), and gamemap::on_board().

Referenced by click_right().


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