Print error when trying to change to directory out of scope
This commit is contained in:
parent
5cba18ff3b
commit
af6b344192
1 changed files with 6 additions and 0 deletions
|
|
@ -1608,6 +1608,12 @@ void FileDialog::_select_drive(int p_idx) {
|
|||
}
|
||||
|
||||
void FileDialog::_change_dir(const String &p_new_dir) {
|
||||
if (access == ACCESS_RESOURCES && p_new_dir.begins_with("user://")) {
|
||||
ERR_FAIL_MSG("Can't change to userdata folder when using ACCESS_RESOURCES.");
|
||||
} else if (access == ACCESS_USERDATA && p_new_dir.begins_with("res://")) {
|
||||
ERR_FAIL_MSG("Can't change to resources folder when using ACCESS_USERDATA.");
|
||||
}
|
||||
|
||||
if (root_prefix.is_empty()) {
|
||||
dir_access->change_dir(p_new_dir);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue