summaryrefslogtreecommitdiffstats
path: root/editor/plugins/texture_editor_plugin.cpp
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-02-10 17:18:45 -0300
committerreduz <reduzio@gmail.com>2021-02-10 19:31:24 -0300
commit1aa2823fa32c7a4b41d806418ec99949fc44ffb3 (patch)
tree7edbd352cf34d87b4d8e604c1730251c38131e19 /editor/plugins/texture_editor_plugin.cpp
parente8f73124a7d97abc94cea3cf7fe5b5614f61a448 (diff)
downloadredot-engine-1aa2823fa32c7a4b41d806418ec99949fc44ffb3.tar.gz
Removed _change_notify
-For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
Diffstat (limited to 'editor/plugins/texture_editor_plugin.cpp')
-rw-r--r--editor/plugins/texture_editor_plugin.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index 1d3fd668c6..253f8878d2 100644
--- a/editor/plugins/texture_editor_plugin.cpp
+++ b/editor/plugins/texture_editor_plugin.cpp
@@ -104,7 +104,7 @@ void TextureEditor::_notification(int p_what) {
}
}
-void TextureEditor::_changed_callback(Object *p_changed, const char *p_prop) {
+void TextureEditor::_texture_changed() {
if (!is_visible()) {
return;
}
@@ -113,13 +113,13 @@ void TextureEditor::_changed_callback(Object *p_changed, const char *p_prop) {
void TextureEditor::edit(Ref<Texture2D> p_texture) {
if (!texture.is_null()) {
- texture->remove_change_receptor(this);
+ texture->disconnect("changed", callable_mp(this, &TextureEditor::_texture_changed));
}
texture = p_texture;
if (!texture.is_null()) {
- texture->add_change_receptor(this);
+ texture->connect("changed", callable_mp(this, &TextureEditor::_texture_changed));
update();
} else {
hide();
@@ -137,7 +137,7 @@ TextureEditor::TextureEditor() {
TextureEditor::~TextureEditor() {
if (!texture.is_null()) {
- texture->remove_change_receptor(this);
+ texture->disconnect("changed", callable_mp(this, &TextureEditor::_texture_changed));
}
}