diff options
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r-- | tools/editor/plugins/polygon_2d_editor_plugin.cpp | 9 | ||||
-rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/plugins/shader_editor_plugin.cpp | 5 |
3 files changed, 14 insertions, 2 deletions
diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp index 7dd8dd3035..27e539d50b 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp @@ -187,6 +187,8 @@ void Polygon2DEditor::_wip_close() { bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) { + if (node==NULL) + return false; switch(p_event.type) { @@ -701,11 +703,16 @@ void Polygon2DEditor::edit(Node *p_collision_polygon) { node=p_collision_polygon->cast_to<Polygon2D>(); if (!canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw")) canvas_item_editor->get_viewport_control()->connect("draw",this,"_canvas_draw"); + node->connect("exit_tree",this,"_node_removed",varray(),CONNECT_ONESHOT); wip.clear(); wip_active=false; edited_point=-1; } else { + + if (node) + node->disconnect("exit_tree",this,"_node_removed"); + node=NULL; if (canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw")) @@ -723,12 +730,14 @@ void Polygon2DEditor::_bind_methods() { ObjectTypeDB::bind_method(_MD("_uv_draw"),&Polygon2DEditor::_uv_draw); ObjectTypeDB::bind_method(_MD("_uv_input"),&Polygon2DEditor::_uv_input); ObjectTypeDB::bind_method(_MD("_uv_scroll_changed"),&Polygon2DEditor::_uv_scroll_changed); + ObjectTypeDB::bind_method(_MD("_node_removed"),&Polygon2DEditor::_node_removed); } Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { + node=NULL; canvas_item_editor=NULL; editor=p_editor; undo_redo = editor->get_undo_redo(); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index c0d773309c..a5164d971b 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1443,7 +1443,7 @@ void ScriptEditor::_add_callback(Object *p_obj, const String& p_function, const int pos = script->get_language()->find_function(p_function,code); if (pos==-1) { //does not exist - + ste->get_text_edit()->deselect(); pos=ste->get_text_edit()->get_line_count()+2; String func = script->get_language()->make_function("",p_function,p_args); //code=code+func; diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index d9bf4b6fa5..a6172ee098 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -144,10 +144,13 @@ void ShaderTextEditor::_validate_script() { Error err = ShaderLanguage::compile(code,type,NULL,NULL,&errortxt,&line,&col); if (err!=OK) { - String error_text="error("+itos(line)+","+itos(col)+"): "+errortxt; + String error_text="error("+itos(line+1)+","+itos(col)+"): "+errortxt; set_error(error_text); + get_text_edit()->set_line_as_marked(line,true); } else { + for(int i=0;i<get_text_edit()->get_line_count();i++) + get_text_edit()->set_line_as_marked(i,false); set_error(""); } |