From e9035f7cf09f12b05f0200c98fc015cc8fdfe463 Mon Sep 17 00:00:00 2001 From: DDoop <59840876+DDoop@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:42:36 -0700 Subject: [PATCH] Add warnings for classes named "Editor" in GDscript and C# pages, class_name keyword/global class attribute (#9548) * Added warning about Editor hiding class_names beginning with Editor prefix --------- Co-authored-by: Max Hilbrunner --- tutorials/scripting/c_sharp/c_sharp_global_classes.rst | 9 +++++++++ tutorials/scripting/gdscript/gdscript_basics.rst | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/tutorials/scripting/c_sharp/c_sharp_global_classes.rst b/tutorials/scripting/c_sharp/c_sharp_global_classes.rst index 9983dcab2..8336c4347 100644 --- a/tutorials/scripting/c_sharp/c_sharp_global_classes.rst +++ b/tutorials/scripting/c_sharp/c_sharp_global_classes.rst @@ -80,3 +80,12 @@ will let you create and load instances of this type easily. .. image:: img/globalclasses_exportedproperty1.webp .. image:: img/globalclasses_exportedproperty2.webp + +.. warning:: + + The Godot editor will hide these custom classes with names that beging with the prefix + "Editor" in the 'Create New Node' or 'Create New Scene' dialog windows. The classes + are available for instantiation at runtime via their class names, but are + automatically hidden by the editor windows along with the built-in editor nodes used + by the Godot editor. + diff --git a/tutorials/scripting/gdscript/gdscript_basics.rst b/tutorials/scripting/gdscript/gdscript_basics.rst index 103b5b396..0f1451799 100644 --- a/tutorials/scripting/gdscript/gdscript_basics.rst +++ b/tutorials/scripting/gdscript/gdscript_basics.rst @@ -1888,6 +1888,14 @@ If you want to use ``extends`` too, you can keep both on the same line:: and this includes arrays and dictionaries. This is in the spirit of thread safety, since scripts can be initialized in separate threads without the user knowing. +.. warning:: + + The Godot editor will hide these custom classes with names that beging with the prefix + "Editor" in the 'Create New Node' or 'Create New Scene' dialog windows. The classes + are available for instantiation at runtime via their class names, but are + automatically hidden by the editor windows along with the built-in editor nodes used + by the Godot editor. + Inheritance ^^^^^^^^^^^