3333#include " video/video_system.hpp"
3434#include " video/viewport.hpp"
3535
36+ using InputType = EditorTilebox::InputType;
37+
3638EditorToolboxWidget::EditorToolboxWidget (Editor& editor) :
3739 m_editor(editor),
3840 m_tilebox(new EditorTilebox(editor, Rectf())),
@@ -82,12 +84,12 @@ EditorToolboxWidget::draw(DrawingContext& context)
8284 m_undo_mode->draw (context);
8385 switch (m_tilebox->get_input_type ())
8486 {
85- case EditorTilebox:: InputType::TILE:
87+ case InputType::TILE:
8688 m_select_mode->draw (context);
8789 break ;
8890
89- case EditorTilebox:: InputType::NONE:
90- case EditorTilebox:: InputType::OBJECT:
91+ case InputType::NONE:
92+ case InputType::OBJECT:
9193 m_node_marker_mode->draw (context);
9294 m_move_mode->draw (context);
9395 break ;
@@ -158,11 +160,11 @@ EditorToolboxWidget::on_mouse_button_down(const SDL_MouseButtonEvent& button)
158160 case 1 :
159161 switch (m_tilebox->get_input_type ())
160162 {
161- case EditorTilebox:: InputType::TILE:
163+ case InputType::TILE:
162164 m_select_mode->next_mode ();
163165 break ;
164- case EditorTilebox:: InputType::NONE:
165- case EditorTilebox:: InputType::OBJECT:
166+ case InputType::NONE:
167+ case InputType::OBJECT:
166168 m_tilebox->set_object (" #node" );
167169 break ;
168170 default :
@@ -172,8 +174,8 @@ EditorToolboxWidget::on_mouse_button_down(const SDL_MouseButtonEvent& button)
172174 break ;
173175
174176 case 2 :
175- if (m_tilebox->get_input_type () == EditorTilebox:: InputType::OBJECT ||
176- m_tilebox->get_input_type () == EditorTilebox:: InputType::NONE)
177+ if (m_tilebox->get_input_type () == InputType::OBJECT ||
178+ m_tilebox->get_input_type () == InputType::NONE)
177179 m_move_mode->next_mode ();
178180 update_mouse_icon ();
179181 break ;
@@ -344,29 +346,29 @@ EditorToolboxWidget::get_hovered_item_rect() const
344346void
345347EditorToolboxWidget::update_mouse_icon ()
346348{
347- MouseCursor::current ()->set_icon (get_mouse_icon ());
349+ MouseCursor::current ()->set_icon (get_mouse_icon ()-> get_current_surface () );
348350}
349351
350- SurfacePtr
352+ ToolIcon*
351353EditorToolboxWidget::get_mouse_icon () const
352354{
353355 switch (m_tilebox->get_input_type ())
354356 {
355- case EditorTilebox:: InputType::NONE:
356- case EditorTilebox:: InputType::OBJECT:
357+ case InputType::NONE:
358+ case InputType::OBJECT:
357359 {
358360 const std::string object = m_tilebox->get_object ();
359361
360362 if (object.empty ())
361- return m_rubber-> get_current_surface ();
363+ return m_rubber. get ();
362364 if (object == " #node" )
363- return m_node_marker_mode-> get_current_surface ();
365+ return m_node_marker_mode. get ();
364366
365- return m_move_mode-> get_current_surface ();
367+ return m_move_mode. get ();
366368 }
367369
368- case EditorTilebox:: InputType::TILE:
369- return m_select_mode-> get_current_surface ();
370+ case InputType::TILE:
371+ return m_select_mode. get ();
370372
371373 default :
372374 return nullptr ;
0 commit comments