Export Path now has a folder icon to select the path

This commit is contained in:
Marcelo Fernandez
2018-11-12 16:04:58 -03:00
parent a2e4eb7533
commit e49a090919
4 changed files with 53 additions and 12 deletions

View File

@ -233,7 +233,7 @@ void EditorPropertyPath::_path_pressed() {
dialog->set_mode(EditorFileDialog::MODE_OPEN_DIR);
dialog->set_current_dir(full_path);
} else {
dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE);
dialog->set_mode(save_mode ? EditorFileDialog::MODE_SAVE_FILE : EditorFileDialog::MODE_OPEN_FILE);
for (int i = 0; i < extensions.size(); i++) {
String e = extensions[i].strip_edges();
if (e != String()) {
@ -260,6 +260,11 @@ void EditorPropertyPath::setup(const Vector<String> &p_extensions, bool p_folder
global = p_global;
}
void EditorPropertyPath::set_save_mode() {
save_mode = true;
}
void EditorPropertyPath::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
@ -296,6 +301,7 @@ EditorPropertyPath::EditorPropertyPath() {
path_edit->connect("pressed", this, "_path_pressed");
folder = false;
global = false;
save_mode = false;
}
///////////////////// CLASS NAME /////////////////////////