The Battle for Wesnoth  1.17.12+dev
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
editor::editor_toolkit Class Reference

#include <editor_toolkit.hpp>

Public Member Functions

 editor_toolkit (editor_display &gui, const CKey &key, const game_config_view &game_config, context_manager &c_manager)
 ~editor_toolkit ()
void adjust_size ()
void update_mouse_action_highlights ()
void set_mouseover_overlay (editor_display &gui)
void set_mouseover_overlay ()
void clear_mouseover_overlay ()
void hotkey_set_mouse_action (hotkey::HOTKEY_COMMAND command)
 Set the current mouse action based on a hotkey id. More...
bool is_mouse_action_set (hotkey::HOTKEY_COMMAND command) const
mouse_actionget_mouse_action ()
 Get the current mouse action. More...
const mouse_actionget_mouse_action () const
 Get the current mouse action. More...
common_paletteget_palette ()
 Get the current palette. More...
void cycle_brush ()
 Cycle to the next brush. More...
void set_brush (std::string id)
 TODO. More...
bool is_active_brush (std::string id) const
 TODO. More...
palette_managerget_palette_manager ()

Private Types

typedef std::map< hotkey::HOTKEY_COMMAND, std::shared_ptr< mouse_action > > mouse_action_map
 The mouse actions. More...

Private Member Functions

void init_sidebar (const game_config_view &game_config)
 init the sidebar objects More...
void init_brushes (const game_config_view &game_config)
 init the brushes More...
void init_mouse_actions (context_manager &c_manager)
 init the mouse actions (tools) More...

Private Attributes

const CKeykey_
std::unique_ptr< palette_managerpalette_manager_
std::shared_ptr< mouse_actionmouse_action_
 The current mouse action. More...
mouse_action_map mouse_actions_
 The current brush. More...
std::vector< brushbrushes_
 All available brushes. More...

Detailed Description

Definition at line 28 of file editor_toolkit.hpp.

Member Typedef Documentation

◆ mouse_action_map

The mouse actions.

Definition at line 100 of file editor_toolkit.hpp.

Constructor & Destructor Documentation

◆ editor_toolkit()

editor::editor_toolkit::editor_toolkit ( editor_display gui,
const CKey key,
const game_config_view game_config,
context_manager c_manager 

◆ ~editor_toolkit()

editor::editor_toolkit::~editor_toolkit ( )

Referenced by editor_toolkit().

Member Function Documentation

◆ adjust_size()

void editor::editor_toolkit::adjust_size ( )

Definition at line 170 of file editor_toolkit.cpp.

References palette_manager_.

◆ clear_mouseover_overlay()

void editor::editor_toolkit::clear_mouseover_overlay ( )

◆ cycle_brush()

void editor::editor_toolkit::cycle_brush ( )

Cycle to the next brush.

Definition at line 159 of file editor_toolkit.cpp.

References brush_, brushes_, and update_mouse_action_highlights().

Referenced by get_mouse_action().

◆ get_mouse_action() [1/2]

mouse_action& editor::editor_toolkit::get_mouse_action ( )

Get the current mouse action.

Definition at line 67 of file editor_toolkit.hpp.

References mouse_action_.

Referenced by get_palette(), set_mouseover_overlay(), and update_mouse_action_highlights().

◆ get_mouse_action() [2/2]

const mouse_action& editor::editor_toolkit::get_mouse_action ( ) const

Get the current mouse action.

Definition at line 69 of file editor_toolkit.hpp.

References cycle_brush(), get_palette(), mouse_action_, and set_brush().

◆ get_palette()

common_palette & editor::editor_toolkit::get_palette ( )

Get the current palette.

Definition at line 126 of file editor_toolkit.cpp.

References get_mouse_action(), and editor::mouse_action::get_palette().

Referenced by editor::palette_manager::active_palette(), and get_mouse_action().

◆ get_palette_manager()

palette_manager* editor::editor_toolkit::get_palette_manager ( )

Definition at line 84 of file editor_toolkit.hpp.

References palette_manager_.

◆ hotkey_set_mouse_action()

void editor::editor_toolkit::hotkey_set_mouse_action ( hotkey::HOTKEY_COMMAND  command)

Set the current mouse action based on a hotkey id.

Definition at line 102 of file editor_toolkit.cpp.

References ERR_ED, gui_, i, display::invalidate_game_status(), mouse_action_, mouse_actions_, palette_manager_, and set_mouseover_overlay().

Referenced by set_mouseover_overlay().

◆ init_brushes()

void editor::editor_toolkit::init_brushes ( const game_config_view game_config)

init the brushes

Definition at line 48 of file editor_toolkit.cpp.

References brush_, brushes_, game_config_view::child_range(), ERR_ED, and i.

Referenced by editor_toolkit().

◆ init_mouse_actions()

void editor::editor_toolkit::init_mouse_actions ( context_manager c_manager)

◆ init_sidebar()

void editor::editor_toolkit::init_sidebar ( const game_config_view game_config)

init the sidebar objects

Definition at line 61 of file editor_toolkit.cpp.

References gui_, and palette_manager_.

Referenced by editor_toolkit().

◆ is_active_brush()

bool editor::editor_toolkit::is_active_brush ( std::string  id) const


Definition at line 82 of file editor_toolkit.hpp.

References brush_, editor::brush::id(), and id.

◆ is_mouse_action_set()

bool editor::editor_toolkit::is_mouse_action_set ( hotkey::HOTKEY_COMMAND  command) const
true if the mouse action identified by the hotkey is active

Definition at line 120 of file editor_toolkit.cpp.

References i, mouse_action_, and mouse_actions_.

Referenced by set_mouseover_overlay().

◆ set_brush()

void editor::editor_toolkit::set_brush ( std::string  id)


Definition at line 150 of file editor_toolkit.cpp.

References brush_, brushes_, i, and id.

Referenced by get_mouse_action().

◆ set_mouseover_overlay() [1/2]

void editor::editor_toolkit::set_mouseover_overlay ( editor_display gui)

◆ set_mouseover_overlay() [2/2]

void editor::editor_toolkit::set_mouseover_overlay ( )

◆ update_mouse_action_highlights()

void editor::editor_toolkit::update_mouse_action_highlights ( )

Member Data Documentation

◆ brush_

brush* editor::editor_toolkit::brush_

The current brush.

Definition at line 106 of file editor_toolkit.hpp.

Referenced by cycle_brush(), init_brushes(), init_mouse_actions(), is_active_brush(), and set_brush().

◆ brushes_

std::vector<brush> editor::editor_toolkit::brushes_

All available brushes.

Definition at line 109 of file editor_toolkit.hpp.

Referenced by cycle_brush(), init_brushes(), and set_brush().

◆ gui_

editor_display& editor::editor_toolkit::gui_

◆ key_

const CKey& editor::editor_toolkit::key_

Definition at line 90 of file editor_toolkit.hpp.

Referenced by init_mouse_actions().

◆ mouse_action_

std::shared_ptr<mouse_action> editor::editor_toolkit::mouse_action_

The current mouse action.

Definition at line 97 of file editor_toolkit.hpp.

Referenced by get_mouse_action(), hotkey_set_mouse_action(), init_mouse_actions(), and is_mouse_action_set().

◆ mouse_actions_

mouse_action_map editor::editor_toolkit::mouse_actions_

◆ palette_manager_

std::unique_ptr<palette_manager> editor::editor_toolkit::palette_manager_

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