diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-14 23:09:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 23:09:03 +0200 |
commit | 00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (patch) | |
tree | 2b1c31f45add24085b64425ce440f577424c16a1 /editor/plugins/skeleton_2d_editor_plugin.cpp | |
parent | 5046f666a1181675b39f156c38346525dc1c444e (diff) | |
parent | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (diff) |
Merge pull request #38738 from akien-mga/cause-we-never-go-out-of-style
Style: Remove new line at block start, enforce line between functions, enforce braces in if and loop blocks
Diffstat (limited to 'editor/plugins/skeleton_2d_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/skeleton_2d_editor_plugin.cpp | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/editor/plugins/skeleton_2d_editor_plugin.cpp b/editor/plugins/skeleton_2d_editor_plugin.cpp index c81d3f787e..a198e4ff8f 100644 --- a/editor/plugins/skeleton_2d_editor_plugin.cpp +++ b/editor/plugins/skeleton_2d_editor_plugin.cpp @@ -36,7 +36,6 @@ #include "thirdparty/misc/clipper.hpp" void Skeleton2DEditor::_node_removed(Node *p_node) { - if (p_node == node) { node = nullptr; options->hide(); @@ -44,19 +43,16 @@ void Skeleton2DEditor::_node_removed(Node *p_node) { } void Skeleton2DEditor::edit(Skeleton2D *p_sprite) { - node = p_sprite; } void Skeleton2DEditor::_menu_option(int p_option) { - if (!node) { return; } switch (p_option) { case MENU_OPTION_MAKE_REST: { - if (node->get_bone_count() == 0) { err_dialog->set_text(TTR("This skeleton has no bones, create some children Bone2D nodes.")); err_dialog->popup_centered(); @@ -95,7 +91,6 @@ void Skeleton2DEditor::_bind_methods() { } Skeleton2DEditor::Skeleton2DEditor() { - options = memnew(MenuButton); CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options); @@ -115,28 +110,23 @@ Skeleton2DEditor::Skeleton2DEditor() { } void Skeleton2DEditorPlugin::edit(Object *p_object) { - sprite_editor->edit(Object::cast_to<Skeleton2D>(p_object)); } bool Skeleton2DEditorPlugin::handles(Object *p_object) const { - return p_object->is_class("Skeleton2D"); } void Skeleton2DEditorPlugin::make_visible(bool p_visible) { - if (p_visible) { sprite_editor->options->show(); } else { - sprite_editor->options->hide(); sprite_editor->edit(nullptr); } } Skeleton2DEditorPlugin::Skeleton2DEditorPlugin(EditorNode *p_node) { - editor = p_node; sprite_editor = memnew(Skeleton2DEditor); editor->get_viewport()->add_child(sprite_editor); |