diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/code_editor.cpp | 3 | ||||
-rw-r--r-- | tools/editor/connections_dialog.cpp | 98 | ||||
-rw-r--r-- | tools/editor/create_dialog.cpp | 6 | ||||
-rw-r--r-- | tools/editor/editor_file_dialog.cpp | 4 | ||||
-rw-r--r-- | tools/editor/editor_help.cpp | 2 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 12 | ||||
-rw-r--r-- | tools/editor/editor_node.h | 1 | ||||
-rw-r--r-- | tools/editor/editor_settings.cpp | 22 | ||||
-rw-r--r-- | tools/editor/editor_settings.h | 6 | ||||
-rw-r--r-- | tools/editor/plugins/script_editor_plugin.cpp | 14 | ||||
-rw-r--r-- | tools/editor/plugins/sprite_frames_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | tools/editor/plugins/theme_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | tools/editor/plugins/tile_map_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | tools/editor/property_editor.cpp | 10 | ||||
-rw-r--r-- | tools/editor/quick_open.cpp | 4 | ||||
-rw-r--r-- | tools/editor/scene_tree_dock.cpp | 2 | ||||
-rw-r--r-- | tools/editor/scene_tree_editor.cpp | 48 | ||||
-rw-r--r-- | tools/editor/scene_tree_editor.h | 2 | ||||
-rw-r--r-- | tools/editor/scenes_dock.cpp | 5 | ||||
-rw-r--r-- | tools/editor/script_editor_debugger.cpp | 4 |
20 files changed, 157 insertions, 95 deletions
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index f62209fafa..d023827a3c 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -521,6 +521,9 @@ FindReplaceBar::FindReplaceBar() { error_label = memnew(Label); search_options->add_child(error_label); + error_label->add_color_override("font_color", Color(1,1,0,1)); + error_label->add_color_override("font_color_shadow", Color(0,0,0,1)); + error_label->add_constant_override("shadow_as_outline", 1); search_options->add_spacer(); diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp index e2b8f2884f..222e42f8a7 100644 --- a/tools/editor/connections_dialog.cpp +++ b/tools/editor/connections_dialog.cpp @@ -294,47 +294,33 @@ void ConnectDialog::_bind_methods() { ConnectDialog::ConnectDialog() { - int margin = get_constant("margin","Dialogs"); - int button_margin = get_constant("button_margin","Dialogs"); + VBoxContainer *vbc = memnew( VBoxContainer ); + add_child(vbc); + set_child_rect(vbc); + HBoxContainer *main_hb = memnew( HBoxContainer ); + vbc->add_child(main_hb); + main_hb->set_v_size_flags(SIZE_EXPAND_FILL); - Label * label = memnew( Label ); - label->set_pos( Point2( 8,11) ); - label->set_text(TTR("Connect To Node:")); - - - add_child(label); - label = memnew( Label ); - label->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - label->set_pos( Point2( 0.5,11) ); - label->set_text(TTR("Binds (Extra Params):")); - add_child(label); + VBoxContainer *vbc_left = memnew( VBoxContainer ); + main_hb->add_child(vbc_left); + vbc_left->set_h_size_flags(SIZE_EXPAND_FILL); tree = memnew(SceneTreeEditor(false)); - tree->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); - tree->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - tree->set_begin( Point2( 15,32) ); - tree->set_end( Point2( 0.5,127 ) ); + vbc_left->add_margin_child(TTR("Conect To Node:"),tree,true); - add_child(tree); - bind_editor = memnew( PropertyEditor ); - bind_editor->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - bind_editor->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - bind_editor->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - bind_editor->set_begin( Point2( 0.51,42) ); - bind_editor->set_end( Point2( 15,127 ) ); - bind_editor->get_top_label()->hide(); - add_child(bind_editor); + VBoxContainer *vbc_right = memnew( VBoxContainer ); + main_hb->add_child(vbc_right); + vbc_right->set_h_size_flags(SIZE_EXPAND_FILL); + + HBoxContainer *add_bind_hb = memnew( HBoxContainer ); type_list = memnew( OptionButton ); - type_list->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); - type_list->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - type_list->set_begin( Point2( 0.51,32) ); - type_list->set_end( Point2( 0.75,33 ) ); - add_child(type_list); + type_list->set_h_size_flags(SIZE_EXPAND_FILL); + add_bind_hb->add_child(type_list); type_list->add_item("bool",Variant::BOOL); @@ -356,65 +342,36 @@ ConnectDialog::ConnectDialog() { type_list->select(0); Button *add_bind = memnew( Button ); - add_bind->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); - add_bind->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - add_bind->set_begin( Point2( 0.76,32) ); - add_bind->set_end( Point2( 0.84,33 ) ); + add_bind->set_text(TTR("Add")); - add_child(add_bind); + add_bind_hb->add_child(add_bind); add_bind->connect("pressed",this,"_add_bind"); Button *del_bind = memnew( Button ); - del_bind->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - del_bind->set_anchor( MARGIN_LEFT, ANCHOR_RATIO ); - del_bind->set_begin( Point2( 0.85,32) ); - del_bind->set_end( Point2( 15,33 ) ); del_bind->set_text(TTR("Remove")); - add_child(del_bind); + add_bind_hb->add_child(del_bind); del_bind->connect("pressed",this,"_remove_bind"); + vbc_right->add_margin_child(TTR("Add Extra Call Argument:"),add_bind_hb); - label = memnew( Label ); - label->set_anchor( MARGIN_TOP, ANCHOR_END ); - label->set_begin( Point2( 8,124) ); - label->set_end( Point2( 15,99) ); - label->set_text(TTR("Path To Node:")); + bind_editor = memnew( PropertyEditor ); + bind_editor->hide_top_label(); - add_child(label); + vbc_right->add_margin_child(TTR("Extra Call Arguments:"),bind_editor,true); - dst_path = memnew(LineEdit); - dst_path->set_anchor( MARGIN_TOP, ANCHOR_END ); - dst_path->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - dst_path->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - dst_path->set_begin( Point2( 15,105) ); - dst_path->set_end( Point2( 15,80 ) ); - add_child(dst_path); - label = memnew( Label ); - label->set_anchor( MARGIN_TOP, ANCHOR_END ); - label->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - label->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - label->set_begin( Point2( 8,78 ) ); - label->set_end( Point2( 15,52 ) ); - label->set_text(TTR("Method In Node:")); - add_child(label); + dst_path = memnew(LineEdit); + vbc->add_margin_child(TTR("Path to Node:"),dst_path); HBoxContainer *dstm_hb = memnew( HBoxContainer ); - dstm_hb->set_anchor( MARGIN_TOP, ANCHOR_END ); - dstm_hb->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - dstm_hb->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); - dstm_hb->set_begin( Point2( 15,59) ); - dstm_hb->set_end( Point2( 15,39 ) ); - add_child(dstm_hb); + vbc->add_margin_child("Method In Node:",dstm_hb); dst_method = memnew(LineEdit); dst_method->set_h_size_flags(SIZE_EXPAND_FILL); dstm_hb->add_child(dst_method); - - /*dst_method_list = memnew( MenuButton ); dst_method_list->set_text("List.."); dst_method_list->set_anchor( MARGIN_RIGHT, ANCHOR_END ); @@ -567,6 +524,7 @@ void ConnectionsDock::_connect_pressed() { connect_dialog->edit(node); connect_dialog->popup_centered_ratio(); + connect_dialog->set_title(TTR("Connecting Signal:")+" "+signalname); connect_dialog->set_dst_method("_on_"+midname+"_"+signal); connect_dialog->set_dst_node(node->get_owner()?node->get_owner():node); diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index b6137ddac0..5275e1beeb 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -103,7 +103,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty item->set_selectable(0,false); } else { - if (!*to_select && (search_box->get_text()=="" || p_type.findn(search_box->get_text())!=-1)) { + if (!*to_select && (search_box->get_text().is_subsequence_ofi(p_type))) { *to_select=item; } @@ -172,7 +172,7 @@ void CreateDialog::_update_search() { bool found=false; String type=I->get(); while(type!="" && ObjectTypeDB::is_type(type,base_type) && type!=base_type) { - if (type.findn(search_box->get_text())!=-1) { + if (search_box->get_text().is_subsequence_ofi(type)) { found=true; break; @@ -194,7 +194,7 @@ void CreateDialog::_update_search() { const Vector<EditorData::CustomType> &ct = EditorNode::get_editor_data().get_custom_types()[type]; for(int i=0;i<ct.size();i++) { - bool show = search_box->get_text()=="" || ct[i].name.findn(search_box->get_text())!=-1; + bool show = search_box->get_text().is_subsequence_ofi(ct[i].name); if (!show) continue; diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index 185ec17459..e631aad7f6 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -443,7 +443,7 @@ void EditorFileDialog::update_file_list() { item_list->set_icon_mode(ItemList::ICON_MODE_TOP); item_list->set_fixed_column_width(thumbnail_size*3/2); item_list->set_max_text_lines(2); - item_list->set_min_icon_size(Size2(thumbnail_size,thumbnail_size)); + item_list->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size)); if (!has_icon("ResizedFolder","EditorIcons")) { Ref<ImageTexture> folder = get_icon("FolderBig","EditorIcons"); @@ -475,7 +475,7 @@ void EditorFileDialog::update_file_list() { item_list->set_max_columns(1); item_list->set_max_text_lines(1); item_list->set_fixed_column_width(0); - item_list->set_min_icon_size(Size2()); + item_list->set_fixed_icon_size(Size2()); if (preview->get_texture().is_valid()) preview_vb->show(); diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index ac9feacd46..0b60db5ee3 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -453,7 +453,7 @@ void EditorHelpIndex::_update_class_list() { String type = E->key(); while(type != "") { - if (type.findn(filter)!=-1) { + if (filter.is_subsequence_ofi(type)) { if (to_select.empty()) { to_select = type; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 26e40cf816..2e8bf0f311 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -217,7 +217,7 @@ void EditorNode::_notification(int p_what) { if (p_what==NOTIFICATION_EXIT_TREE) { editor_data.save_editor_external_data(); - + FileAccess::set_file_close_fail_notify_callback(NULL); log->deinit(); // do not get messages anymore } if (p_what==NOTIFICATION_PROCESS) { @@ -3089,6 +3089,7 @@ void EditorNode::set_addon_plugin_enabled(const String& p_addon,bool p_enabled) if (!p_enabled) { EditorPlugin *addon = plugin_addons[p_addon]; + editor_data.remove_editor_plugin( addon ); memdelete(addon); //bye plugin_addons.erase(p_addon); _update_addon_config(); @@ -5137,6 +5138,10 @@ void EditorNode::_dropped_files(const Vector<String>& p_files,int p_screen) { EditorImportExport::get_singleton()->get_import_plugin(i)->import_from_drop(p_files,cur_path); } } +void EditorNode::_file_access_close_error_notify(const String& p_str) { + + add_io_error("Unable to write to file '"+p_str+"', file in use, locked or lacking permissions."); +} void EditorNode::_bind_methods() { @@ -5232,7 +5237,6 @@ EditorNode::EditorNode() { SceneState::set_disable_placeholders(true); editor_initialize_certificates(); //for asset sharing - InputDefault *id = Input::get_singleton()->cast_to<InputDefault>(); if (id) { @@ -6274,7 +6278,7 @@ EditorNode::EditorNode() { logo->set_texture(gui_base->get_icon("Logo","EditorIcons") ); warning = memnew( AcceptDialog ); - add_child(warning); + gui_base->add_child(warning); @@ -6574,6 +6578,7 @@ EditorNode::EditorNode() { _load_docks(); + FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify); } @@ -6581,6 +6586,7 @@ EditorNode::EditorNode() { EditorNode::~EditorNode() { + memdelete( EditorHelp::get_doc_data() ); memdelete(editor_selection); memdelete(editor_plugins_over); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 65a5687dce..7023c6c174 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -574,6 +574,7 @@ private: void _update_addon_config(); + static void _file_access_close_error_notify(const String& p_str); protected: void _notification(int p_what); diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index bf01e02330..0d0008fcb8 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -86,6 +86,10 @@ bool EditorSettings::_set(const StringName& p_name, const Variant& p_value) { props[p_name].variant=p_value; else props[p_name]=VariantContainer(p_value,last_order++); + + if (save_changed_setting) { + props[p_name].save=true; + } } emit_signal("settings_changed"); @@ -126,6 +130,7 @@ struct _EVCSort { String name; Variant::Type type; int order; + bool save; bool operator<(const _EVCSort& p_vcs) const{ return order< p_vcs.order; } }; @@ -148,15 +153,24 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const { vc.name=*k; vc.order=v->order; vc.type=v->variant.get_type(); + vc.save=v->save; + vclist.insert(vc); } for(Set<_EVCSort>::Element *E=vclist.front();E;E=E->next()) { - int pinfo = PROPERTY_USAGE_STORAGE; - if (!E->get().name.begins_with("_")) + int pinfo = 0; + if (E->get().save) { + pinfo|=PROPERTY_USAGE_STORAGE; + } + + if (!E->get().name.begins_with("_") && !E->get().name.begins_with("projects/")) { pinfo|=PROPERTY_USAGE_EDITOR; + } else { + pinfo|=PROPERTY_USAGE_STORAGE; //hiddens must always be saved + } PropertyInfo pi(E->get().type, E->get().name); pi.usage=pinfo; @@ -330,6 +344,7 @@ void EditorSettings::create() { goto fail; } + singleton->save_changed_setting=true; singleton->config_file_path=config_file_path; singleton->project_config_path=pcp; singleton->settings_path=config_path+"/"+config_dir; @@ -363,6 +378,7 @@ void EditorSettings::create() { }; singleton = Ref<EditorSettings>( memnew( EditorSettings ) ); + singleton->save_changed_setting=true; singleton->config_file_path=config_file_path; singleton->settings_path=config_path+"/"+config_dir; singleton->_load_defaults(extra_config); @@ -975,6 +991,7 @@ EditorSettings::EditorSettings() { //singleton=this; last_order=0; + save_changed_setting=true; EditorTranslationList *etl=_editor_translations; @@ -999,6 +1016,7 @@ EditorSettings::EditorSettings() { } _load_defaults(); + save_changed_setting=false; } diff --git a/tools/editor/editor_settings.h b/tools/editor/editor_settings.h index 60333b5811..d975a7ef86 100644 --- a/tools/editor/editor_settings.h +++ b/tools/editor/editor_settings.h @@ -64,7 +64,8 @@ private: int order; Variant variant; bool hide_from_editor; - VariantContainer(){ order=0; hide_from_editor=false; } + bool save; + VariantContainer(){ order=0; hide_from_editor=false; save=false;} VariantContainer(const Variant& p_variant, int p_order) { variant=p_variant; order=p_order; hide_from_editor=false; } }; @@ -85,6 +86,9 @@ private: Ref<Resource> clipboard; + bool save_changed_setting; + + void _load_defaults(Ref<ConfigFile> p_extra_config = NULL); void _load_default_text_editor_theme(); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 8d00f2cd8a..48505324d3 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -2147,12 +2147,17 @@ void ScriptEditor::save_all_scripts() { continue; Ref<Script> script = ste->get_edited_script(); + if (script.is_valid()) + ste->apply_code(); + if (script->get_path()!="" && script->get_path().find("local://")==-1 &&script->get_path().find("::")==-1) { //external script, save it - ste->apply_code(); + editor->save_resource(script); //ResourceSaver::save(script->get_path(),script); + } + } } @@ -2273,6 +2278,8 @@ void ScriptEditor::_editor_settings_changed() { ste->get_text_edit()->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter")); } + ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true)); + } void ScriptEditor::_autosave_scripts() { @@ -2614,8 +2621,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { edit_menu->get_popup()->add_item(TTR("Auto Indent"),EDIT_AUTO_INDENT,KEY_MASK_CMD|KEY_I); edit_menu->get_popup()->connect("item_pressed", this,"_menu_option"); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item(TTR("Reload Tool Script"),FILE_TOOL_RELOAD,KEY_MASK_CMD|KEY_R); - edit_menu->get_popup()->add_item(TTR("Reload Tool Script (Soft)"),FILE_TOOL_RELOAD_SOFT,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R); + edit_menu->get_popup()->add_item(TTR("Soft Reload Script"),FILE_TOOL_RELOAD_SOFT,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_R); search_menu = memnew( MenuButton ); @@ -2919,6 +2925,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { script_editor->hide(); EDITOR_DEF("text_editor/auto_reload_scripts_on_external_change",true); + ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true)); EDITOR_DEF("text_editor/open_dominant_script_on_scene_change",true); EDITOR_DEF("external_editor/use_external_editor",false); EDITOR_DEF("external_editor/exec_path",""); @@ -2930,6 +2937,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE)); EDITOR_DEF("external_editor/exec_flags",""); + } diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index 4532e91e1f..4f59287994 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -825,7 +825,7 @@ SpriteFramesEditor::SpriteFramesEditor() { tree->set_icon_mode(ItemList::ICON_MODE_TOP); tree->set_fixed_column_width(thumbnail_size*3/2); tree->set_max_text_lines(2); - tree->set_max_icon_size(Size2(thumbnail_size,thumbnail_size)); + tree->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size)); //tree->set_min_icon_size(Size2(thumbnail_size,thumbnail_size)); tree->set_drag_forwarding(this); diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index 37cb0398e7..2673948365 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -583,6 +583,7 @@ ThemeEditor::ThemeEditor() { add_child(panel); panel->set_area_as_parent_rect(0); panel->set_margin(MARGIN_TOP,25); + panel->set_theme(Theme::get_default()); main_vb= memnew( VBoxContainer ); panel->add_child(main_vb); diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 6d5f2a519c..5a40777665 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -208,9 +208,14 @@ void TileMapEditor::_update_palette() { palette->set_max_columns(0); palette->add_constant_override("hseparation", 6); + + float min_size = EDITOR_DEF("tile_map/preview_size",64); + palette->set_fixed_icon_size(Size2(min_size, min_size)); + palette->set_fixed_column_width(min_size*3/2); palette->set_icon_mode(ItemList::ICON_MODE_TOP); palette->set_max_text_lines(2); + String filter = search_box->get_text().strip_edges(); for (List<int>::Element *E=tiles.front();E;E=E->next()) { @@ -1434,6 +1439,7 @@ void TileMapEditorPlugin::make_visible(bool p_visible) { TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) { + EDITOR_DEF("tile_map/preview_size",64); tile_map_editor = memnew( TileMapEditor(p_node) ); add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor); tile_map_editor->hide(); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 2f0ba2da99..763734f035 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -1963,6 +1963,13 @@ bool PropertyEditor::_is_property_different(const Variant& p_current, const Vari return false; } + if (p_current.get_type()==Variant::REAL && p_orig.get_type()==Variant::REAL) { + float a = p_current; + float b = p_orig; + + return Math::abs(a-b)>CMP_EPSILON; //this must be done because, as some scenes save as text, there might be a tiny difference in floats due to numerical error + } + return bool(Variant::evaluate(Variant::OP_NOT_EQUAL,p_current,p_orig)); } @@ -2232,6 +2239,7 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) { if (_get_instanced_node_original_property(p_name,vorig) || usage) { Variant v = obj->get(p_name); + bool changed = _is_property_different(v,vorig,usage); //if ((found!=-1 && !is_disabled)!=changed) { @@ -2804,7 +2812,7 @@ void PropertyEditor::update_tree() { if (capitalize_paths) cat = cat.capitalize(); - if (cat.findn(filter)==-1 && name.findn(filter)==-1) + if (!filter.is_subsequence_ofi(cat) && !filter.is_subsequence_ofi(name)) continue; } diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp index 72059c264f..fc2a2241ab 100644 --- a/tools/editor/quick_open.cpp +++ b/tools/editor/quick_open.cpp @@ -126,7 +126,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) { path+="/"; if (path!="res://") { path=path.substr(6,path.length()); - if (path.findn(search_box->get_text())!=-1) { + if (search_box->get_text().is_subsequence_ofi(path)) { TreeItem *ti = search_options->create_item(root); ti->set_text(0,path); Ref<Texture> icon = get_icon("folder","FileDialog"); @@ -138,7 +138,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd) { String file = efsd->get_file_path(i); file=file.substr(6,file.length()); - if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text()=="" || file.findn(search_box->get_text())!=-1)) { + if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_box->get_text().is_subsequence_ofi(file))) { TreeItem *ti = search_options->create_item(root); ti->set_text(0,file); diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 9612305a0f..5124505b90 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -201,6 +201,7 @@ static String _get_name_num_separator() { return " "; } + void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { current_option=p_tool; @@ -519,6 +520,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { EditorNode::get_singleton()->push_item(mne.ptr()); } break; + case TOOL_ERASE: { List<Node*> remove_list = editor_selection->get_selected_node_list(); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index f8ce121690..2de6fc5cf2 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -94,6 +94,29 @@ void SceneTreeEditor::_subscene_option(int p_idx) { case SCENE_MENU_CLEAR_INHERITANCE: { clear_inherit_confirm->popup_centered_minsize(); } break; + case SCENE_MENU_CLEAR_INSTANCING: { + + Node*root=EditorNode::get_singleton()->get_edited_scene(); + if (!root) + break; + + + ERR_FAIL_COND(node->get_filename()==String()); + + undo_redo->create_action("Discard Instancing"); + + undo_redo->add_do_method(node,"set_filename",""); + undo_redo->add_undo_method(node,"set_filename",node->get_filename()); + + _node_replace_owner(node,node,root); + + undo_redo->add_do_method(this,"update_tree"); + undo_redo->add_undo_method(this,"update_tree"); + + undo_redo->commit_action(); + + + } break; case SCENE_MENU_OPEN_INHERITED: { if (node && node->get_scene_inherited_state().is_valid()) { emit_signal("open",node->get_scene_inherited_state()->get_path()); @@ -108,11 +131,30 @@ void SceneTreeEditor::_subscene_option(int p_idx) { } break; + } } +void SceneTreeEditor::_node_replace_owner(Node* p_base,Node* p_node,Node* p_root) { + + if (p_base!=p_node) { + + if (p_node->get_owner()==p_base) { + + undo_redo->add_do_method(p_node,"set_owner",p_root); + undo_redo->add_undo_method(p_node,"set_owner",p_base); + } + } + + for(int i=0;i<p_node->get_child_count();i++) { + + _node_replace_owner(p_base,p_node->get_child(i),p_root); + } +} + + void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id) { TreeItem *item=p_item->cast_to<TreeItem>(); @@ -386,7 +428,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { item->set_as_cursor(0); } - bool keep= ( filter==String() || String(p_node->get_name()).to_lower().find(filter.to_lower())!=-1 ); + bool keep= (filter.is_subsequence_ofi(String(p_node->get_name()))); for (int i=0;i<p_node->get_child_count();i++) { @@ -606,7 +648,7 @@ void SceneTreeEditor::_notification(int p_what) { get_tree()->connect("node_removed",this,"_node_removed"); get_tree()->connect("node_configuration_warning_changed",this,"_warning_changed"); - instance_menu->set_item_icon(3,get_icon("Load","EditorIcons")); + instance_menu->set_item_icon(5,get_icon("Load","EditorIcons")); tree->connect("item_collapsed",this,"_cell_collapsed"); inheritance_menu->set_item_icon(2,get_icon("Load","EditorIcons")); clear_inherit_confirm->connect("confirmed",this,"_subscene_option",varray(SCENE_MENU_CLEAR_INHERITANCE_CONFIRM)); @@ -1109,6 +1151,8 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open instance_menu->add_check_item(TTR("Editable Children"),SCENE_MENU_EDITABLE_CHILDREN); instance_menu->add_check_item(TTR("Load As Placeholder"),SCENE_MENU_USE_PLACEHOLDER); instance_menu->add_separator(); + instance_menu->add_item(TTR("Discard Instancing"),SCENE_MENU_CLEAR_INSTANCING); + instance_menu->add_separator(); instance_menu->add_item(TTR("Open in Editor"),SCENE_MENU_OPEN); instance_menu->connect("item_pressed",this,"_subscene_option"); add_child(instance_menu); diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h index ae0afa32ec..e184891200 100644 --- a/tools/editor/scene_tree_editor.h +++ b/tools/editor/scene_tree_editor.h @@ -61,6 +61,7 @@ class SceneTreeEditor : public Control { SCENE_MENU_CLEAR_INHERITANCE, SCENE_MENU_OPEN_INHERITED, SCENE_MENU_CLEAR_INHERITANCE_CONFIRM, + SCENE_MENU_CLEAR_INSTANCING, }; Tree *tree; @@ -117,6 +118,7 @@ class SceneTreeEditor : public Control { void _node_visibility_changed(Node *p_node); void _subscene_option(int p_idx); + void _node_replace_owner(Node* p_base,Node* p_node,Node* p_root); void _selection_changed(); diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp index 7953cf2739..44832c84eb 100644 --- a/tools/editor/scenes_dock.cpp +++ b/tools/editor/scenes_dock.cpp @@ -454,8 +454,7 @@ void ScenesDock::_update_files(bool p_keep_selection) { files->set_icon_mode(ItemList::ICON_MODE_TOP); files->set_fixed_column_width(thumbnail_size*3/2); files->set_max_text_lines(2); - files->set_min_icon_size(Size2(thumbnail_size,thumbnail_size)); - files->set_max_icon_size(Size2(thumbnail_size,thumbnail_size)); + files->set_fixed_icon_size(Size2(thumbnail_size,thumbnail_size)); if (!has_icon("ResizedFolder","EditorIcons")) { Ref<ImageTexture> folder = get_icon("FolderBig","EditorIcons"); @@ -485,7 +484,7 @@ void ScenesDock::_update_files(bool p_keep_selection) { files->set_max_columns(1); files->set_max_text_lines(1); files->set_fixed_column_width(0); - files->set_min_icon_size(Size2()); + files->set_fixed_icon_size(Size2()); } diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 37a90ba7be..6d8f54d88f 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -1731,15 +1731,17 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){ docontinue->set_tooltip(TTR("Continue")); docontinue->connect("pressed",this,"debug_continue"); - hbc->add_child( memnew( VSeparator) ); + //hbc->add_child( memnew( VSeparator) ); back = memnew( Button ); hbc->add_child(back); back->set_tooltip(TTR("Inspect Previous Instance")); + back->hide(); forward = memnew( Button ); hbc->add_child(forward); forward->set_tooltip(TTR("Inspect Next Instance")); + forward->hide(); HSplitContainer *sc = memnew( HSplitContainer ); |