-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix undoredo handling in some dialogs #93898
Conversation
Added fix for UV edit. |
class UVEditDialog : public AcceptDialog { | ||
GDCLASS(UVEditDialog, AcceptDialog); | ||
|
||
void UVEditDialog::shortcut_input(const Ref<InputEvent> &p_event) override { | ||
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(); | ||
} | ||
} | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should make this an editor class like AcceptDialogWithUndoRedo
in editor/gui/
?
For now doing it ad hoc is fine but if we find more similar occurrences we might want to consider using this in place of AcceptDialog for editor dialogs which need UndoRedo.
30c7cfd
to
67bbd4d
Compare
Thanks! |
Looks like dialogs are blocking input from passing to the editor, so undo/redo shortcut has to be handled manually when relevant. I improved handling in some dialogs and fixed animation dialog, but there might be more dialogs that need fixing.
Fixes godotengine/godot-proposals#10062
7Z38LZN1ha.mp4
Fixes #88412