From 089d7fa171e3a3305991047e82b4043d4f05783f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 15 Dec 2014 15:42:58 -0300 Subject: Small batch of fixes -=-=-=-=-=-=-=-=-=-= -Fixed looping error in AudioStreamResampled -winrt port progress -fixes in material in ambient light --- tools/editor/editor_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 2927e7c870..dbc896cbb9 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -3422,7 +3422,7 @@ EditorNode::EditorNode() { p->add_item("New Scene",FILE_NEW_SCENE); p->add_item("Open Scene..",FILE_OPEN_SCENE,KEY_MASK_CMD+KEY_O); p->add_item("Save Scene",FILE_SAVE_SCENE,KEY_MASK_CMD+KEY_S); - p->add_item("Save Scene As..",FILE_SAVE_AS_SCENE); + p->add_item("Save Scene As..",FILE_SAVE_AS_SCENE,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_S); p->add_separator(); p->add_item("Goto Prev. Scene",FILE_OPEN_PREV,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_P); p->add_submenu_item("Open Recent","RecentScenes",FILE_OPEN_RECENT); -- cgit v1.2.3 From bcf27feb980aec593c7cb771984e46113cfad757 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 16 Dec 2014 22:31:57 -0300 Subject: New Code Completion -=-=-=-=-=-=-=-=-=- -Massive improvement to code completion -Argument hinting for functions If you manage to out-smart the code-completion in a situation where completion should be possible to guess, let me know. Please enter the commit message for your changes. Lines starting --- tools/editor/code_editor.cpp | 13 ++++-- tools/editor/code_editor.h | 4 +- .../plugins/collision_polygon_editor_plugin.cpp | 2 + tools/editor/plugins/script_editor_plugin.cpp | 48 +++++++++++++++++----- tools/editor/plugins/script_editor_plugin.h | 2 +- 5 files changed, 52 insertions(+), 17 deletions(-) (limited to 'tools') diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 6de59f184a..84bf7d33f4 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -487,6 +487,7 @@ FindReplaceDialog::FindReplaceDialog() { vb->add_child(error_label); + set_hide_on_ok(false); } @@ -507,15 +508,19 @@ void CodeTextEditor::_text_changed() { } void CodeTextEditor::_code_complete_timer_timeout() { + if (!is_visible()) + return; if (enable_complete_timer) text_editor->query_code_comple(); } -void CodeTextEditor::_complete_request(const String& p_request, int p_line) { +void CodeTextEditor::_complete_request() { List entries; - _code_complete_script(text_editor->get_text(),p_request,p_line,&entries); + _code_complete_script(text_editor->get_text_for_completion(),&entries); // print_line("COMPLETE: "+p_request); + if (entries.size()==0) + return; Vector strs; strs.resize(entries.size()); int i=0; @@ -555,7 +560,7 @@ void CodeTextEditor::_on_settings_change() { // AUTO BRACE COMPLETION text_editor->set_auto_brace_completion( - EDITOR_DEF("text_editor/auto_brace_complete", false) + EDITOR_DEF("text_editor/auto_brace_complete", true) ); code_complete_timer->set_wait_time( @@ -632,6 +637,8 @@ CodeTextEditor::CodeTextEditor() { text_editor->connect("request_completion", this,"_complete_request"); Vector cs; cs.push_back("."); + cs.push_back(","); + cs.push_back("("); text_editor->set_completion(true,cs); idle->connect("timeout", this,"_text_changed_idle_timeout"); diff --git a/tools/editor/code_editor.h b/tools/editor/code_editor.h index 1804237f18..f82eaf5ec5 100644 --- a/tools/editor/code_editor.h +++ b/tools/editor/code_editor.h @@ -135,7 +135,7 @@ class CodeTextEditor : public Control { void _on_settings_change(); - void _complete_request(const String& p_request,int p_line); + void _complete_request(); protected: void set_error(const String& p_error); @@ -143,7 +143,7 @@ protected: virtual void _load_theme_settings() {} virtual void _validate_script()=0; - virtual void _code_complete_script(const String& p_code, const String& p_keyword,int p_line, List* r_options) {}; + virtual void _code_complete_script(const String& p_code, List* r_options) {}; void _text_changed_idle_timeout(); diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp index 35f22aa6f8..b92acb60f9 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -120,6 +120,8 @@ void CollisionPolygonEditor::_wip_close() { bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) { + if (!node) + return false; Transform gt = node->get_global_transform(); float depth = node->get_depth()*0.5; diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index c5fb574c71..159e0de7fd 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -384,9 +384,35 @@ void ScriptTextEditor::_validate_script() { _update_name(); } -void ScriptTextEditor::_code_complete_script(const String& p_code, const String& p_keyword,int p_line, List* r_options) { - Error err = script->get_language()->complete_keyword(p_code,p_line,script->get_path().get_base_dir(),p_keyword,r_options); +static Node* _find_node_for_script(Node* p_base, Node*p_current, const Ref