summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/create_dialog.cpp3
-rw-r--r--tools/editor/editor_node.cpp15
-rw-r--r--tools/editor/editor_settings.cpp3
-rw-r--r--tools/editor/icons/SCsub2
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp2
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.cpp2
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp74
-rw-r--r--tools/editor/plugins/script_editor_plugin.h4
-rw-r--r--tools/editor/plugins/shader_editor_plugin.cpp4
-rw-r--r--tools/editor/project_manager.cpp5
-rw-r--r--tools/editor/property_editor.cpp31
-rw-r--r--tools/editor/scene_tree_dock.cpp13
-rw-r--r--tools/editor/scene_tree_editor.cpp28
-rw-r--r--tools/editor/script_editor_debugger.cpp3
-rw-r--r--tools/editor/settings_config_dialog.cpp15
-rw-r--r--tools/editor/settings_config_dialog.h1
17 files changed, 159 insertions, 48 deletions
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index 210b799f3d..07d1566ab8 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -154,6 +154,9 @@ void CreateDialog::_update_search() {
TreeItem *root = search_options->create_item();
root->set_text(0,base_type);
+ if (has_icon(base_type,"EditorIcons")) {
+ root->set_icon(0,get_icon(base_type,"EditorIcons"));
+ }
List<StringName>::Element *I=type_list.front();
TreeItem *to_select=NULL;
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 81f9927b92..d843b6ef6a 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);
@@ -1168,6 +1175,8 @@ void EditorNode::_dialog_action(String p_file) {
case SETTINGS_PICK_MAIN_SCENE: {
Globals::get_singleton()->set("application/main_scene",p_file);
+ Globals::get_singleton()->set_persisting("application/main_scene",true);
+ Globals::get_singleton()->save();
//would be nice to show the project manager opened with the hilighted field..
} break;
case FILE_SAVE_OPTIMIZED: {
@@ -2154,7 +2163,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
String existing;
if (extensions.size()) {
String root_name(get_edited_scene()->get_name());
- existing=root_name+".tscn";//+extensions.front()->get().to_lower();
+ existing=root_name+"."+extensions.front()->get().to_lower();
}
file->set_current_path(existing);
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/icons/SCsub b/tools/editor/icons/SCsub
index 7132968c88..f2f5dcca48 100644
--- a/tools/editor/icons/SCsub
+++ b/tools/editor/icons/SCsub
@@ -65,7 +65,7 @@ def make_editor_icons_action(target, source, env):
s.write("static Ref<ImageTexture> make_icon(const uint8_t* p_png,const uint8_t* p_hidpi_png) {\n")
s.write("\tRef<ImageTexture> texture( memnew( ImageTexture ) );\n")
s.write("\tImage img((editor_is_hidpi()&&p_hidpi_png)?p_hidpi_png:p_png);\n")
- s.write("\tif (editor_is_hidpi() && !p_hidpi_png) img.expand_x2_hq2x();\n")
+ s.write("\tif (editor_is_hidpi() && !p_hidpi_png) { img.convert(Image::FORMAT_RGBA); img.expand_x2_hq2x(); }\n")
s.write("\ttexture->create_from_image( img,ImageTexture::FLAG_FILTER );\n")
s.write("\treturn texture;\n")
s.write("}\n\n")
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index e24412d4ef..fa62283e37 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -756,6 +756,8 @@ void EditorSceneImportDialog::_import(bool p_and_open) {
}
+ // Scenes should always be imported as binary format since vertex data is large and would take
+ // up a lot of space and time to load if imported as text format (GH-5778)
String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+".scn");
print_line("Saving to: "+save_file);
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
index 1d8319d460..60642999f2 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -147,8 +147,6 @@ void EditorImportTextureOptions::_changed() {
void EditorImportTextureOptions::_bind_methods() {
- print_line("bind toptions");
-
ObjectTypeDB::bind_method("_changed",&EditorImportTextureOptions::_changed);
ObjectTypeDB::bind_method("_changedp",&EditorImportTextureOptions::_changedp);
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index 0c9bb1eef0..ec5ac8592b 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3403,7 +3403,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_set", TTR("Zoom Set..")), ZOOM_SET);
p->add_separator();
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/center_selection", TTR("Center Selection"), KEY_F), VIEW_CENTER_TO_SELECTION);
- p->add_shortcut(ED_SHORTCUT("canvas_item_editor/frame_selection", TTR("Frame Selection"), KEY_MASK_CMD | KEY_F), VIEW_FRAME_TO_SELECTION);
+ p->add_shortcut(ED_SHORTCUT("canvas_item_editor/frame_selection", TTR("Frame Selection"), KEY_MASK_SHIFT | KEY_F), VIEW_FRAME_TO_SELECTION);
anchor_menu = memnew( MenuButton );
anchor_menu->set_text(TTR("Anchor"));
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index fc5f552723..4032a790d8 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)));
@@ -818,7 +819,7 @@ void ScriptEditor::_close_tab(int p_idx) {
_update_script_names();
- EditorNode::get_singleton()->save_layout();
+ _save_layout();
}
void ScriptEditor::_close_current_tab() {
@@ -827,6 +828,22 @@ void ScriptEditor::_close_current_tab() {
}
+void ScriptEditor::_close_docs_tab() {
+
+ int child_count = tab_container->get_child_count();
+ for (int i = child_count-1; i>=0; i--) {
+
+ EditorHelp *ste = tab_container->get_child(i)->cast_to<EditorHelp>();
+
+ if (ste) {
+ _close_tab(i);
+ }
+
+ }
+
+}
+
+
void ScriptEditor::_resave_scripts(const String& p_str) {
@@ -1012,6 +1029,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) {
@@ -1468,7 +1497,9 @@ void ScriptEditor::_menu_option(int p_option) {
if (scr.is_null())
return;
scr->set_source_code(te->get_text());
- scr->get_language()->reload_tool_script(scr,p_option==FILE_TOOL_RELOAD_SOFT);
+ bool soft = p_option==FILE_TOOL_RELOAD_SOFT || scr->get_instance_base_type()=="EditorPlugin"; //always soft-reload editor plugins
+
+ scr->get_language()->reload_tool_script(scr,soft);
} break;
case EDIT_TRIM_TRAILING_WHITESAPCE: {
_trim_trailing_whitespace(current->get_text_edit());
@@ -1598,6 +1629,9 @@ void ScriptEditor::_menu_option(int p_option) {
_close_current_tab();
}
} break;
+ case CLOSE_DOCS: {
+ _close_docs_tab();
+ } break;
case WINDOW_MOVE_LEFT: {
if (tab_container->get_current_tab()>0) {
@@ -1645,6 +1679,9 @@ void ScriptEditor::_menu_option(int p_option) {
case FILE_CLOSE: {
_close_current_tab();
} break;
+ case CLOSE_DOCS: {
+ _close_docs_tab();
+ } break;
}
@@ -2044,6 +2081,9 @@ void ScriptEditor::_update_script_colors() {
void ScriptEditor::_update_script_names() {
+ if (restoring_layout)
+ return;
+
waiting_update_names=false;
Set<Ref<Script> > used;
Node* edited = EditorNode::get_singleton()->get_edited_scene();
@@ -2195,9 +2235,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);
@@ -2205,10 +2247,8 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
_update_script_names();
+ _save_layout();
ste->connect("name_changed",this,"_update_script_names");
- if (!restoring_layout) {
- EditorNode::get_singleton()->save_layout();
- }
//test for modification, maybe the script was not edited but was loaded
@@ -2328,6 +2368,15 @@ void ScriptEditor::_add_callback(Object *p_obj, const String& p_function, const
}
+void ScriptEditor::_save_layout() {
+
+ if (restoring_layout) {
+ return;
+ }
+
+ editor->save_layout();
+}
+
void ScriptEditor::_editor_settings_changed() {
trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/trim_trailing_whitespace_on_save");
@@ -2362,6 +2411,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));
@@ -2384,7 +2434,7 @@ void ScriptEditor::_tree_changed() {
void ScriptEditor::_script_split_dragged(float) {
- EditorNode::get_singleton()->save_layout();
+ _save_layout();
}
void ScriptEditor::_unhandled_input(const InputEvent& p_event) {
@@ -2430,7 +2480,6 @@ void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
}
}
-
for(int i=0;i<helps.size();i++) {
String path = helps[i];
@@ -2446,9 +2495,9 @@ void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
script_split->set_split_offset(p_layout->get_value("ScriptEditor","split_offset"));
}
-
restoring_layout=false;
+ _update_script_names();
}
void ScriptEditor::get_window_layout(Ref<ConfigFile> p_layout) {
@@ -2508,7 +2557,7 @@ void ScriptEditor::_help_class_open(const String& p_class) {
eh->go_to_class(p_class,0);
eh->connect("go_to_help",this,"_help_class_goto");
_update_script_names();
-
+ _save_layout();
}
void ScriptEditor::_help_class_goto(const String& p_desc) {
@@ -2537,7 +2586,7 @@ void ScriptEditor::_help_class_goto(const String& p_desc) {
eh->go_to_help(p_desc);
eh->connect("go_to_help",this,"_help_class_goto");
_update_script_names();
-
+ _save_layout();
}
void ScriptEditor::_update_history_pos(int p_new_pos) {
@@ -2662,6 +2711,7 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_tab_changed",&ScriptEditor::_tab_changed);
ObjectTypeDB::bind_method("_menu_option",&ScriptEditor::_menu_option);
ObjectTypeDB::bind_method("_close_current_tab",&ScriptEditor::_close_current_tab);
+ ObjectTypeDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab);
ObjectTypeDB::bind_method("_editor_play",&ScriptEditor::_editor_play);
ObjectTypeDB::bind_method("_editor_pause",&ScriptEditor::_editor_pause);
ObjectTypeDB::bind_method("_editor_stop",&ScriptEditor::_editor_stop);
@@ -2671,6 +2721,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);
@@ -2743,7 +2794,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_theme", TTR("Save Theme")), FILE_SAVE_THEME);
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_theme_as", TTR("Save Theme As")), FILE_SAVE_THEME_AS);
file_menu->get_popup()->add_separator();
- file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD|KEY_W), FILE_CLOSE);
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS);
+ file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE);
file_menu->get_popup()->connect("item_pressed", this,"_menu_option");
edit_menu = memnew( MenuButton );
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 2e6e2c035c..2f079b9fc7 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -127,6 +127,7 @@ class ScriptEditor : public VBoxContainer {
FILE_SAVE_THEME,
FILE_SAVE_THEME_AS,
FILE_CLOSE,
+ CLOSE_DOCS,
EDIT_UNDO,
EDIT_REDO,
EDIT_CUT,
@@ -237,6 +238,7 @@ class ScriptEditor : public VBoxContainer {
void _close_tab(int p_idx);
void _close_current_tab();
+ void _close_docs_tab();
bool grab_focus_block;
@@ -268,6 +270,7 @@ class ScriptEditor : public VBoxContainer {
void _update_window_menu();
void _script_created(Ref<Script> p_script);
+ void _save_layout();
void _editor_settings_changed();
void _autosave_scripts();
@@ -321,6 +324,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/project_manager.cpp b/tools/editor/project_manager.cpp
index 52c8ca4d6c..b7d3abfd5b 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -203,14 +203,15 @@ private:
} else {
f->store_line("; Engine configuration file.");
- f->store_line("; It's best to edit using the editor UI, not directly,");
- f->store_line("; becausethe parameters that go here are not obvious.");
+ f->store_line("; It's best edited using the editor UI and not directly,");
+ f->store_line("; since the parameters that go here are not all obvious.");
f->store_line("; ");
f->store_line("; Format: ");
f->store_line("; [section] ; section goes between []");
f->store_line("; param=value ; assign values to parameters");
f->store_line("\n");
f->store_line("[application]");
+ f->store_line("\n");
f->store_line("name=\""+project_name->get_text()+"\"");
f->store_line("icon=\"res://icon.png\"");
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index ceb62d5ff0..54d197f10d 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -4232,19 +4232,32 @@ String SectionedPropertyEditor::get_full_item_path(const String& p_item) {
void SectionedPropertyEditor::edit(Object* p_object) {
- if (p_object) {
- obj=p_object->get_instance_ID();
- update_category_list();
- } else {
+ if (!p_object) {
+ obj = -1;
sections->clear();
+
+ filter->set_edited(NULL);
+ editor->edit(NULL);
+
+ return;
}
- filter->set_edited(p_object);
- editor->edit(filter);
+ ObjectID id = p_object->get_instance_ID();
+
+ if (obj != id) {
+
+ obj = id;
+ update_category_list();
- sections->select(0);
- _section_selected(0);
+ filter->set_edited(p_object);
+ editor->edit(filter);
+ sections->select(0);
+ _section_selected(0);
+ } else {
+
+ update_category_list();
+ }
}
void SectionedPropertyEditor::update_category_list() {
@@ -4300,6 +4313,8 @@ PropertyEditor *SectionedPropertyEditor::get_property_editor() {
SectionedPropertyEditor::SectionedPropertyEditor() {
+ obj = -1;
+
VBoxContainer *left_vb = memnew( VBoxContainer);
left_vb->set_custom_minimum_size(Size2(160,0)*EDSCALE);
add_child(left_vb);
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 2e7d65eadc..e4dfcc0f62 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -1574,14 +1574,12 @@ void SceneTreeDock::_normalize_drop(Node*& to_node, int &to_pos, int p_type) {
to_pos=-1;
- if (p_type==1 && to_node==EditorNode::get_singleton()->get_edited_scene()) {
- //if at lower sibling of root node
- to_pos=0; //just insert at begining of root node
- } else if (p_type==-1) {
+ if (p_type==-1) {
//drop at above selected node
if (to_node==EditorNode::get_singleton()->get_edited_scene()) {
to_node=NULL;
- ERR_FAIL_COND(to_node==EditorNode::get_singleton()->get_edited_scene());
+ ERR_EXPLAIN("Cannot perform drop above the root node!");
+ ERR_FAIL();
}
Node* upper_sibling=NULL;
@@ -1617,8 +1615,9 @@ void SceneTreeDock::_normalize_drop(Node*& to_node, int &to_pos, int p_type) {
} else if (p_type==1) {
//drop at below selected node
if (to_node==EditorNode::get_singleton()->get_edited_scene()) {
- to_node=NULL;
- ERR_FAIL_COND(to_node==EditorNode::get_singleton()->get_edited_scene());
+ //if at lower sibling of root node
+ to_pos=0; //just insert at begining of root node
+ return;
}
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index f174bc2f1b..73358e805d 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -260,13 +260,21 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id)
} else if (p_id==BUTTON_SIGNALS) {
- item->select(0);
+ editor_selection->clear();
+ editor_selection->add_node(n);
+
+ set_selected(n);
+
NodeDock::singleton->get_parent()->call("set_current_tab",NodeDock::singleton->get_index());
NodeDock::singleton->show_connections();
} else if (p_id==BUTTON_GROUPS) {
- item->select(0);
+ editor_selection->clear();
+ editor_selection->add_node(n);
+
+ set_selected(n);
+
NodeDock::singleton->get_parent()->call("set_current_tab",NodeDock::singleton->get_index());
NodeDock::singleton->show_groups();
}
@@ -975,6 +983,14 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2& p_point,const Variant& p_da
if (!d.has("type"))
return false;
+ TreeItem *item = tree->get_item_at_pos(p_point);
+ if (!item)
+ return false;
+
+ int section = tree->get_drop_section_at_pos(p_point);
+ if (section<-1 || (section==-1 && !item->get_parent()))
+ return false;
+
if (String(d["type"])=="files") {
Vector<String> files = d["files"];
@@ -997,15 +1013,7 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2& p_point,const Variant& p_da
if (String(d["type"])=="nodes") {
- TreeItem *item = tree->get_item_at_pos(p_point);
- if (!item)
- return false;
- int section = tree->get_drop_section_at_pos(p_point);
- if (section<-1 || (section==-1 && !item->get_parent()))
- return false;
-
return true;
-
}
return false;
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);
diff --git a/tools/editor/settings_config_dialog.cpp b/tools/editor/settings_config_dialog.cpp
index f436e369af..50989ea5cb 100644
--- a/tools/editor/settings_config_dialog.cpp
+++ b/tools/editor/settings_config_dialog.cpp
@@ -46,9 +46,18 @@ void EditorSettingsDialog::ok_pressed() {
void EditorSettingsDialog::_settings_changed() {
-
timer->start();
- property_editor->get_property_editor()->update_tree(); // else color's won't update when theme is selected.
+}
+
+void EditorSettingsDialog::_settings_property_edited(const String& p_name) {
+
+ String full_name = property_editor->get_full_item_path(p_name);
+
+ // Small usability workaround to update the text color settings when the
+ // color theme is changed
+ if (full_name == "text_editor/color_theme") {
+ property_editor->get_property_editor()->update_tree();
+ }
}
void EditorSettingsDialog::_settings_save() {
@@ -281,6 +290,7 @@ void EditorSettingsDialog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_settings_save"),&EditorSettingsDialog::_settings_save);
ObjectTypeDB::bind_method(_MD("_settings_changed"),&EditorSettingsDialog::_settings_changed);
+ ObjectTypeDB::bind_method(_MD("_settings_property_edited"),&EditorSettingsDialog::_settings_property_edited);
ObjectTypeDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box);
ObjectTypeDB::bind_method(_MD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_search_box);
ObjectTypeDB::bind_method(_MD("_shortcut_button_pressed"),&EditorSettingsDialog::_shortcut_button_pressed);
@@ -325,6 +335,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
property_editor->get_property_editor()->register_text_enter(search_box);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vbc->add_child(property_editor);
+ property_editor->get_property_editor()->connect("property_edited", this, "_settings_property_edited");
vbc = memnew( VBoxContainer );
tabs->add_child(vbc);
diff --git a/tools/editor/settings_config_dialog.h b/tools/editor/settings_config_dialog.h
index 68a2b008f0..3b91c7f019 100644
--- a/tools/editor/settings_config_dialog.h
+++ b/tools/editor/settings_config_dialog.h
@@ -64,6 +64,7 @@ class EditorSettingsDialog : public AcceptDialog {
virtual void ok_pressed();
void _settings_changed();
+ void _settings_property_edited(const String& p_name);
void _settings_save();
void _notification(int p_what);