From d427851013f6a2f2cd021d273f2f476902c9fdcf Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Thu, 5 Oct 2023 12:49:31 +0200 Subject: [PATCH] Resolve relative icon paths for GDExtensions --- core/extension/gdextension.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp index 7e280466a85..b75ccbba1dd 100644 --- a/core/extension/gdextension.cpp +++ b/core/extension/gdextension.cpp @@ -937,7 +937,12 @@ Error GDExtensionResourceLoader::load_gdextension_resource(const String &p_path, List keys; config->get_section_keys("icons", &keys); for (const String &key : keys) { - p_extension->class_icon_paths[key] = config->get_value("icons", key); + String icon_path = config->get_value("icons", key); + if (icon_path.is_relative_path()) { + icon_path = p_path.get_base_dir().path_join(icon_path); + } + + p_extension->class_icon_paths[key] = icon_path; } }