You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix undoredo handling in some dialogs
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user