diff options
| author | Juan Linietsky | 2016-07-22 09:42:12 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-07-22 09:42:12 -0300 |
| commit | 12472534ec644fbffa0d15b0ab199f41abefc324 (patch) | |
| tree | e8f70bbb9761a438654f57ea2c4e279191aec23d /tools/editor/plugins | |
| parent | f51a8162532e135584f82ecb3ef48414fd8188cf (diff) | |
| download | godot-12472534ec644fbffa0d15b0ab199f41abefc324.tar.gz godot-12472534ec644fbffa0d15b0ab199f41abefc324.tar.zst godot-12472534ec644fbffa0d15b0ab199f41abefc324.zip | |
Show a warning that an animation must be selected in order to edit it. Avoid copying/pasting if no anim selected. Closes #5799
Diffstat (limited to 'tools/editor/plugins')
| -rw-r--r-- | tools/editor/plugins/animation_player_editor_plugin.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 98ba25b48..7dc2e6540 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -43,6 +43,7 @@ void AnimationPlayerEditor::_node_removed(Node *p_node) { key_editor->set_animation(Ref<Animation>()); key_editor->set_root(NULL); + key_editor->show_select_node_warning(true); _update_player(); //editor->animation_editor_make_visible(false); @@ -832,6 +833,7 @@ void AnimationPlayerEditor::_update_player() { remove_anim->set_disabled(animlist.size()==0); resource_edit_anim->set_disabled(animlist.size()==0); save_anim->set_disabled(animlist.size() == 0); + tool_anim->set_disabled(player==NULL); int active_idx=-1; @@ -889,9 +891,11 @@ void AnimationPlayerEditor::edit(AnimationPlayer *p_player) { return; //ignore, pinned player=p_player; - if (player) + if (player) { _update_player(); - else { + key_editor->show_select_node_warning(false); + } else { + key_editor->show_select_node_warning(true); // hide(); @@ -1123,6 +1127,7 @@ void AnimationPlayerEditor::_hide_anim_editors() { key_editor->set_animation(Ref<Animation>()); key_editor->set_root(NULL); + key_editor->show_select_node_warning(true); // editor->animation_editor_make_visible(false); } @@ -1531,6 +1536,8 @@ void AnimationPlayerEditorPlugin::edit(Object *p_object) { if (!p_object) return; anim_editor->edit(p_object->cast_to<AnimationPlayer>()); + + } bool AnimationPlayerEditorPlugin::handles(Object *p_object) const { |
