mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fixed deleting an animation marked to autoplay in the editor affecting the creation of one with the same name.
This commit is contained in:
parent
b22f048700
commit
e93a56ef3e
1 changed files with 6 additions and 0 deletions
|
|
@ -459,6 +459,12 @@ void AnimationPlayerEditor::_animation_remove_confirmed() {
|
||||||
Ref<Animation> anim = player->get_animation(current);
|
Ref<Animation> anim = player->get_animation(current);
|
||||||
|
|
||||||
undo_redo->create_action(TTR("Remove Animation"));
|
undo_redo->create_action(TTR("Remove Animation"));
|
||||||
|
if (player->get_autoplay() == current) {
|
||||||
|
undo_redo->add_do_method(player, "set_autoplay", "");
|
||||||
|
undo_redo->add_undo_method(player, "set_autoplay", current);
|
||||||
|
// Avoid having the autoplay icon linger around if there is only one animation in the player
|
||||||
|
undo_redo->add_do_method(this, "_animation_player_changed", player);
|
||||||
|
}
|
||||||
undo_redo->add_do_method(player, "remove_animation", current);
|
undo_redo->add_do_method(player, "remove_animation", current);
|
||||||
undo_redo->add_undo_method(player, "add_animation", current, anim);
|
undo_redo->add_undo_method(player, "add_animation", current, anim);
|
||||||
undo_redo->add_do_method(this, "_animation_player_changed", player);
|
undo_redo->add_do_method(this, "_animation_player_changed", player);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue