diff options
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r-- | tools/editor/plugins/animation_player_editor_plugin.cpp | 15 | ||||
-rw-r--r-- | tools/editor/plugins/texture_region_editor_plugin.cpp | 14 |
2 files changed, 23 insertions, 6 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 98ba25b482..b4d54c6b1e 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); @@ -376,8 +377,8 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource>& p_resou int flg = 0; if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) flg |= ResourceSaver::FLAG_COMPRESS; - if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) - flg |= ResourceSaver::FLAG_RELATIVE_PATHS; + //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) + // flg |= ResourceSaver::FLAG_RELATIVE_PATHS; String path = Globals::get_singleton()->localize_path(p_path); Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); @@ -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 { diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp index 63d8e2e1cf..db888208fb 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.cpp +++ b/tools/editor/plugins/texture_region_editor_plugin.cpp @@ -703,14 +703,24 @@ void TextureRegionEditor::_edit_region() bool merged = true; while (merged) { merged = false; + bool queue_erase = false; for (List<Rect2>::Element *F = autoslice_cache.front(); F; F=F->next()) { + if (queue_erase){ + autoslice_cache.erase(F->prev()); + queue_erase = false; + } if (F==E) continue; if (E->get().grow(1).intersects(F->get())) { E->get().expand_to(F->get().pos); E->get().expand_to(F->get().pos+F->get().size); - F=F->prev(); - autoslice_cache.erase(F->next()); + if (F->prev()) { + F=F->prev(); + autoslice_cache.erase(F->next()); + } else { + queue_erase = true; + //Cant delete the first rect in the list. + } merged = true; } } |