summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-04-02 17:35:03 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-04-02 17:35:03 +0200
commitdf7834ac96398da0cb6b09f77ec010d4dff467f7 (patch)
treeb681fc7d37a00147bdbf51ec672b0c341081a640
parent726c3c1bed20886608947a9ce50c0bfdcca42a49 (diff)
parentc4e08a4e1ac736c27d8b803c233d673f3fabf10a (diff)
downloadredot-engine-df7834ac96398da0cb6b09f77ec010d4dff467f7.tar.gz
Merge pull request #75591 from KoBeWi/how_to_spam_people_with_warnings_correctly
Add `_get_configuration_warnings()` example
-rw-r--r--doc/classes/Node.xml12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 3146b9d3af..1044e8af02 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -42,6 +42,18 @@
The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a [code]tool[/code] script.
Returning an empty array produces no warnings.
Call [method update_configuration_warnings] when the warnings need to be updated for this node.
+ [codeblock]
+ @export var energy = 0:
+ set(value):
+ energy = value
+ update_configuration_warnings()
+
+ func _get_configuration_warnings():
+ if energy &lt; 0:
+ return ["Energy must be 0 or greater."]
+ else:
+ return []
+ [/codeblock]
</description>
</method>
<method name="_input" qualifiers="virtual">