mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Add a way to force history for undoredo
This commit is contained in:
parent
95110ddcb4
commit
57e046541d
5 changed files with 33 additions and 2 deletions
|
@ -1056,10 +1056,12 @@ void SpriteFramesEditor::_rename_node_animation(EditorUndoRedoManager *undo_redo
|
|||
for (Node *E : nodes) {
|
||||
String current_name = E->call("get_animation");
|
||||
if (current_name == p_filter) {
|
||||
undo_redo->force_fixed_history(); // Fixes corner-case when editing SpriteFrames stored as separate file.
|
||||
undo_redo->add_undo_method(E, "set_animation", p_new_animation);
|
||||
}
|
||||
String autoplay_name = E->call("get_autoplay");
|
||||
if (autoplay_name == p_filter) {
|
||||
undo_redo->force_fixed_history();
|
||||
undo_redo->add_undo_method(E, "set_autoplay", p_new_autoplay);
|
||||
}
|
||||
}
|
||||
|
@ -1067,10 +1069,12 @@ void SpriteFramesEditor::_rename_node_animation(EditorUndoRedoManager *undo_redo
|
|||
for (Node *E : nodes) {
|
||||
String current_name = E->call("get_animation");
|
||||
if (current_name == p_filter) {
|
||||
undo_redo->force_fixed_history();
|
||||
undo_redo->add_do_method(E, "set_animation", p_new_animation);
|
||||
}
|
||||
String autoplay_name = E->call("get_autoplay");
|
||||
if (autoplay_name == p_filter) {
|
||||
undo_redo->force_fixed_history();
|
||||
undo_redo->add_do_method(E, "set_autoplay", p_new_autoplay);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue