From 49d3e3e714e9ab81d2a18ed75fd9e1d0b0609403 Mon Sep 17 00:00:00 2001 From: skyace65 Date: Fri, 15 Mar 2024 21:10:15 -0400 Subject: [PATCH] add more tool script info and add a section --- tutorials/plugins/editor/making_plugins.rst | 2 +- .../plugins/running_code_in_the_editor.rst | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tutorials/plugins/editor/making_plugins.rst b/tutorials/plugins/editor/making_plugins.rst index 82dcca8d9..9f5eac232 100644 --- a/tutorials/plugins/editor/making_plugins.rst +++ b/tutorials/plugins/editor/making_plugins.rst @@ -96,7 +96,7 @@ editor, and it must inherit from :ref:`class_EditorPlugin`. .. warning:: In addition to the EditorPlugin script, any other GDScript that your plugin uses - must *also* be a tool. Any GDScript without ``@tool`` imported into the editor + must *also* be a tool. Any GDScript without ``@tool`` used by the editor will act like an empty file! It's important to deal with initialization and clean-up of resources. diff --git a/tutorials/plugins/running_code_in_the_editor.rst b/tutorials/plugins/running_code_in_the_editor.rst index b957d7047..768c8a7dc 100644 --- a/tutorials/plugins/running_code_in_the_editor.rst +++ b/tutorials/plugins/running_code_in_the_editor.rst @@ -105,18 +105,20 @@ Here is how a ``_process()`` function might look for you: // Code to execute both in editor and in game. } -.. note:: +Important information +--------------------- - Modifications in the editor are permanent. For example, in the following - case, when we remove the script, the node will keep its rotation. Be careful - to avoid making unwanted modifications. +Any other GDScript that your tool script uses must *also* be a tool. Any +GDScript without ``@tool`` used by the editor will act like an empty file! -.. note:: +Extending a ``@tool`` script does not automatically make the extending script +a ``@tool``. Omitting ``@tool`` from the extending script will disable tool +behavior from the super class. Therefore the extending script should also +specify the ``@tool`` annotation. - Extending a ``@tool`` script does not automatically make the extending script - a ``@tool``. Omitting ``@tool`` from the extending script will disable tool - behavior from the super class. Therefore the extending script should also - specify the ``@tool`` annotation. +Modifications in the editor are permanent. For example, in the next +section when we remove the script, the node will keep its rotation. Be careful +to avoid making unwanted modifications. Try ``@tool`` out -----------------