From f7f4e53763b65290493389a0a657b52863f1e958 Mon Sep 17 00:00:00 2001 From: heppocogne <83043568+heppocogne@users.noreply.github.com> Date: Mon, 12 Jun 2023 21:27:46 +0900 Subject: [PATCH] Add relative path support for `EditorPlugin::add_autoload_singleton` --- editor/editor_plugin.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 9e22a0ead6f..4232eacd764 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -62,7 +62,14 @@ void EditorPlugin::remove_custom_type(const String &p_type) { } void EditorPlugin::add_autoload_singleton(const String &p_name, const String &p_path) { - EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_add(p_name, p_path); + if (p_path.begins_with("res://")) { + EditorNode::get_singleton()->get_project_settings()->get_autoload_settings()->autoload_add(p_name, p_path); + } else { + const Ref