From db45a5378b97c24bd5ca68f3eb8718cdfa3d211e Mon Sep 17 00:00:00 2001 From: Daniel Delgado Date: Mon, 10 Apr 2023 12:13:12 +0200 Subject: [PATCH] Fixed 'Reporting node configuration warnings' code snippet - Switched .size for .length - initialized warnings as empty array - warning.append instead of += - deleted new line --- tutorials/plugins/running_code_in_the_editor.rst | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tutorials/plugins/running_code_in_the_editor.rst b/tutorials/plugins/running_code_in_the_editor.rst index 2378261d1..4285afb96 100644 --- a/tutorials/plugins/running_code_in_the_editor.rst +++ b/tutorials/plugins/running_code_in_the_editor.rst @@ -267,15 +267,12 @@ By default, the warning only updates when closing and reopening the scene. update_configuration_warnings() - func _get_configuration_warning(): - var warning = "" + func _get_configuration_warnings(): + var warning = [] if title == "": - warning += "Please set `title` to a non-empty value." - if description.size() >= 100: - # Add a blank line between each warning to distinguish them individually. - if warning != "": - warning += "\n" - warning += "`description` should be less than 100 characters long." + warning.append("Please set `title` to a non-empty value.") + if description.length() >= 100: + warning.append("`description` should be less than 100 characters long.") # Returning an empty string means "no warning". return warning