diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 9 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.h | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 535ce79b30..b677017371 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -3915,7 +3915,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) { if (d.has("snap_enabled")) { snap_enabled = d["snap_enabled"]; - tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_pressed(d["snap_enabled"]); + tool_option_button[TOOL_OPT_USE_SNAP]->set_pressed(d["snap_enabled"]); } if (d.has("translate_snap")) diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 08679b781a..612bdb1d2a 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -583,6 +583,14 @@ void AutotileEditor::_notification(int p_what) { } } +void AutotileEditor::_changed_callback(Object *p_changed, const char *p_prop) { + if (p_prop == StringName("texture") || p_prop == StringName("is_autotile")) { + edit(tile_set.ptr()); + autotile_list->update(); + workspace->update(); + } +} + void AutotileEditor::_on_autotile_selected(int p_index) { if (get_current_tile() >= 0) { @@ -1581,6 +1589,7 @@ Vector2 AutotileEditor::snap_point(const Vector2 &point) { void AutotileEditor::edit(Object *p_node) { tile_set = Ref<TileSet>(Object::cast_to<TileSet>(p_node)); + tile_set->add_change_receptor(this); helper->set_tileset(tile_set); autotile_list->clear(); diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h index 9bd3e23181..93d403deea 100644 --- a/editor/plugins/tile_set_editor_plugin.h +++ b/editor/plugins/tile_set_editor_plugin.h @@ -124,6 +124,7 @@ class AutotileEditor : public Control { protected: static void _bind_methods(); void _notification(int p_what); + virtual void _changed_callback(Object *p_changed, const char *p_prop); private: void _on_autotile_selected(int p_index); |