aboutsummaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde2018-01-11 11:15:42 +0100
committerGitHub2018-01-11 11:15:42 +0100
commit2c17af050935bccf17deb6e6489ade64c0af2f73 (patch)
tree10e52f8ead0b27d9225d2823d0f383c03e11ce6c /editor
parent6f75866aef113bf776f5df3cc664f872fdb37212 (diff)
parentbea40343ab347d4819922e009a5b738dead057fc (diff)
downloadgodot-2c17af050935bccf17deb6e6489ade64c0af2f73.tar.gz
godot-2c17af050935bccf17deb6e6489ade64c0af2f73.tar.zst
godot-2c17af050935bccf17deb6e6489ade64c0af2f73.zip
Merge pull request #15579 from damarindra/add-receptor-tileset
fix updating tileset list when assign texture and set autotile true
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp9
-rw-r--r--editor/plugins/tile_set_editor_plugin.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 08679b781..612bdb1d2 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 9bd3e2318..93d403dee 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);