summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-14 15:56:26 +0100
committerGitHub <noreply@github.com>2021-01-14 15:56:26 +0100
commit70a70a4f2be376a26536d3829e0236dad7b143f9 (patch)
tree7c8835ac89c661ab5c559461c34909351e20a94a
parent2af5723aee3da89fb4a94f01cf0ac2ba9aa06c18 (diff)
parente94f46dcdb75f4a2b14c360e843c8bc58b8fb0e4 (diff)
Merge pull request #45161 from Xrayez/bind-emit-changed
Expose `Resource.emit_changed()` to script
-rw-r--r--core/io/resource.cpp1
-rw-r--r--doc/classes/Resource.xml13
2 files changed, 14 insertions, 0 deletions
diff --git a/core/io/resource.cpp b/core/io/resource.cpp
index 716da5e395..2c97e617f2 100644
--- a/core/io/resource.cpp
+++ b/core/io/resource.cpp
@@ -386,6 +386,7 @@ void Resource::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_local_to_scene"), &Resource::is_local_to_scene);
ClassDB::bind_method(D_METHOD("get_local_scene"), &Resource::get_local_scene);
ClassDB::bind_method(D_METHOD("setup_local_to_scene"), &Resource::setup_local_to_scene);
+ ClassDB::bind_method(D_METHOD("emit_changed"), &Resource::emit_changed);
ClassDB::bind_method(D_METHOD("duplicate", "subresources"), &Resource::duplicate, DEFVAL(false));
ADD_SIGNAL(MethodInfo("changed"));
diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml
index 0f4c170324..a9697c7fce 100644
--- a/doc/classes/Resource.xml
+++ b/doc/classes/Resource.xml
@@ -29,6 +29,19 @@
[b]Note:[/b] If [code]subresources[/code] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.
</description>
</method>
+ <method name="emit_changed">
+ <return type="void">
+ </return>
+ <description>
+ Emits the [signal changed] signal.
+ If external objects which depend on this resource should be updated, this method must be called manually whenever the state of this resource has changed (such as modification of properties).
+ The method is equivalent to:
+ [codeblock]
+ emit_signal("changed")
+ [/codeblock]
+ [b]Note:[/b] This method is called automatically for built-in resources.
+ </description>
+ </method>
<method name="get_local_scene" qualifiers="const">
<return type="Node">
</return>