@@ -198,16 +198,24 @@ Editor::Editor() :
198
198
m_widgets.insert (m_widgets.begin () + 5 , std::move (mode_button));
199
199
200
200
auto select_mode_mouse_button = std::make_unique<ButtonWidget>(
201
- " images/engine/editor/select-mode0.png" , Vector (192 , 0 ), [] {});
201
+ " images/engine/editor/select-mode0.png" , Vector (192 , 0 ), [this ] {
202
+ m_toolbox_widget->set_tileselect_select_mode (0 );
203
+ });
202
204
select_mode_mouse_button->set_help_text (_ (" Draw mode (The current tool applies to the tile under the mouse)" ));
203
205
auto select_mode_area_button = std::make_unique<ButtonWidget>(
204
- " images/engine/editor/select-mode1.png" , Vector (224 , 0 ), [] {});
206
+ " images/engine/editor/select-mode1.png" , Vector (224 , 0 ), [this ] {
207
+ m_toolbox_widget->set_tileselect_select_mode (1 );
208
+ });
205
209
select_mode_area_button->set_help_text (_ (" Box draw mode (The current tool applies to an area / box drawn with the mouse)" ));
206
210
auto select_mode_fill_button = std::make_unique<ButtonWidget>(
207
- " images/engine/editor/select-mode2.png" , Vector (256 , 0 ), [] {});
211
+ " images/engine/editor/select-mode2.png" , Vector (256 , 0 ), [this ] {
212
+ m_toolbox_widget->set_tileselect_select_mode (2 );
213
+ });
208
214
select_mode_fill_button->set_help_text (_ (" Fill mode (The current tool applies to the empty area in the enclosed space that was clicked)" ));
209
215
auto select_mode_same_button = std::make_unique<ButtonWidget>(
210
- " images/engine/editor/select-mode3.png" , Vector (288 , 0 ), [] {});
216
+ " images/engine/editor/select-mode3.png" , Vector (288 , 0 ), [this ] {
217
+ m_toolbox_widget->set_tileselect_select_mode (3 );
218
+ });
211
219
select_mode_same_button->set_help_text (_ (" Replace mode (The current tool applies to all tiles that are the same tile as the one under the mouse)" ));
212
220
213
221
m_widgets.insert (m_widgets.begin () + 6 , std::move (select_mode_mouse_button));
0 commit comments