summaryrefslogtreecommitdiff
path: root/core/extension
diff options
context:
space:
mode:
authorne0fhyk <fhuyakou@gmail.com>2021-09-10 08:32:29 -0700
committerne0fhyk <fhuyakou@gmail.com>2021-09-15 12:52:03 -0700
commit69f890ff11a15cc2c1aa651801a872505ab08c81 (patch)
treeba9bbb131814f460a87605d3f9fce3c578e8e06a /core/extension
parent729461b2a455bd3b4afb26bb362863a68e98a9ee (diff)
Provide a getter for the project data directory.
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 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()) {