diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-04 17:12:13 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-04 17:12:13 +0200 |
commit | f986a801fc9c4ac375f212e0d2c545919463844a (patch) | |
tree | 0dacaea6e62f4d5eea8b9a425859a2cc5f510e63 /editor/plugins/animation_library_editor.cpp | |
parent | af55caff36d9f7b1c5a272191d26557bfaf3e6b6 (diff) | |
parent | 681769e2c91124057d0421c44ff1e6582d926483 (diff) | |
download | redot-engine-f986a801fc9c4ac375f212e0d2c545919463844a.tar.gz |
Merge pull request #93898 from KoBeWi/rundo_edo
Fix undoredo handling in some dialogs
Diffstat (limited to 'editor/plugins/animation_library_editor.cpp')
-rw-r--r-- | editor/plugins/animation_library_editor.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp index afe7ea83d8..b07db993ba 100644 --- a/editor/plugins/animation_library_editor.cpp +++ b/editor/plugins/animation_library_editor.cpp @@ -781,6 +781,27 @@ void AnimationLibraryEditor::_update_editor(Object *p_mixer) { emit_signal("update_editor", p_mixer); } +void AnimationLibraryEditor::shortcut_input(const Ref<InputEvent> &p_event) { + const Ref<InputEventKey> k = p_event; + if (k.is_valid() && k->is_pressed()) { + bool handled = false; + + if (ED_IS_SHORTCUT("ui_undo", p_event)) { + EditorNode::get_singleton()->undo(); + handled = true; + } + + if (ED_IS_SHORTCUT("ui_redo", p_event)) { + EditorNode::get_singleton()->redo(); + handled = true; + } + + if (handled) { + set_input_as_handled(); + } + } +} + void AnimationLibraryEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_editor", "mixer"), &AnimationLibraryEditor::_update_editor); ADD_SIGNAL(MethodInfo("update_editor")); @@ -788,6 +809,7 @@ void AnimationLibraryEditor::_bind_methods() { AnimationLibraryEditor::AnimationLibraryEditor() { set_title(TTR("Edit Animation Libraries")); + set_process_shortcut_input(true); file_dialog = memnew(EditorFileDialog); add_child(file_dialog); |