diff options
| author | Juan Linietsky | 2016-06-04 13:17:56 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-06-04 13:19:08 -0300 |
| commit | 3ae61f22921520e473a9e95783f0fcc03a5c6a54 (patch) | |
| tree | ab83770fb82787e438e673062a87a988ce3917a9 /tools/editor/groups_editor.cpp | |
| parent | 280e3611b90c40fc26c7b7295430703f70f50f03 (diff) | |
| download | godot-3ae61f22921520e473a9e95783f0fcc03a5c6a54.tar.gz godot-3ae61f22921520e473a9e95783f0fcc03a5c6a54.tar.zst godot-3ae61f22921520e473a9e95783f0fcc03a5c6a54.zip | |
Created a NodeDock with signals and groups
Diffstat (limited to 'tools/editor/groups_editor.cpp')
| -rw-r--r-- | tools/editor/groups_editor.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/editor/groups_editor.cpp b/tools/editor/groups_editor.cpp index 906ee27d1..898e1e115 100644 --- a/tools/editor/groups_editor.cpp +++ b/tools/editor/groups_editor.cpp @@ -30,6 +30,7 @@ #include "scene/gui/box_container.h" #include "scene/gui/label.h" +#include "editor_node.h" void GroupsEditor::_add_group(const String& p_group) { @@ -47,8 +48,10 @@ void GroupsEditor::_add_group(const String& p_group) { undo_redo->add_do_method(node,"add_to_group",name,true); undo_redo->add_do_method(this,"update_tree"); - undo_redo->add_undo_method(node,"remove_from_group",name,get_text()); + undo_redo->add_undo_method(node,"remove_from_group",name); undo_redo->add_undo_method(this,"update_tree"); + undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree + undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree undo_redo->commit_action(); @@ -72,6 +75,8 @@ void GroupsEditor::_remove_group(Object *p_item, int p_column, int p_id) { undo_redo->add_do_method(this,"update_tree"); undo_redo->add_undo_method(node,"add_to_group",name,true); undo_redo->add_undo_method(this,"update_tree"); + undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree + undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(),"update_tree"); //to force redraw of scene tree undo_redo->commit_action(); } @@ -125,14 +130,10 @@ GroupsEditor::GroupsEditor() { node=NULL; - set_title(TTR("Group Editor")); - - VBoxContainer *vbc = memnew( VBoxContainer ); - add_child(vbc); - set_child_rect(vbc); + VBoxContainer *vbc = this; HBoxContainer *hbc = memnew( HBoxContainer ); - vbc->add_margin_child(TTR("Group"), hbc); + vbc->add_child(hbc); group_name = memnew( LineEdit ); group_name->set_h_size_flags(SIZE_EXPAND_FILL); @@ -147,10 +148,9 @@ GroupsEditor::GroupsEditor() { tree = memnew( Tree ); tree->set_hide_root(true); tree->set_v_size_flags(SIZE_EXPAND_FILL); - vbc->add_margin_child(TTR("Node Group(s)"), tree, true); + vbc->add_child(tree); tree->connect("button_pressed",this,"_remove_group"); - - get_ok()->set_text(TTR("Close")); + add_constant_override("separation",3*EDSCALE); } GroupsEditor::~GroupsEditor() |
