diff options
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/connections_dialog.cpp | 98 | ||||
-rw-r--r-- | tools/editor/dependency_editor.cpp | 5 | ||||
-rw-r--r-- | tools/editor/editor_file_dialog.cpp | 4 | ||||
-rw-r--r-- | tools/editor/editor_help.cpp | 1 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 20 | ||||
-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 | 15 | ||||
-rw-r--r-- | tools/editor/plugins/shader_editor_plugin.cpp | 3 | ||||
-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/project_manager.cpp | 12 | ||||
-rw-r--r-- | tools/editor/property_editor.cpp | 8 | ||||
-rw-r--r-- | tools/editor/scene_tree_dock.cpp | 2 | ||||
-rw-r--r-- | tools/editor/scene_tree_editor.cpp | 46 | ||||
-rw-r--r-- | tools/editor/scene_tree_editor.h | 2 | ||||
-rw-r--r-- | tools/editor/scenes_dock.cpp | 6 | ||||
-rw-r--r-- | tools/editor/script_editor_debugger.cpp | 4 |
20 files changed, 171 insertions, 93 deletions
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/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index a702d3c687..6ad7704815 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -399,6 +399,7 @@ void DependencyRemoveDialog::show(const Vector<String> &to_erase) { _fill_owners(EditorFileSystem::get_singleton()->get_filesystem()); + if (exist) { owners->show(); text->set_text(TTR("The files being removed are required by other resources in order for them to work.\nRemove them anyway? (no undo)")); @@ -417,6 +418,10 @@ void DependencyRemoveDialog::ok_pressed() { DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); for (Map<String,TreeItem*>::Element *E=files.front();E;E=E->next()) { + if (ResourceCache::has(E->key())) { + Resource *res = ResourceCache::get(E->key()); + res->set_path(""); //clear reference to path + } da->remove(E->key()); EditorFileSystem::get_singleton()->update_file(E->key()); } 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 2d0a8a80b0..ac9feacd46 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -649,6 +649,7 @@ void EditorHelp::_class_desc_input(const InputEvent& p_input) { class_desc->set_selection_enabled(false); class_desc->set_selection_enabled(true); } + set_focused(); } void EditorHelp::_add_type(const String& p_type) { diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index d63a010272..2e8bf0f311 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -56,7 +56,7 @@ #include "io/zip_io.h" #include "io/config_file.h" #include "animation_editor.h" - +#include "io/stream_peer_ssl.h" // plugins #include "plugins/sprite_frames_editor_plugin.h" #include "plugins/texture_region_editor_plugin.h" @@ -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); @@ -6381,8 +6385,12 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( CanvasItemEditorPlugin(this) ) ); add_editor_plugin( memnew( SpatialEditorPlugin(this) ) ); add_editor_plugin( memnew( ScriptEditorPlugin(this) ) ); - add_editor_plugin( memnew( AssetLibraryEditorPlugin(this) ) ); + if (StreamPeerSSL::is_available()) { + add_editor_plugin( memnew( AssetLibraryEditorPlugin(this) ) ); + } else { + WARN_PRINT("Asset Library not available, as it requires SSL to work."); + } //more visually meaningful to have this later raise_bottom_panel_item(AnimationPlayerEditor::singleton); @@ -6570,6 +6578,7 @@ EditorNode::EditorNode() { _load_docks(); + FileAccess::set_file_close_fail_notify_callback(_file_access_close_error_notify); } @@ -6577,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 d2d1f9e625..48505324d3 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -302,6 +302,7 @@ void ScriptTextEditor::_load_theme_settings() { get_text_edit()->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/breakpoint_color", Color(0.8,0.8,0.4,0.2))); get_text_edit()->add_color_override("search_result_color",EDITOR_DEF("text_editor/search_result_color",Color(0.05,0.25,0.05,1))); get_text_edit()->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/search_result_border_color",Color(0.1,0.45,0.1,1))); + get_text_edit()->add_constant_override("line_spacing", EDITOR_DEF("text_editor/line_spacing",4)); Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2)); @@ -2146,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); + } + } } @@ -2272,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() { @@ -2613,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 ); @@ -2918,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",""); @@ -2929,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/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 0ca6a069bc..61dde9a9ef 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -375,6 +375,7 @@ void ShaderEditor::_editor_settings_changed() { vertex_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences")); 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")); 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")); @@ -385,6 +386,7 @@ void ShaderEditor::_editor_settings_changed() { fragment_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences")); 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")); 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")); @@ -395,6 +397,7 @@ void ShaderEditor::_editor_settings_changed() { light_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences")); 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")); } void ShaderEditor::_bind_methods() { 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/project_manager.cpp b/tools/editor/project_manager.cpp index c00bd0ab37..419f05f2cf 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -39,7 +39,7 @@ #include "scene/gui/line_edit.h" #include "scene/gui/panel_container.h" #include "scene/gui/center_container.h" - +#include "io/stream_peer_ssl.h" #include "scene/gui/texture_frame.h" #include "scene/gui/margin_container.h" @@ -986,10 +986,14 @@ ProjectManager::ProjectManager() { tree_vb->add_spacer(); + if (StreamPeerSSL::is_available()) { - asset_library = memnew( EditorAssetLibrary(true) ); - asset_library->set_name("Templates"); - tabs->add_child(asset_library); + asset_library = memnew( EditorAssetLibrary(true) ); + asset_library->set_name("Templates"); + tabs->add_child(asset_library); + } else { + WARN_PRINT("Asset Library not available, as it requires SSL to work."); + } CenterContainer *cc = memnew( CenterContainer ); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 2f0ba2da99..7dfcf88e2c 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) { 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..65e731dd4d 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>(); @@ -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 7c61e3d4a1..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()); } @@ -1052,6 +1051,7 @@ void ScenesDock::_file_option(int p_option) { if (path.ends_with("/") || !files->is_selected(i)) continue; torem.push_back(path); + } if (torem.empty()) { 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 ); |