diff options
author | kingoftheconnors <Connormcp777@gmail.com> | 2020-10-06 22:44:09 -0400 |
---|---|---|
committer | kingoftheconnors <Connormcp777@gmail.com> | 2020-10-08 20:35:00 -0400 |
commit | 36b69e515c9dd9631d1367ca057e99f87a6fdca4 (patch) | |
tree | d24dbe5305ab7032dfb72a1d4c460db7bfe4b887 /editor/plugins/animation_state_machine_editor.cpp | |
parent | fe6109101f4b8f7383a2dd03546bcbda9cbd042b (diff) | |
download | redot-engine-36b69e515c9dd9631d1367ca057e99f87a6fdca4.tar.gz |
Add alert in anim trees if resource load fails
Add_menu_type implements a resource loading, but only when
the resource is initially valid. No alert message is shown
if the resource isn't valid, leaving the user without feedback.
This commit adds an else clause to the is_valid command to give
feedback to the user when loading an animationPlaybackNode into
an animation tree fails.
Diffstat (limited to 'editor/plugins/animation_state_machine_editor.cpp')
-rw-r--r-- | editor/plugins/animation_state_machine_editor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 26006d85c9..14468a81eb 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -392,6 +392,8 @@ void AnimationNodeStateMachineEditor::_file_opened(const String &p_file) { file_loaded = ResourceLoader::load(p_file); if (file_loaded.is_valid()) { _add_menu_type(MENU_LOAD_FILE_CONFIRM); + } else { + EditorNode::get_singleton()->show_warning(TTR("This type of node can't be used. Only root nodes are allowed.")); } } |