Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion editor/project_manager/project_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ void ProjectDialog::_validate_path() {
String home_dir = OS::get_singleton()->get_environment("HOME");
#endif
String documents_dir = OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS);
if (target_path == home_dir || target_path == documents_dir) {
String default_dir = String(EditorSettings::get_singleton()->get("filesystem/directories/default_project_path"));
if (target_path == home_dir || target_path == documents_dir || target_path == default_dir) {
_set_message(TTRC("You cannot save a project at the selected path. Please create a subfolder or choose a new path."), MESSAGE_ERROR, target_path_input_type);
return;
}
Expand Down
7 changes: 4 additions & 3 deletions editor/settings/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_PLACEHOLDER_TEXT, "filesystem/external_programs/terminal_emulator_flags", "", "Call flags with placeholder: {directory}.");

// Directories
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_DIR, "filesystem/directories/autoscan_project_path", "", "")
const String fs_dir_default_project_path = OS::get_singleton()->has_environment("HOME") ? OS::get_singleton()->get_environment("HOME") : OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS);
EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_GLOBAL_DIR, "filesystem/directories/default_project_path", fs_dir_default_project_path, "")
// Set the default directory as both the autoscan project path and default project path,
// so that projects can be dropped onto it and detected automatically.
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_DIR, "filesystem/directories/autoscan_project_path", OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS).path_join("Godot"), "");
EDITOR_SETTING_BASIC(Variant::STRING, PROPERTY_HINT_GLOBAL_DIR, "filesystem/directories/default_project_path", OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS).path_join("Godot"), "");

// On save
_initial_set("filesystem/on_save/compress_binary_resources", true);
Expand Down