From 6c27df8df609337867c108c5adb66174393e190b Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 23 Jan 2016 19:51:51 -0300 Subject: [PATCH] -Fixes a bunch of stdout errors, closes #2763 closes #2731 --- tools/editor/animation_editor.cpp | 4 +++- tools/editor/connections_dialog.cpp | 7 +++++-- tools/editor/editor_node.cpp | 8 ++++---- tools/editor/plugins/animation_player_editor_plugin.cpp | 2 +- tools/editor/plugins/shader_editor_plugin.cpp | 2 +- tools/editor/plugins/sprite_region_editor_plugin.cpp | 2 +- tools/editor/property_editor.cpp | 4 ++-- tools/editor/scene_tree_editor.cpp | 3 +++ tools/editor/script_editor_debugger.cpp | 4 +++- 9 files changed, 23 insertions(+), 13 deletions(-) diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index fbe50d6d96a..cdce9106655 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -2814,6 +2814,8 @@ void AnimationKeyEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { + key_editor->edit(key_edit); + zoomicon->set_texture( get_icon("Zoom","EditorIcons") ); menu_add_track->set_icon(get_icon("AddTrack","EditorIcons")); @@ -3924,7 +3926,7 @@ AnimationKeyEditor::AnimationKeyEditor() { key_edit = memnew( AnimationKeyEdit ); key_edit->undo_redo=undo_redo; //key_edit->ke_dialog=key_edit_dialog; - key_editor->edit(key_edit); + type_menu = memnew( PopupMenu ); add_child(type_menu); for(int i=0;idraw(ci,Rect2(Point2(),get_size())); - } + } + + if (p_what==NOTIFICATION_ENTER_TREE) { + bind_editor->edit(cdbinds); + } } void ConnectDialog::_tree_node_selected() { @@ -456,7 +460,6 @@ ConnectDialog::ConnectDialog() { set_as_toplevel(true); cdbinds = memnew( ConnectDialogBinds ); - bind_editor->edit(cdbinds); error = memnew( ConfirmationDialog ); add_child(error); diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 8d5f5e8aca5..9fe76a738af 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4533,14 +4533,14 @@ void EditorNode::_scene_tab_changed(int p_tab) { editor_data.get_undo_redo().create_action("Switch Scene Tab"); editor_data.get_undo_redo().add_do_method(this,"set_current_version",unsaved?saved_version:0); editor_data.get_undo_redo().add_do_method(this,"set_current_scene",p_tab); - editor_data.get_undo_redo().add_do_method(scene_tabs,"set_current_tab",p_tab); - editor_data.get_undo_redo().add_do_method(scene_tabs,"ensure_tab_visible",p_tab); + //editor_data.get_undo_redo().add_do_method(scene_tabs,"set_current_tab",p_tab); + //editor_data.get_undo_redo().add_do_method(scene_tabs,"ensure_tab_visible",p_tab); editor_data.get_undo_redo().add_do_method(this,"set_current_version",next_scene_version==0?editor_data.get_undo_redo().get_version()+1:next_scene_version); editor_data.get_undo_redo().add_undo_method(this,"set_current_version",next_scene_version); editor_data.get_undo_redo().add_undo_method(this,"set_current_scene",editor_data.get_edited_scene()); - editor_data.get_undo_redo().add_undo_method(scene_tabs,"set_current_tab",editor_data.get_edited_scene()); - editor_data.get_undo_redo().add_undo_method(scene_tabs,"ensure_tab_visible",p_tab,editor_data.get_edited_scene()); + //editor_data.get_undo_redo().add_undo_method(scene_tabs,"set_current_tab",editor_data.get_edited_scene()); + //editor_data.get_undo_redo().add_undo_method(scene_tabs,"ensure_tab_visible",p_tab,editor_data.get_edited_scene()); editor_data.get_undo_redo().add_undo_method(this,"set_current_version",saved_version); editor_data.get_undo_redo().commit_action(); diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index b56140b32df..43b4276d454 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -93,7 +93,7 @@ void AnimationPlayerEditor::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { - editor->connect("hide_animation_player_editors",this,"_hide_anim_editors"); +// editor->connect("hide_animation_player_editors",this,"_hide_anim_editors"); add_anim->set_icon( get_icon("New","EditorIcons") ); rename_anim->set_icon( get_icon("Rename","EditorIcons") ); duplicate_anim->set_icon( get_icon("Duplicate","EditorIcons") ); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 65b5365b50c..18d8f5efc0b 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -234,7 +234,7 @@ void ShaderEditor::_tab_changed(int p_which) { ShaderTextEditor *shader_editor = tab_container->get_tab_control(p_which)->cast_to(); - if (shader_editor) + if (shader_editor && is_inside_tree()) shader_editor->get_text_edit()->grab_focus(); ensure_select_current(); diff --git a/tools/editor/plugins/sprite_region_editor_plugin.cpp b/tools/editor/plugins/sprite_region_editor_plugin.cpp index 725de19dd7d..8dfa8a60a6f 100644 --- a/tools/editor/plugins/sprite_region_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_region_editor_plugin.cpp @@ -367,7 +367,7 @@ void SpriteRegionEditor::edit(Node *p_sprite) { if (p_sprite) { node=p_sprite->cast_to(); - node->connect("exit_tree",this,"_node_removed",varray(),CONNECT_ONESHOT); + node->connect("exit_tree",this,"_node_removed",varray(p_sprite),CONNECT_ONESHOT); } else { if (node) node->disconnect("exit_tree",this,"_node_removed"); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index e5dc2db0214..4b1b93ea6e7 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -3099,7 +3099,7 @@ void PropertyEditor::update_tree() { int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0; if (_get_instanced_node_original_property(p.name,vorig) || usage) { Variant v = obj->get(p.name); - + if (_is_property_different(v,vorig,usage)) { //print_line("FOR "+String(p.name)+" RELOAD WITH: "+String(v)+"("+Variant::get_type_name(v.get_type())+")=="+String(vorig)+"("+Variant::get_type_name(vorig.get_type())+")"); @@ -3908,7 +3908,7 @@ SectionedPropertyEditor::SectionedPropertyEditor() { right_vb->add_margin_child("Properties:",editor,true); editor->get_scene_tree()->set_column_titles_visible(false); - add_child(editor); + editor->hide_top_label(); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index ea7d7601333..0260457c818 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -721,6 +721,9 @@ void SceneTreeEditor::_update_selection(TreeItem *item) { NodePath np = item->get_metadata(0); + if (!has_node(np)) + return; + Node *n=get_node(np); if (!n) diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 297f10a1c83..e727668c49c 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -530,6 +530,8 @@ void ScriptEditorDebugger::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { + inspector->edit(variables); + step->set_icon( get_icon("DebugStep","EditorIcons")); next->set_icon( get_icon("DebugNext","EditorIcons")); back->set_icon( get_icon("Back","EditorIcons")); @@ -1308,7 +1310,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){ pending_in_queue=0; variables = memnew( ScriptEditorDebuggerVariables ); - inspector->edit(variables); + breaked=false; tabs->add_child(dbg);