Provide a getter for the project data directory.
This commit is contained in:
@@ -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 == "") {
|
||||
|
||||
@@ -42,7 +42,6 @@ class ProjectSettings : public Object {
|
||||
|
||||
public:
|
||||
typedef Map<String, Variant> CustomMap;
|
||||
static const String IMPORTED_FILES_PATH;
|
||||
|
||||
enum {
|
||||
//properties that are not for built in values begin from this value, so builtin ones are displayed first
|
||||
@@ -141,7 +140,10 @@ public:
|
||||
bool property_can_revert(const String &p_name);
|
||||
Variant property_get_revert(const String &p_name);
|
||||
|
||||
String get_project_data_dir_name() const;
|
||||
String get_project_data_path() const;
|
||||
String get_resource_path() const;
|
||||
String get_imported_files_path() const;
|
||||
|
||||
static ProjectSettings *get_singleton();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user