summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-22 12:42:09 +0200
committerGitHub <noreply@github.com>2019-10-22 12:42:09 +0200
commit3aa5b54330adf334c868a6ec53d5b5450689506c (patch)
tree26e673a061e89ad8421e5abe10bfd5170c8419b8
parentd54f76c13237f944666543fc2c9a6a6ea9dfb945 (diff)
parent139c0a4afe5c1de7ada982928438650070866847 (diff)
Merge pull request #32889 from nekomatata/node-update-config-warning
Expose Node::update_configuration_warning() to scripts
-rw-r--r--doc/classes/Node.xml11
-rw-r--r--scene/main/node.cpp2
2 files changed, 12 insertions, 1 deletions
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index b206d4a4d2..1f685aab81 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -40,8 +40,9 @@
<return type="String">
</return>
<description>
- The string returned from this method is displayed as a warning in the "Scene Dock" if the script that overrides it is a [code]tool[/code] script.
+ The string returned from this method is displayed as a warning in the Scene Dock if the script that overrides it is a [code]tool[/code] script.
Returning an empty string produces no warning.
+ Call [method update_configuration_warning] when the warning needs to be updated for this node.
</description>
</method>
<method name="_input" qualifiers="virtual">
@@ -818,6 +819,14 @@
Sets whether this is an instance load placeholder. See [InstancePlaceholder].
</description>
</method>
+ <method name="update_configuration_warning">
+ <return type="void">
+ </return>
+ <description>
+ Updates the warning displayed for this node in the Scene Dock.
+ Use [method _get_configuration_warning] to setup the warning message to display.
+ </description>
+ </method>
</methods>
<members>
<member name="custom_multiplayer" type="MultiplayerAPI" setter="set_custom_multiplayer" getter="get_custom_multiplayer">
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 7b6c90766f..217dacfbfe 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2832,6 +2832,8 @@ void Node::_bind_methods() {
ClassDB::bind_method(D_METHOD("rset_unreliable", "property", "value"), &Node::rset_unreliable);
ClassDB::bind_method(D_METHOD("rset_unreliable_id", "peer_id", "property", "value"), &Node::rset_unreliable_id);
+ ClassDB::bind_method(D_METHOD("update_configuration_warning"), &Node::update_configuration_warning);
+
BIND_CONSTANT(NOTIFICATION_ENTER_TREE);
BIND_CONSTANT(NOTIFICATION_EXIT_TREE);
BIND_CONSTANT(NOTIFICATION_MOVED_IN_PARENT);