#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_action & | get_mouse_action () |
Get the current mouse action. More... | |
const mouse_action & | get_mouse_action () const |
Get the current mouse action. More... | |
common_palette & | get_palette () |
Get the current palette. More... | |
void | cycle_brush () |
Cycle to the next brush. More... | |
void | set_brush (std::string id) |
bool | is_active_brush (std::string id) const |
palette_manager * | get_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 | |
editor_display & | gui_ |
const CKey & | key_ |
std::unique_ptr< palette_manager > | palette_manager_ |
std::shared_ptr< mouse_action > | mouse_action_ |
The current mouse action. More... | |
mouse_action_map | mouse_actions_ |
brush * | brush_ |
The current brush. More... | |
std::vector< brush > | brushes_ |
All available brushes. More... | |
Definition at line 27 of file editor_toolkit.hpp.
|
private |
The mouse actions.
Definition at line 97 of file editor_toolkit.hpp.
editor::editor_toolkit::editor_toolkit | ( | editor_display & | gui, |
const CKey & | key, | ||
const game_config_view & | game_config, | ||
context_manager & | c_manager | ||
) |
Definition at line 31 of file editor_toolkit.cpp.
References init_brushes(), init_mouse_actions(), and init_sidebar().
|
default |
void editor::editor_toolkit::adjust_size | ( | ) |
Definition at line 169 of file editor_toolkit.cpp.
References palette_manager_.
void editor::editor_toolkit::clear_mouseover_overlay | ( | ) |
Definition at line 144 of file editor_toolkit.cpp.
References editor::editor_display::clear_mouseover_hex_overlay(), and gui_.
void editor::editor_toolkit::cycle_brush | ( | ) |
Cycle to the next brush.
Definition at line 158 of file editor_toolkit.cpp.
References brush_, brushes_, and update_mouse_action_highlights().
|
inline |
Get the current mouse action.
Definition at line 66 of file editor_toolkit.hpp.
References mouse_action_.
Referenced by get_palette(), set_mouseover_overlay(), and update_mouse_action_highlights().
|
inline |
Get the current mouse action.
Definition at line 68 of file editor_toolkit.hpp.
References mouse_action_.
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().
|
inline |
Definition at line 81 of file editor_toolkit.hpp.
References palette_manager_.
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().
|
private |
init the brushes
Definition at line 48 of file editor_toolkit.cpp.
References brush_, brushes_, ERR_ED, and i.
Referenced by editor_toolkit().
|
private |
init the mouse actions (tools)
Definition at line 66 of file editor_toolkit.cpp.
References brush_, hotkey::hotkey_command::command, editor::context_manager::get_clipboard(), hotkey::get_hotkey_command(), display::get_theme(), gui_, hotkey::HOTKEY_EDITOR_CLIPBOARD_PASTE, hotkey::HOTKEY_EDITOR_TOOL_FILL, hotkey::HOTKEY_EDITOR_TOOL_ITEM, hotkey::HOTKEY_EDITOR_TOOL_LABEL, hotkey::HOTKEY_EDITOR_TOOL_PAINT, hotkey::HOTKEY_EDITOR_TOOL_SELECT, hotkey::HOTKEY_EDITOR_TOOL_STARTING_POSITION, hotkey::HOTKEY_EDITOR_TOOL_UNIT, hotkey::HOTKEY_EDITOR_TOOL_VILLAGE, i, key_, theme::menus(), mouse_action_, mouse_actions_, palette_manager_, and set_mouseover_overlay().
Referenced by editor_toolkit().
|
private |
init the sidebar objects
Definition at line 61 of file editor_toolkit.cpp.
References gui_, and palette_manager_.
Referenced by editor_toolkit().
|
inline |
Definition at line 79 of file editor_toolkit.hpp.
References brush_, editor::brush::id(), and id.
bool editor::editor_toolkit::is_mouse_action_set | ( | hotkey::HOTKEY_COMMAND | command | ) | const |
Definition at line 120 of file editor_toolkit.cpp.
References i, mouse_action_, and mouse_actions_.
void editor::editor_toolkit::set_brush | ( | std::string | id | ) |
Definition at line 149 of file editor_toolkit.cpp.
|
inline |
Definition at line 51 of file editor_toolkit.hpp.
References gui_, and set_mouseover_overlay().
Referenced by hotkey_set_mouse_action(), init_mouse_actions(), and set_mouseover_overlay().
void editor::editor_toolkit::set_mouseover_overlay | ( | editor_display & | gui | ) |
Definition at line 139 of file editor_toolkit.cpp.
References get_mouse_action(), and editor::mouse_action::set_mouse_overlay().
Referenced by editor::location_palette::layout().
void editor::editor_toolkit::update_mouse_action_highlights | ( | ) |
Definition at line 131 of file editor_toolkit.cpp.
References DBG_ED, get_mouse_action(), sdl::get_mouse_location(), gui_, display::hex_clicked_on(), and editor::mouse_action::update_brush_highlights().
Referenced by cycle_brush().
|
private |
The current brush.
Definition at line 103 of file editor_toolkit.hpp.
Referenced by cycle_brush(), init_brushes(), init_mouse_actions(), is_active_brush(), and set_brush().
|
private |
All available brushes.
Definition at line 106 of file editor_toolkit.hpp.
Referenced by cycle_brush(), init_brushes(), and set_brush().
|
private |
Definition at line 85 of file editor_toolkit.hpp.
Referenced by clear_mouseover_overlay(), hotkey_set_mouse_action(), init_mouse_actions(), init_sidebar(), set_mouseover_overlay(), and update_mouse_action_highlights().
|
private |
Definition at line 87 of file editor_toolkit.hpp.
Referenced by init_mouse_actions().
|
private |
The current mouse action.
Definition at line 94 of file editor_toolkit.hpp.
Referenced by get_mouse_action(), hotkey_set_mouse_action(), init_mouse_actions(), and is_mouse_action_set().
|
private |
Definition at line 98 of file editor_toolkit.hpp.
Referenced by hotkey_set_mouse_action(), init_mouse_actions(), and is_mouse_action_set().
|
private |
Definition at line 89 of file editor_toolkit.hpp.
Referenced by adjust_size(), get_palette_manager(), hotkey_set_mouse_action(), init_mouse_actions(), and init_sidebar().