diff options
| author | Juan Linietsky | 2016-01-17 20:03:57 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-01-17 20:03:57 -0300 |
| commit | 74a48a0140262ebd3a818a75b7d102cf0fe2eeae (patch) | |
| tree | 6789b64b2df5bbf81d519a4d4d70d1e9f0c35655 /tools/editor/plugins/canvas_item_editor_plugin.cpp | |
| parent | 72fcb8a35beab251d01864bc67da3e3a8e75aed6 (diff) | |
| download | godot-74a48a0140262ebd3a818a75b7d102cf0fe2eeae.tar.gz godot-74a48a0140262ebd3a818a75b7d102cf0fe2eeae.tar.zst godot-74a48a0140262ebd3a818a75b7d102cf0fe2eeae.zip | |
-Massive editor dialog cleanup
-Added a bottom menu list
Diffstat (limited to 'tools/editor/plugins/canvas_item_editor_plugin.cpp')
| -rw-r--r-- | tools/editor/plugins/canvas_item_editor_plugin.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 139d84911..a259fa0fc 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -37,6 +37,8 @@ #include "os/input.h" #include "tools/editor/editor_settings.h" #include "scene/gui/grid_container.h" +#include "tools/editor/animation_editor.h" +#include "tools/editor/plugins/animation_player_editor_plugin.h" class SnapDialog : public ConfirmationDialog { @@ -407,7 +409,7 @@ void CanvasItemEditor::_node_removed(Node *p_node) { void CanvasItemEditor::_keying_changed() { - if (editor->get_animation_editor()->has_keying()) + if (AnimationPlayerEditor::singleton->get_key_editor()->has_keying()) animation_hb->show(); else animation_hb->hide(); @@ -2695,11 +2697,11 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); if (key_pos) - editor->get_animation_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_pos(),existing); if (key_rot) - editor->get_animation_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rot()),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rot()),existing); if (key_scale) - editor->get_animation_editor()->insert_node_value_key(n2d,"transform/scale",n2d->get_scale(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/scale",n2d->get_scale(),existing); if (n2d->has_meta("_edit_bone_") && n2d->get_parent_item()) { @@ -2727,11 +2729,11 @@ void CanvasItemEditor::_popup_callback(int p_op) { for(List<Node2D*>::Element *F=ik_chain.front();F;F=F->next()) { if (key_pos) - editor->get_animation_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_pos(),existing); if (key_rot) - editor->get_animation_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rot()),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rot()),existing); if (key_scale) - editor->get_animation_editor()->insert_node_value_key(F->get(),"transform/scale",F->get()->get_scale(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/scale",F->get()->get_scale(),existing); } @@ -2743,9 +2745,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { Control *ctrl = canvas_item->cast_to<Control>(); if (key_pos) - editor->get_animation_editor()->insert_node_value_key(ctrl,"rect/pos",ctrl->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl,"rect/pos",ctrl->get_pos(),existing); if (key_scale) - editor->get_animation_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size(),existing); } } @@ -2867,7 +2869,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (key_pos) ctrl->set_pos(Point2()); //if (key_scale) - // editor->get_animation_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size()); + // AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size()); } } @@ -3416,7 +3418,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { box_selecting=false; //zoom=0.5; singleton=this; - editor->get_animation_editor()->connect("keying_changed",this,"_keying_changed"); + AnimationPlayerEditor::singleton->get_key_editor()->connect("keying_changed",this,"_keying_changed"); set_process_unhandled_key_input(true); can_move_pivot=false; drag=DRAG_NONE; |
