missing changes

This commit is contained in:
Juan Linietsky 2015-06-14 02:13:47 -03:00
parent edf1f27118
commit 8228fea02f
11 changed files with 45 additions and 12 deletions

View file

@ -109,6 +109,9 @@ public:
frame->set_anchor( MARGIN_RIGHT, Control::ANCHOR_END ); frame->set_anchor( MARGIN_RIGHT, Control::ANCHOR_END );
frame->set_anchor( MARGIN_BOTTOM, Control::ANCHOR_END ); frame->set_anchor( MARGIN_BOTTOM, Control::ANCHOR_END );
frame->set_end( Point2(0,0) ); frame->set_end( Point2(0,0) );
Ref<Theme> t = memnew( Theme );
frame->set_theme(t);
get_root()->add_child( frame ); get_root()->add_child( frame );

View file

@ -294,6 +294,9 @@ public:
reference=NULL; reference=NULL;
} }
void instance() {
ref( memnew( T ));
}
Ref() { Ref() {

View file

@ -345,6 +345,7 @@ void SplitContainer::_input_event(const InputEvent& p_event) {
expand_ofs=drag_ofs+((vertical?mm.y:mm.x)-drag_from); expand_ofs=drag_ofs+((vertical?mm.y:mm.x)-drag_from);
queue_sort(); queue_sort();
emit_signal("dragged",get_split_offset());
} }
} }
@ -431,11 +432,13 @@ void SplitContainer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_dragger_visible","visible"),&SplitContainer::set_dragger_visible); ObjectTypeDB::bind_method(_MD("set_dragger_visible","visible"),&SplitContainer::set_dragger_visible);
ObjectTypeDB::bind_method(_MD("is_dragger_visible"),&SplitContainer::is_dragger_visible); ObjectTypeDB::bind_method(_MD("is_dragger_visible"),&SplitContainer::is_dragger_visible);
ADD_SIGNAL( MethodInfo("dragged",PropertyInfo(Variant::INT,"offset")));
ADD_PROPERTY( PropertyInfo(Variant::INT,"split/offset"),_SCS("set_split_offset"),_SCS("get_split_offset")); ADD_PROPERTY( PropertyInfo(Variant::INT,"split/offset"),_SCS("set_split_offset"),_SCS("get_split_offset"));
ADD_PROPERTY( PropertyInfo(Variant::INT,"split/collapsed"),_SCS("set_collapsed"),_SCS("is_collapsed")); ADD_PROPERTY( PropertyInfo(Variant::INT,"split/collapsed"),_SCS("set_collapsed"),_SCS("is_collapsed"));
ADD_PROPERTY( PropertyInfo(Variant::INT,"split/dragger_visible"),_SCS("set_dragger_visible"),_SCS("is_dragger_visible")); ADD_PROPERTY( PropertyInfo(Variant::INT,"split/dragger_visible"),_SCS("set_dragger_visible"),_SCS("is_dragger_visible"));
} }
SplitContainer::SplitContainer(bool p_vertical) { SplitContainer::SplitContainer(bool p_vertical) {

View file

@ -641,6 +641,7 @@ void Node::_add_child_nocheck(Node* p_child,const StringName& p_name) {
p_child->data.pos=data.children.size(); p_child->data.pos=data.children.size();
data.children.push_back( p_child ); data.children.push_back( p_child );
p_child->data.parent=this; p_child->data.parent=this;
p_child->notification(NOTIFICATION_PARENTED);
if (data.tree) { if (data.tree) {
p_child->_set_tree(data.tree); p_child->_set_tree(data.tree);
@ -649,7 +650,6 @@ void Node::_add_child_nocheck(Node* p_child,const StringName& p_name) {
/* Notify */ /* Notify */
//recognize childs created in this node constructor //recognize childs created in this node constructor
p_child->data.parent_owned=data.in_constructor; p_child->data.parent_owned=data.in_constructor;
p_child->notification(NOTIFICATION_PARENTED);
add_child_notify(p_child); add_child_notify(p_child);

View file

@ -230,6 +230,11 @@ void CreateDialog::_notification(int p_what) {
connect("confirmed",this,"_confirmed"); connect("confirmed",this,"_confirmed");
_update_search(); _update_search();
} }
if (p_what==NOTIFICATION_EXIT_TREE) {
disconnect("confirmed",this,"_confirmed");
}
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {

View file

@ -39,6 +39,9 @@ void GroupsEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) { if (p_what==NOTIFICATION_ENTER_TREE) {
connect("confirmed", this,"_close"); connect("confirmed", this,"_close");
} }
if (p_what==NOTIFICATION_EXIT_TREE) {
disconnect("confirmed", this,"_close");
}
} }
void GroupsEditor::_close() { void GroupsEditor::_close() {

View file

@ -1915,6 +1915,7 @@ void PropertyEditor::_notification(int p_what) {
} }
if (p_what==NOTIFICATION_EXIT_TREE) { if (p_what==NOTIFICATION_EXIT_TREE) {
get_tree()->disconnect("node_removed",this,"_node_removed");
edit(NULL); edit(NULL);
} }

View file

@ -41,6 +41,11 @@ void ReparentDialog::_notification(int p_what) {
connect("confirmed", this,"_reparent"); connect("confirmed", this,"_reparent");
} }
if (p_what==NOTIFICATION_EXIT_TREE) {
disconnect("confirmed", this,"_reparent");
}
if (p_what==NOTIFICATION_DRAW) { if (p_what==NOTIFICATION_DRAW) {
//RID ci = get_canvas_item(); //RID ci = get_canvas_item();

View file

@ -471,8 +471,18 @@ void SceneTreeDock::_notification(int p_what) {
switch(p_what) { switch(p_what) {
case NOTIFICATION_ENTER_TREE: { case NOTIFICATION_READY: {
if (!first_enter)
break;
first_enter=false;
CanvasItemEditorPlugin *canvas_item_plugin = editor_data->get_editor("2D")->cast_to<CanvasItemEditorPlugin>();
if (canvas_item_plugin) {
canvas_item_plugin->get_canvas_item_editor()->connect("item_lock_status_changed", scene_tree, "_update_tree");
canvas_item_plugin->get_canvas_item_editor()->connect("item_group_status_changed", scene_tree, "_update_tree");
scene_tree->connect("node_changed", canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), "update");
}
static const char* button_names[TOOL_BUTTON_MAX]={ static const char* button_names[TOOL_BUTTON_MAX]={
"New", "New",
"Add", "Add",
@ -487,19 +497,12 @@ void SceneTreeDock::_notification(int p_what) {
"Remove", "Remove",
}; };
for(int i=0;i<TOOL_BUTTON_MAX;i++) for(int i=0;i<TOOL_BUTTON_MAX;i++)
tool_buttons[i]->set_icon(get_icon(button_names[i],"EditorIcons")); tool_buttons[i]->set_icon(get_icon(button_names[i],"EditorIcons"));
} break; } break;
case NOTIFICATION_READY: {
CanvasItemEditorPlugin *canvas_item_plugin = editor_data->get_editor("2D")->cast_to<CanvasItemEditorPlugin>();
if (canvas_item_plugin) {
canvas_item_plugin->get_canvas_item_editor()->connect("item_lock_status_changed", scene_tree, "_update_tree");
canvas_item_plugin->get_canvas_item_editor()->connect("item_group_status_changed", scene_tree, "_update_tree");
scene_tree->connect("node_changed", canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), "update");
}
} break;
} }
} }
@ -1367,7 +1370,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
add_child(import_subscene_dialog); add_child(import_subscene_dialog);
import_subscene_dialog->connect("subscene_selected",this,"_import_subscene"); import_subscene_dialog->connect("subscene_selected",this,"_import_subscene");
first_enter=true;
} }

View file

@ -90,6 +90,7 @@ class SceneTreeDock : public VBoxContainer {
EditorFileDialog *file; EditorFileDialog *file;
EditorSubScene *import_subscene_dialog; EditorSubScene *import_subscene_dialog;
bool first_enter;
void _create(); void _create();
Node *scene_root; Node *scene_root;

View file

@ -498,6 +498,7 @@ void SceneTreeEditor::_notification(int p_what) {
get_tree()->disconnect("tree_changed",this,"_tree_changed"); get_tree()->disconnect("tree_changed",this,"_tree_changed");
get_tree()->disconnect("node_removed",this,"_node_removed"); get_tree()->disconnect("node_removed",this,"_node_removed");
tree->disconnect("item_collapsed",this,"_cell_collapsed");
_update_tree(); _update_tree();
} }
@ -809,6 +810,11 @@ void SceneTreeDialog::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) { if (p_what==NOTIFICATION_ENTER_TREE) {
connect("confirmed", this,"_select"); connect("confirmed", this,"_select");
}
if (p_what==NOTIFICATION_EXIT_TREE) {
disconnect("confirmed", this,"_select");
} }
if (p_what==NOTIFICATION_DRAW) { if (p_what==NOTIFICATION_DRAW) {