From 374d2219db11ed4ece514e25d6c12f67bb0fb4ea Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 29 Jan 2024 16:34:27 +0100 Subject: [PATCH] Make script UIDs optional --- core/object/script_language.h | 1 + editor/plugins/script_editor_plugin.cpp | 25 +++++++++++ editor/plugins/script_editor_plugin.h | 1 + editor/script_create_dialog.cpp | 29 +++++++++++++ editor/script_create_dialog.h | 3 ++ modules/gdscript/gdscript.cpp | 49 +++++++--------------- modules/gdscript/gdscript.h | 1 + modules/gdscript/gdscript_editor.cpp | 4 ++ modules/gdscript/tests/test_gdscript_uid.h | 5 +-- 9 files changed, 80 insertions(+), 38 deletions(-) diff --git a/core/object/script_language.h b/core/object/script_language.h index bb714d5bc357..eb64aebd3539 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -253,6 +253,7 @@ class ScriptLanguage : public Object { #endif virtual bool supports_builtin_mode() const = 0; virtual bool supports_documentation() const { return false; } + virtual bool supports_uid() const { return false; } virtual bool can_inherit_from_file() const { return false; } virtual int find_function(const String &p_function, const String &p_code) const = 0; virtual String make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const = 0; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index c8e65e98a715..fb4ec138a52f 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1429,6 +1429,30 @@ void ScriptEditor::_menu_option(int p_option) { es->run(); } break; + case FILE_INSERT_UID: { + Ref