From 58e03e3afca9fb0f22efb4d9a2f2162a5a82bc97 Mon Sep 17 00:00:00 2001 From: FeatherAntennae Date: Sat, 11 Mar 2023 19:26:22 -0500 Subject: [PATCH] - Rebased on master - Replaced the "empty string" with "empty array" in the comment about how to report no errors. - Renamed warning variable to warnings to indicate that it can contain multiple warnings. --- tutorials/plugins/running_code_in_the_editor.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tutorials/plugins/running_code_in_the_editor.rst b/tutorials/plugins/running_code_in_the_editor.rst index cd762e176..8e5302012 100644 --- a/tutorials/plugins/running_code_in_the_editor.rst +++ b/tutorials/plugins/running_code_in_the_editor.rst @@ -268,14 +268,16 @@ By default, the warning only updates when closing and reopening the scene. func _get_configuration_warnings(): - var warning = [] - if title == "": - warning.append("Please set `title` to a non-empty value.") - if description.length() >= 100: - warning.append("`description` should be less than 100 characters long.") + var warnings = [] - # Returning an empty string means "no warning". - return warning + if title == "": + warnings.append("Please set `title` to a non-empty value.") + + if description.length() >= 100: + warnings.append("`description` should be less than 100 characters long.") + + # Returning an empty array means "no warning". + return warnings Instancing scenes -----------------