diff options
author | volzhs <volzhs@gmail.com> | 2017-12-11 21:19:06 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2017-12-11 23:20:25 +0900 |
commit | 47182a01c3aea3f3ffaffff4a2af6977da5934d3 (patch) | |
tree | a92f64c6bc546f4b87f2eed10e3de511a1c11c0f /editor/script_create_dialog.cpp | |
parent | 64d104756c04f4d5c4e8140271d5e8049e5f8371 (diff) | |
download | redot-engine-47182a01c3aea3f3ffaffff4a2af6977da5934d3.tar.gz |
Pressing Enter key creates or loads script on Attach script window
Diffstat (limited to 'editor/script_create_dialog.cpp')
-rw-r--r-- | editor/script_create_dialog.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 3cab14b0c4..32ea3910bf 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -425,6 +425,10 @@ void ScriptCreateDialog::_path_changed(const String &p_path) { _update_dialog(); } +void ScriptCreateDialog::_path_entered(const String &p_path) { + ok_pressed(); +} + void ScriptCreateDialog::_msg_script_valid(bool valid, const String &p_msg) { error_label->set_text(TTR(p_msg)); @@ -550,6 +554,7 @@ void ScriptCreateDialog::_bind_methods() { ClassDB::bind_method("_browse_path", &ScriptCreateDialog::_browse_path); ClassDB::bind_method("_file_selected", &ScriptCreateDialog::_file_selected); ClassDB::bind_method("_path_changed", &ScriptCreateDialog::_path_changed); + ClassDB::bind_method("_path_entered", &ScriptCreateDialog::_path_entered); ClassDB::bind_method("_template_changed", &ScriptCreateDialog::_template_changed); ADD_SIGNAL(MethodInfo("script_created", PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script"))); } @@ -715,6 +720,7 @@ ScriptCreateDialog::ScriptCreateDialog() { hb = memnew(HBoxContainer); file_path = memnew(LineEdit); file_path->connect("text_changed", this, "_path_changed"); + file_path->connect("text_entered", this, "_path_entered"); file_path->set_h_size_flags(SIZE_EXPAND_FILL); hb->add_child(file_path); path_button = memnew(Button); |