|
@@ -563,6 +563,17 @@ void EditorAudioBus::_gui_input(const Ref<InputEvent> &p_event) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void EditorAudioBus::_unhandled_key_input(Ref<InputEvent> p_event) {
|
|
|
|
+ Ref<InputEventKey> k = p_event;
|
|
|
|
+ if (k.is_valid() && k->is_pressed() && !k->is_echo() && k->get_scancode() == KEY_DELETE) {
|
|
|
|
+ TreeItem *current_effect = effects->get_selected();
|
|
|
|
+ if (current_effect && current_effect->get_metadata(0).get_type() == Variant::INT) {
|
|
|
|
+ _delete_effect_pressed(0);
|
|
|
|
+ accept_event();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
void EditorAudioBus::_bus_popup_pressed(int p_option) {
|
|
void EditorAudioBus::_bus_popup_pressed(int p_option) {
|
|
|
|
|
|
if (p_option == 2) {
|
|
if (p_option == 2) {
|
|
@@ -770,6 +781,7 @@ void EditorAudioBus::_bind_methods() {
|
|
ClassDB::bind_method("_effect_selected", &EditorAudioBus::_effect_selected);
|
|
ClassDB::bind_method("_effect_selected", &EditorAudioBus::_effect_selected);
|
|
ClassDB::bind_method("_effect_add", &EditorAudioBus::_effect_add);
|
|
ClassDB::bind_method("_effect_add", &EditorAudioBus::_effect_add);
|
|
ClassDB::bind_method("_gui_input", &EditorAudioBus::_gui_input);
|
|
ClassDB::bind_method("_gui_input", &EditorAudioBus::_gui_input);
|
|
|
|
+ ClassDB::bind_method("_unhandled_key_input", &EditorAudioBus::_unhandled_key_input);
|
|
ClassDB::bind_method("_bus_popup_pressed", &EditorAudioBus::_bus_popup_pressed);
|
|
ClassDB::bind_method("_bus_popup_pressed", &EditorAudioBus::_bus_popup_pressed);
|
|
ClassDB::bind_method("get_drag_data_fw", &EditorAudioBus::get_drag_data_fw);
|
|
ClassDB::bind_method("get_drag_data_fw", &EditorAudioBus::get_drag_data_fw);
|
|
ClassDB::bind_method("can_drop_data_fw", &EditorAudioBus::can_drop_data_fw);
|
|
ClassDB::bind_method("can_drop_data_fw", &EditorAudioBus::can_drop_data_fw);
|
|
@@ -797,6 +809,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
|
add_child(vb);
|
|
add_child(vb);
|
|
|
|
|
|
set_v_size_flags(SIZE_EXPAND_FILL);
|
|
set_v_size_flags(SIZE_EXPAND_FILL);
|
|
|
|
+ set_process_unhandled_key_input(true);
|
|
|
|
|
|
track_name = memnew(LineEdit);
|
|
track_name = memnew(LineEdit);
|
|
track_name->connect("text_entered", this, "_name_changed");
|
|
track_name->connect("text_entered", this, "_name_changed");
|