Browse Source

Merge pull request #61361 from snailrhymer/remove-anim-config-warning

Rémi Verschelde 3 years ago
parent
commit
d81c5eab8c

+ 1 - 1
editor/plugins/animation_player_editor_plugin.cpp

@@ -452,7 +452,7 @@ void AnimationPlayerEditor::_animation_name_edited() {
 	}
 	}
 
 
 	if (player->has_animation(test_name_prefix + new_name)) {
 	if (player->has_animation(test_name_prefix + new_name)) {
-		error_dialog->set_text(vformat(TTR("Animation '%s' already exists!")));
+		error_dialog->set_text(vformat(TTR("Animation '%s' already exists!"), test_name_prefix + new_name));
 		error_dialog->popup_centered();
 		error_dialog->popup_centered();
 		return;
 		return;
 	}
 	}

+ 0 - 20
scene/animation/animation_player.cpp

@@ -1240,8 +1240,6 @@ void AnimationPlayer::_animation_set_cache_update() {
 
 
 void AnimationPlayer::_animation_added(const StringName &p_name, const StringName &p_library) {
 void AnimationPlayer::_animation_added(const StringName &p_name, const StringName &p_library) {
 	_animation_set_cache_update();
 	_animation_set_cache_update();
-
-	update_configuration_warnings();
 }
 }
 
 
 void AnimationPlayer::_animation_removed(const StringName &p_name, const StringName &p_library) {
 void AnimationPlayer::_animation_removed(const StringName &p_name, const StringName &p_library) {
@@ -1265,8 +1263,6 @@ void AnimationPlayer::_animation_removed(const StringName &p_name, const StringN
 		blend_times.erase(to_erase.front()->get());
 		blend_times.erase(to_erase.front()->get());
 		to_erase.pop_front();
 		to_erase.pop_front();
 	}
 	}
-
-	update_configuration_warnings();
 }
 }
 
 
 void AnimationPlayer::_rename_animation(const StringName &p_from_name, const StringName &p_to_name) {
 void AnimationPlayer::_rename_animation(const StringName &p_from_name, const StringName &p_to_name) {
@@ -1317,7 +1313,6 @@ void AnimationPlayer::_animation_renamed(const StringName &p_name, const StringN
 	_animation_set_cache_update();
 	_animation_set_cache_update();
 
 
 	_rename_animation(from_name, to_name);
 	_rename_animation(from_name, to_name);
-	update_configuration_warnings();
 }
 }
 
 
 Error AnimationPlayer::add_animation_library(const StringName &p_name, const Ref<AnimationLibrary> &p_animation_library) {
 Error AnimationPlayer::add_animation_library(const StringName &p_name, const Ref<AnimationLibrary> &p_animation_library) {
@@ -1353,7 +1348,6 @@ Error AnimationPlayer::add_animation_library(const StringName &p_name, const Ref
 
 
 	notify_property_list_changed();
 	notify_property_list_changed();
 
 
-	update_configuration_warnings();
 	return OK;
 	return OK;
 }
 }
 
 
@@ -1383,7 +1377,6 @@ void AnimationPlayer::remove_animation_library(const StringName &p_name) {
 	_animation_set_cache_update();
 	_animation_set_cache_update();
 
 
 	notify_property_list_changed();
 	notify_property_list_changed();
-	update_configuration_warnings();
 }
 }
 
 
 void AnimationPlayer::_ref_anim(const Ref<Animation> &p_anim) {
 void AnimationPlayer::_ref_anim(const Ref<Animation> &p_anim) {
@@ -1469,19 +1462,6 @@ void AnimationPlayer::get_animation_library_list(List<StringName> *p_libraries)
 	}
 	}
 }
 }
 
 
-TypedArray<String> AnimationPlayer::get_configuration_warnings() const {
-	TypedArray<String> warnings = Node::get_configuration_warnings();
-
-	for (uint32_t i = 0; i < animation_libraries.size(); i++) {
-		for (const KeyValue<StringName, Ref<Animation>> &K : animation_libraries[i].library->animations) {
-			if (animation_set.has(K.key) && animation_set[K.key].animation_library != animation_libraries[i].name) {
-				warnings.push_back(vformat(RTR("Animation '%s' in library '%s' is unused because another animation with the same name exists in library '%s'."), K.key, animation_libraries[i].name, animation_set[K.key].animation_library));
-			}
-		}
-	}
-	return warnings;
-}
-
 bool AnimationPlayer::has_animation(const StringName &p_name) const {
 bool AnimationPlayer::has_animation(const StringName &p_name) const {
 	return animation_set.has(p_name);
 	return animation_set.has(p_name);
 }
 }

+ 0 - 2
scene/animation/animation_player.h

@@ -388,8 +388,6 @@ public:
 	bool can_apply_reset() const;
 	bool can_apply_reset() const;
 #endif
 #endif
 
 
-	TypedArray<String> get_configuration_warnings() const override;
-
 	AnimationPlayer();
 	AnimationPlayer();
 	~AnimationPlayer();
 	~AnimationPlayer();
 };
 };