Skip to content

Commit

Permalink
Fix errors on pressing autoplay in sprite frames editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaosus committed May 13, 2024
1 parent 557f63d commit b4d955a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions editor/plugins/sprite_frames_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ void SpriteFramesEditor::_animation_name_edited() {
edited->set_text(0, name);

EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Rename Animation"), UndoRedo::MERGE_DISABLE, frames.ptr());
undo_redo->create_action(TTR("Rename Animation"), UndoRedo::MERGE_DISABLE, EditorNode::get_singleton()->get_edited_scene());
undo_redo->add_do_method(frames.ptr(), "rename_animation", edited_anim, name);
undo_redo->add_undo_method(frames.ptr(), "rename_animation", name, edited_anim);
_rename_node_animation(undo_redo, false, edited_anim, name, name);
Expand Down Expand Up @@ -1127,7 +1127,7 @@ void SpriteFramesEditor::_animation_remove_confirmed() {
}

EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Remove Animation"), UndoRedo::MERGE_DISABLE, frames.ptr());
undo_redo->create_action(TTR("Remove Animation"), UndoRedo::MERGE_DISABLE, EditorNode::get_singleton()->get_edited_scene());
_rename_node_animation(undo_redo, false, edited_anim, new_edited, "");
undo_redo->add_do_method(frames.ptr(), "remove_animation", edited_anim);
undo_redo->add_undo_method(frames.ptr(), "add_animation", edited_anim);
Expand Down Expand Up @@ -1733,7 +1733,7 @@ void SpriteFramesEditor::_autoplay_pressed() {

if (animated_sprite) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Toggle Autoplay"), UndoRedo::MERGE_DISABLE, frames.ptr());
undo_redo->create_action(TTR("Toggle Autoplay"), UndoRedo::MERGE_DISABLE, EditorNode::get_singleton()->get_edited_scene());
String current = animated_sprite->call("get_animation");
String current_auto = animated_sprite->call("get_autoplay");
if (current == current_auto) {
Expand Down

0 comments on commit b4d955a

Please sign in to comment.