@@ -881,6 +881,7 @@ void AnimationPlayerEditor::_update_player() {
881881
882882 tool_anim->set_disabled (player == nullptr );
883883 pin->set_disabled (player == nullptr );
884+ _set_controls_disabled (player == nullptr );
884885
885886 if (!player) {
886887 AnimationPlayerEditor::get_singleton ()->get_track_editor ()->update_keying ();
@@ -931,17 +932,6 @@ void AnimationPlayerEditor::_update_player() {
931932 ITEM_CHECK_DISABLED(TOOL_NEW_ANIM);
932933#undef ITEM_CHECK_DISABLED
933934
934- stop->set_disabled (no_anims_found);
935- play->set_disabled (no_anims_found);
936- play_bw->set_disabled (no_anims_found);
937- play_bw_from->set_disabled (no_anims_found);
938- play_from->set_disabled (no_anims_found);
939- frame->set_editable (!no_anims_found);
940- animation->set_disabled (no_anims_found);
941- autoplay->set_disabled (no_anims_found);
942- onion_toggle->set_disabled (no_anims_found);
943- onion_skinning->set_disabled (no_anims_found);
944-
945935 _update_animation_list_icons ();
946936
947937 updating = false ;
@@ -958,7 +948,9 @@ void AnimationPlayerEditor::_update_player() {
958948 _animation_selected (0 );
959949 }
960950
961- if (!no_anims_found) {
951+ if (no_anims_found) {
952+ _set_controls_disabled (true );
953+ } else {
962954 String current = animation->get_item_text (animation->get_selected ());
963955 Ref<Animation> anim = player->get_animation (current);
964956
@@ -974,6 +966,20 @@ void AnimationPlayerEditor::_update_player() {
974966 _update_animation ();
975967}
976968
969+ void AnimationPlayerEditor::_set_controls_disabled (bool p_disabled) {
970+ frame->set_editable (!p_disabled);
971+
972+ stop->set_disabled (p_disabled);
973+ play->set_disabled (p_disabled);
974+ play_bw->set_disabled (p_disabled);
975+ play_bw_from->set_disabled (p_disabled);
976+ play_from->set_disabled (p_disabled);
977+ animation->set_disabled (p_disabled);
978+ autoplay->set_disabled (p_disabled);
979+ onion_toggle->set_disabled (p_disabled);
980+ onion_skinning->set_disabled (p_disabled);
981+ }
982+
977983void AnimationPlayerEditor::_update_animation_list_icons () {
978984 for (int i = 0 ; i < animation->get_item_count (); i++) {
979985 String anim_name = animation->get_item_text (i);
@@ -1076,9 +1082,6 @@ void AnimationPlayerEditor::_ensure_dummy_player() {
10761082 }
10771083 }
10781084
1079- // Make some options disabled.
1080- onion_toggle->set_disabled (dummy_exists);
1081- onion_skinning->set_disabled (dummy_exists);
10821085 int selected = animation->get_selected ();
10831086 autoplay->set_disabled (selected != -1 ? (animation->get_item_text (selected).is_empty () ? true : dummy_exists) : true );
10841087
0 commit comments