Merge pull request #52711 from m4gr3d/provide_getter_for_project_data_dir_master
This commit is contained in:
commit
a7ba227631
18 changed files with 67 additions and 34 deletions
|
|
@ -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.is_empty() || p_path.begins_with("res://") || p_path.begins_with("user://") ||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue