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/config/project_settings.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'core/config/project_settings.cpp') diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 03892d1d4f..283500d826 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -48,11 +48,22 @@ ProjectSettings *ProjectSettings::get_singleton() { return singleton; } +String ProjectSettings::get_project_data_dir_name() const { + return ".godot"; +} + +String ProjectSettings::get_project_data_path() const { + String project_data_dir_name = get_project_data_dir_name(); + return "res://" + project_data_dir_name; +} + String ProjectSettings::get_resource_path() const { return resource_path; } -const String ProjectSettings::IMPORTED_FILES_PATH("res://.godot/imported"); +String ProjectSettings::get_imported_files_path() const { + return get_project_data_path().plus_file("imported"); +} String ProjectSettings::localize_path(const String &p_path) const { if (resource_path == "") { -- cgit v1.2.3