From 69f890ff11a15cc2c1aa651801a872505ab08c81 Mon Sep 17 00:00:00 2001 From: ne0fhyk Date: Fri, 10 Sep 2021 08:32:29 -0700 Subject: Provide a getter for the project data directory. --- core/extension/native_extension.cpp | 4 +++- core/extension/native_extension.h | 2 +- core/extension/native_extension_manager.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'core/extension') diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp index a3cd7ca14c..93b98524b7 100644 --- a/core/extension/native_extension.cpp +++ b/core/extension/native_extension.cpp @@ -35,7 +35,9 @@ #include "core/object/method_bind.h" #include "core/os/os.h" -const char *NativeExtension::EXTENSION_LIST_CONFIG_FILE = "res://.godot/extension_list.cfg"; +String NativeExtension::get_extension_list_config_file() { + return ProjectSettings::get_singleton()->get_project_data_path().plus_file("extension_list.cfg"); +} class NativeExtensionMethodBind : public MethodBind { GDNativeExtensionClassMethodCall call_func; diff --git a/core/extension/native_extension.h b/core/extension/native_extension.h index b661381d64..88a98d4ee9 100644 --- a/core/extension/native_extension.h +++ b/core/extension/native_extension.h @@ -60,7 +60,7 @@ protected: static void _bind_methods(); public: - static const char *EXTENSION_LIST_CONFIG_FILE; + static String get_extension_list_config_file(); Error open_library(const String &p_path, const String &p_entry_symbol); void close_library(); diff --git a/core/extension/native_extension_manager.cpp b/core/extension/native_extension_manager.cpp index 8b7a9df4f1..cd72376897 100644 --- a/core/extension/native_extension_manager.cpp +++ b/core/extension/native_extension_manager.cpp @@ -112,7 +112,7 @@ void NativeExtensionManager::deinitialize_extensions(NativeExtension::Initializa } void NativeExtensionManager::load_extensions() { - FileAccessRef f = FileAccess::open(NativeExtension::EXTENSION_LIST_CONFIG_FILE, FileAccess::READ); + FileAccessRef f = FileAccess::open(NativeExtension::get_extension_list_config_file(), FileAccess::READ); while (f && !f->eof_reached()) { String s = f->get_line().strip_edges(); if (s != String()) { -- cgit v1.2.3