Merge pull request #12172 from neikeq/j
Take self-contained mode into consideration
This commit is contained in:
commit
6e960c7d6b
1 changed files with 15 additions and 6 deletions
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
#include "editor/editor_settings.h"
|
#include "editor/editor_settings.h"
|
||||||
|
#include "os/dir_access.h"
|
||||||
#include "project_settings.h"
|
#include "project_settings.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,6 +61,13 @@ String _get_mono_user_dir() {
|
||||||
} else {
|
} else {
|
||||||
String settings_path;
|
String settings_path;
|
||||||
|
|
||||||
|
String exe_dir = OS::get_singleton()->get_executable_path().get_base_dir();
|
||||||
|
DirAccessRef d = DirAccess::create_for_path(exe_dir);
|
||||||
|
|
||||||
|
if (d->file_exists("._sc_") || d->file_exists("_sc_")) {
|
||||||
|
// contain yourself
|
||||||
|
settings_path = exe_dir.plus_file("editor_data");
|
||||||
|
} else {
|
||||||
if (OS::get_singleton()->has_environment("APPDATA")) {
|
if (OS::get_singleton()->has_environment("APPDATA")) {
|
||||||
String app_data = OS::get_singleton()->get_environment("APPDATA").replace("\\", "/");
|
String app_data = OS::get_singleton()->get_environment("APPDATA").replace("\\", "/");
|
||||||
settings_path = app_data.plus_file(String(_MKSTR(VERSION_SHORT_NAME)).capitalize());
|
settings_path = app_data.plus_file(String(_MKSTR(VERSION_SHORT_NAME)).capitalize());
|
||||||
|
@ -67,6 +75,7 @@ String _get_mono_user_dir() {
|
||||||
String home = OS::get_singleton()->get_environment("HOME");
|
String home = OS::get_singleton()->get_environment("HOME");
|
||||||
settings_path = home.plus_file("." + String(_MKSTR(VERSION_SHORT_NAME)).to_lower());
|
settings_path = home.plus_file("." + String(_MKSTR(VERSION_SHORT_NAME)).to_lower());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return settings_path.plus_file("mono");
|
return settings_path.plus_file("mono");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue