summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_node.cpp11
-rw-r--r--tools/editor/editor_settings.cpp3
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp17
-rw-r--r--tools/editor/plugins/script_editor_plugin.h1
-rw-r--r--tools/editor/plugins/shader_editor_plugin.cpp4
-rw-r--r--tools/editor/script_editor_debugger.cpp3
6 files changed, 36 insertions, 3 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 92b22eb5d1..dee521beb3 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -704,7 +704,7 @@ void EditorNode::_get_scene_metadata(const String& p_file) {
cf.instance();
Error err = cf->load(path);
- if (err!=OK)
+ if (err!=OK || !cf->has_section("editor_states"))
return; //must not exist
List<String> esl;
@@ -740,7 +740,14 @@ void EditorNode::_set_scene_metadata(const String& p_file, int p_idx) {
Ref<ConfigFile> cf;
cf.instance();
- Dictionary md = editor_data.get_edited_scene()==p_idx?editor_data.get_editor_states():editor_data.get_scene_editor_states(p_idx);
+ Dictionary md;
+
+ if (p_idx<0 || editor_data.get_edited_scene()==p_idx) {
+ md = editor_data.get_editor_states();
+ } else {
+ md = editor_data.get_scene_editor_states(p_idx);
+ }
+
List<Variant> keys;
md.get_key_list(&keys);
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 7f496d0e22..c150e62754 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -554,6 +554,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("text_editor/create_signal_callbacks",true);
set("text_editor/autosave_interval_secs",0);
+ set("text_editor/block_caret", false);
set("text_editor/caret_blink", false);
set("text_editor/caret_blink_speed", 0.65);
hints["text_editor/caret_blink_speed"]=PropertyInfo(Variant::REAL,"text_editor/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1, 10, 0.1");
@@ -685,6 +686,7 @@ void EditorSettings::_load_default_text_editor_theme() {
set("text_editor/completion_scroll_color", Color::html("ffffff"));
set("text_editor/completion_font_color", Color::html("aaaaaa"));
set("text_editor/caret_color",Color::html("aaaaaa"));
+ set("text_editor/caret_background_color", Color::html("000000"));
set("text_editor/line_number_color",Color::html("66aaaaaa"));
set("text_editor/text_color",Color::html("aaaaaa"));
set("text_editor/text_selected_color",Color::html("000000"));
@@ -922,6 +924,7 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
cf->set_value(theme_section, "completion_scroll_color", ((Color)get("text_editor/completion_scroll_color")).to_html());
cf->set_value(theme_section, "completion_font_color", ((Color)get("text_editor/completion_font_color")).to_html());
cf->set_value(theme_section, "caret_color", ((Color)get("text_editor/caret_color")).to_html());
+ cf->set_value(theme_section, "caret_background_color", ((Color)get("text_editor/caret_background_color")).to_html());
cf->set_value(theme_section, "line_number_color", ((Color)get("text_editor/line_number_color")).to_html());
cf->set_value(theme_section, "text_color", ((Color)get("text_editor/text_color")).to_html());
cf->set_value(theme_section, "text_selected_color", ((Color)get("text_editor/text_selected_color")).to_html());
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index fc5f552723..65741fd072 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -317,6 +317,7 @@ void ScriptTextEditor::_load_theme_settings() {
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("caret_background_color",EDITOR_DEF("text_editor/caret_background_color",Color(0,0,0)));
get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));
get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2)));
@@ -1012,6 +1013,18 @@ void ScriptEditor::swap_lines(TextEdit *tx, int line1, int line2)
tx->cursor_set_line(line2);
}
+void ScriptEditor::_breakpoint_toggled(const int p_row) {
+ int selected = tab_container->get_current_tab();
+ if (selected<0 || selected>=tab_container->get_child_count()) {
+ return;
+ }
+
+ ScriptTextEditor *current = tab_container->get_child(selected)->cast_to<ScriptTextEditor>();
+ if (current) {
+ get_debugger()->set_breakpoint(current->get_edited_script()->get_path(),p_row+1,current->get_text_edit()->is_line_set_as_breakpoint(p_row));
+ }
+}
+
void ScriptEditor::_file_dialog_action(String p_file) {
switch (file_dialog_option) {
@@ -2195,9 +2208,11 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
ste->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
ste->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
ste->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter"));
+ ste->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
ste->get_text_edit()->set_callhint_settings(
EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"),
EditorSettings::get_singleton()->get("text_editor/callhint_tooltip_offset"));
+ ste->get_text_edit()->connect("breakpoint_toggled", this, "_breakpoint_toggled");
tab_container->add_child(ste);
_go_to_tab(tab_container->get_tab_count()-1);
@@ -2362,6 +2377,7 @@ void ScriptEditor::_editor_settings_changed() {
ste->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
ste->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
ste->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter"));
+ ste->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
}
ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true));
@@ -2671,6 +2687,7 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_res_saved_callback",&ScriptEditor::_res_saved_callback);
ObjectTypeDB::bind_method("_goto_script_line",&ScriptEditor::_goto_script_line);
ObjectTypeDB::bind_method("_goto_script_line2",&ScriptEditor::_goto_script_line2);
+ ObjectTypeDB::bind_method("_breakpoint_toggled", &ScriptEditor::_breakpoint_toggled);
ObjectTypeDB::bind_method("_breaked",&ScriptEditor::_breaked);
ObjectTypeDB::bind_method("_show_debugger",&ScriptEditor::_show_debugger);
ObjectTypeDB::bind_method("_get_debug_tooltip",&ScriptEditor::_get_debug_tooltip);
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 2e6e2c035c..dfa72490a5 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -321,6 +321,7 @@ public:
void get_breakpoints(List<String> *p_breakpoints);
void swap_lines(TextEdit *tx, int line1, int line2);
+ void _breakpoint_toggled(const int p_row);
void save_all_scripts();
diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp
index 9ef84af260..b3317e8313 100644
--- a/tools/editor/plugins/shader_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_editor_plugin.cpp
@@ -86,6 +86,7 @@ void ShaderTextEditor::_load_theme_settings() {
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("caret_background_color",EDITOR_DEF("text_editor/caret_background_color",Color(0,0,0)));
get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));
get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2)));
@@ -381,6 +382,7 @@ void ShaderEditor::_editor_settings_changed() {
vertex_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
vertex_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
vertex_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
+ vertex_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
fragment_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
fragment_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
@@ -392,6 +394,7 @@ void ShaderEditor::_editor_settings_changed() {
fragment_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
fragment_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
fragment_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
+ fragment_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
light_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete"));
light_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file"));
@@ -403,6 +406,7 @@ void ShaderEditor::_editor_settings_changed() {
light_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink"));
light_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed"));
light_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/line_spacing"));
+ light_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret"));
}
void ShaderEditor::_bind_methods() {
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index fc746bc21d..b6390e5aae 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -338,8 +338,9 @@ void ScriptEditorDebugger::_parse_message(const String& p_msg,const Array& p_dat
docontinue->set_disabled(false);
emit_signal("breaked",true,can_continue);
OS::get_singleton()->move_window_to_foreground();
- if (!profiler->is_seeking())
+ if (error!="") {
tabs->set_current_tab(0);
+ }
profiler->set_enabled(false);