diff --git a/modules/tile_map/tile_set_editor_plugin.cpp b/modules/tile_map/tile_set_editor_plugin.cpp index ab7cdee058..e58de9ff6d 100644 --- a/modules/tile_map/tile_set_editor_plugin.cpp +++ b/modules/tile_map/tile_set_editor_plugin.cpp @@ -302,6 +302,7 @@ void TileSetEditor::_bind_methods() { ClassDB::bind_method("_zoom_reset", &TileSetEditor::_zoom_reset); ClassDB::bind_method("_select_edited_shape_coord", &TileSetEditor::_select_edited_shape_coord); ClassDB::bind_method("_sort_tiles", &TileSetEditor::_sort_tiles); + ClassDB::bind_method("_on_select_context_button_pressed", &TileSetEditor::_on_select_context_button_pressed); ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &TileSetEditor::get_drag_data_fw); ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &TileSetEditor::can_drop_data_fw); @@ -435,6 +436,12 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tool_hb->add_child(tool_workspacemode[i]); } + Button *select_context_button = memnew(Button); + select_context_button->set_text("->"); + select_context_button->set_tooltip("Select TilesetEditorContext."); + select_context_button->connect("pressed", this, "_on_select_context_button_pressed"); + tool_hb->add_child(select_context_button); + Control *spacer = memnew(Control); spacer->set_h_size_flags(Control::SIZE_EXPAND_FILL); tool_hb->add_child(spacer); @@ -2412,6 +2419,10 @@ void TileSetEditor::_set_snap_sep(Vector2 p_val) { workspace->update(); } +void TileSetEditor::_on_select_context_button_pressed() { + editor->get_inspector()->edit(helper); +} + void TileSetEditor::_validate_current_tile_id() { if (get_current_tile() >= 0 && !tileset->has_tile(get_current_tile())) { set_current_tile(-1); diff --git a/modules/tile_map/tile_set_editor_plugin.h b/modules/tile_map/tile_set_editor_plugin.h index 9f5ed386c7..89eb794345 100644 --- a/modules/tile_map/tile_set_editor_plugin.h +++ b/modules/tile_map/tile_set_editor_plugin.h @@ -236,6 +236,7 @@ class TileSetEditor : public HSplitContainer { void _set_snap_step(Vector2 p_val); void _set_snap_off(Vector2 p_val); void _set_snap_sep(Vector2 p_val); + void _on_select_context_button_pressed(); void _validate_current_tile_id(); void _select_edited_shape_coord();