summaryrefslogtreecommitdiff
path: root/core/extension
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-05 21:02:27 +0200
committerGitHub <noreply@github.com>2021-10-05 21:02:27 +0200
commita7ba22763139b29d825e0f4ef3e718533da069ea (patch)
tree63e38379d45985297d0e3250bdc3d6bd025c4f25 /core/extension
parent869a618e542252a42d0f5feab18a7916aec7109d (diff)
parent69f890ff11a15cc2c1aa651801a872505ab08c81 (diff)
Merge pull request #52711 from m4gr3d/provide_getter_for_project_data_dir_master
Diffstat (limited to 'core/extension')
-rw-r--r--core/extension/native_extension.cpp4
-rw-r--r--core/extension/native_extension.h2
-rw-r--r--core/extension/native_extension_manager.cpp2
3 files changed, 5 insertions, 3 deletions
diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp
index 635e53fa9c..a6b0a708c3 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 52e869ad4d..f7f235d8fc 100644
--- a/core/extension/native_extension.h
+++ b/core/extension/native_extension.h
@@ -62,7 +62,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 4eac5249c9..c8755250d5 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()) {