diff options
Diffstat (limited to 'editor')
56 files changed, 538 insertions, 352 deletions
diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp index 45da365695..3675948b1d 100644 --- a/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -1091,11 +1091,11 @@ void AnimationKeyEditor::_track_editor_draw() { int sep = get_constant("vseparation", "Tree"); int hsep = get_constant("hseparation", "Tree"); Color color = get_color("font_color", "Tree"); - Color sepcolor = get_color("light_color_1", "Editor"); - Color timecolor = get_color("dark_color_2", "Editor"); + Color sepcolor = Color(1, 1, 1, 0.2); + Color timecolor = Color(1, 1, 1, 0.2); Color hover_color = Color(1, 1, 1, 0.05); Color select_color = Color(1, 1, 1, 0.1); - Color invalid_path_color = Color(1, 0.6, 0.4, 0.5); + Color invalid_path_color = get_color("error_color", "Editor"); Color track_select_color = get_color("highlight_color", "Editor"); Ref<Texture> remove_icon = get_icon("Remove", "EditorIcons"); @@ -1156,11 +1156,12 @@ void AnimationKeyEditor::_track_editor_draw() { int settings_limit = size.width - right_separator_ofs; int name_limit = settings_limit * name_column_ratio; - te->draw_line(ofs + Point2(name_limit, 0), ofs + Point2(name_limit, size.height), color); - te->draw_line(ofs + Point2(settings_limit, 0), ofs + Point2(settings_limit, size.height), color); + Color linecolor = Color(1, 1, 1, 0.2); + te->draw_line(ofs + Point2(name_limit, 0), ofs + Point2(name_limit, size.height), linecolor); + te->draw_line(ofs + Point2(settings_limit, 0), ofs + Point2(settings_limit, size.height), linecolor); te->draw_texture(hsize_icon, ofs + Point2(name_limit - hsize_icon->get_width() - hsep, (h - hsize_icon->get_height()) / 2)); - te->draw_line(ofs + Point2(0, h), ofs + Point2(size.width, h), color); + te->draw_line(ofs + Point2(0, h), ofs + Point2(size.width, h), linecolor); // draw time float keys_from; @@ -1180,7 +1181,7 @@ void AnimationKeyEditor::_track_editor_draw() { int end_px = (l - h_scroll->get_value()) * scale; int begin_px = -h_scroll->get_value() * scale; - Color notimecol = get_color("light_color_1", "Editor"); + Color notimecol = get_color("dark_color_2", "Editor"); { @@ -1276,7 +1277,7 @@ void AnimationKeyEditor::_track_editor_draw() { if ((sc / step) != (prev_sc / step) || (prev_sc < 0 && sc >= 0)) { int scd = sc < 0 ? prev_sc : sc; - te->draw_line(ofs + Point2(name_limit + i, 0), ofs + Point2(name_limit + i, h), color); + te->draw_line(ofs + Point2(name_limit + i, 0), ofs + Point2(name_limit + i, h), linecolor); te->draw_string(font, ofs + Point2(name_limit + i + 3, (h - font->get_height()) / 2 + font->get_ascent()).floor(), String::num((scd - (scd % step)) / double(SC_ADJ), decimals), sub ? color_time_dec : color_time_sec, zoomw - i); } } @@ -1335,7 +1336,7 @@ void AnimationKeyEditor::_track_editor_draw() { te->draw_line(ofs + Point2(0, y + h), ofs + Point2(size.width, y + h), sepcolor); Point2 icon_ofs = ofs + Point2(size.width, y + (h - remove_icon->get_height()) / 2).floor(); - icon_ofs.y += 4; + icon_ofs.y += 4 * EDSCALE; /* icon_ofs.x-=remove_icon->get_width(); @@ -1353,7 +1354,7 @@ void AnimationKeyEditor::_track_editor_draw() { */ track_ofs[0] = size.width - icon_ofs.x; icon_ofs.x -= down_icon->get_width(); - te->draw_texture(down_icon, icon_ofs); + te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE)); int wrap_type = animation->track_get_interpolation_loop_wrap(idx) ? 1 : 0; icon_ofs.x -= hsep; @@ -1366,7 +1367,7 @@ void AnimationKeyEditor::_track_editor_draw() { track_ofs[1] = size.width - icon_ofs.x; icon_ofs.x -= down_icon->get_width(); - te->draw_texture(down_icon, icon_ofs); + te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE)); int interp_type = animation->track_get_interpolation_type(idx); ERR_CONTINUE(interp_type < 0 || interp_type >= 3); @@ -1385,7 +1386,7 @@ void AnimationKeyEditor::_track_editor_draw() { icon_ofs.x -= hsep; icon_ofs.x -= down_icon->get_width(); - te->draw_texture(down_icon, icon_ofs); + te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE)); icon_ofs.x -= hsep; icon_ofs.x -= cont_icon[umode]->get_width(); @@ -3745,7 +3746,7 @@ AnimationKeyEditor::AnimationKeyEditor() { history = EditorNode::get_singleton()->get_editor_history(); ec = memnew(Control); - ec->set_custom_minimum_size(Size2(0, 150)); + ec->set_custom_minimum_size(Size2(0, 150) * EDSCALE); add_child(ec); ec->set_v_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp index 81d5309712..06d7d5fdc8 100644 --- a/editor/array_property_edit.cpp +++ b/editor/array_property_edit.cpp @@ -251,7 +251,7 @@ void ArrayPropertyEdit::edit(Object *p_obj, const StringName &p_prop, const Stri page = 0; property = p_prop; - obj = p_obj->get_instance_ID(); + obj = p_obj->get_instance_id(); default_type = p_deftype; if (!p_hint_string.empty()) { diff --git a/editor/asset_library_editor_plugin.cpp b/editor/asset_library_editor_plugin.cpp index f92b70d0c0..2a22cde2fb 100644 --- a/editor/asset_library_editor_plugin.cpp +++ b/editor/asset_library_editor_plugin.cpp @@ -1136,7 +1136,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const item->connect("category_selected", this, "_select_category"); if (r.has("icon_url") && r["icon_url"] != "") { - _request_image(item->get_instance_ID(), r["icon_url"], IMAGE_QUEUE_ICON, 0); + _request_image(item->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0); } } } break; @@ -1173,7 +1173,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const item->connect("category_selected",this,"_category_selected");*/ if (r.has("icon_url") && r["icon_url"] != "") { - _request_image(description->get_instance_ID(), r["icon_url"], IMAGE_QUEUE_ICON, 0); + _request_image(description->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0); } if (d.has("previews")) { @@ -1195,12 +1195,12 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const description->add_preview(i, is_video, video_url); if (p.has("thumbnail")) { - _request_image(description->get_instance_ID(), p["thumbnail"], IMAGE_QUEUE_THUMBNAIL, i); + _request_image(description->get_instance_id(), p["thumbnail"], IMAGE_QUEUE_THUMBNAIL, i); } if (is_video) { - //_request_image(description->get_instance_ID(),p["link"],IMAGE_QUEUE_SCREENSHOT,i); + //_request_image(description->get_instance_id(),p["link"],IMAGE_QUEUE_SCREENSHOT,i); } else { - _request_image(description->get_instance_ID(), p["link"], IMAGE_QUEUE_SCREENSHOT, i); + _request_image(description->get_instance_id(), p["link"], IMAGE_QUEUE_SCREENSHOT, i); } } } diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp index ab1e397ccc..169c34782d 100644 --- a/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -2220,6 +2220,7 @@ void Collada::_merge_skeletons(VisualScene *p_vscene, Node *p_node) { ERR_CONTINUE(!state.scene_map.has(nodeid)); //weird, it should have it... NodeJoint *nj = SAFE_CAST<NodeJoint *>(state.scene_map[nodeid]); + ERR_CONTINUE(!nj); //broken collada if (!nj->owner) { print_line("no owner for: " + String(nodeid)); } diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 9762bd2000..47c2cb5536 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -220,7 +220,7 @@ void ConnectDialog::_add_bind() { if (cdbinds->params.size() >= VARIANT_ARG_MAX) return; - Variant::Type vt = (Variant::Type)type_list->get_item_ID(type_list->get_selected()); + Variant::Type vt = (Variant::Type)type_list->get_item_id(type_list->get_selected()); Variant value; diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 08b093aecb..219f05ef95 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1061,20 +1061,19 @@ EditorAudioBuses::EditorAudioBuses() { top_hb = memnew(HBoxContainer); add_child(top_hb); + file = memnew(ToolButton); + file->set_text("default_bus_layout.tres"); + top_hb->add_child(file); + file->connect("pressed", this, "_select_layout"); + add = memnew(Button); top_hb->add_child(add); - ; add->set_text(TTR("Add Bus")); add->connect("pressed", this, "_add_bus"); top_hb->add_spacer(); - file = memnew(ToolButton); - file->set_text("default_bus_layout.tres"); - top_hb->add_child(file); - file->connect("pressed", this, "_select_layout"); - load = memnew(Button); load->set_text(TTR("Load")); top_hb->add_child(load); @@ -1096,6 +1095,7 @@ EditorAudioBuses::EditorAudioBuses() { _new->connect("pressed", this, "_new_layout"); bus_scroll = memnew(ScrollContainer); + bus_scroll->add_style_override("panel", memnew(StyleBoxEmpty)); bus_scroll->set_v_size_flags(SIZE_EXPAND_FILL); bus_scroll->set_enable_h_scroll(true); bus_scroll->set_enable_v_scroll(false); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index c82e8f1226..e788fe2c13 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -183,7 +183,7 @@ ObjectID EditorHistory::get_current() { if (!obj) return 0; - return obj->get_instance_ID(); + return obj->get_instance_id(); } int EditorHistory::get_path_size() const { @@ -208,7 +208,7 @@ ObjectID EditorHistory::get_path_object(int p_index) const { if (!obj) return 0; - return obj->get_instance_ID(); + return obj->get_instance_id(); } String EditorHistory::get_path_property(int p_index) const { @@ -867,8 +867,8 @@ void EditorSelection::_bind_methods() { ClassDB::bind_method(D_METHOD("_node_removed"), &EditorSelection::_node_removed); ClassDB::bind_method(D_METHOD("clear"), &EditorSelection::clear); - ClassDB::bind_method(D_METHOD("add_node", "node:Node"), &EditorSelection::add_node); - ClassDB::bind_method(D_METHOD("remove_node", "node:Node"), &EditorSelection::remove_node); + ClassDB::bind_method(D_METHOD("add_node", "node"), &EditorSelection::add_node); + ClassDB::bind_method(D_METHOD("remove_node", "node"), &EditorSelection::remove_node); ClassDB::bind_method(D_METHOD("get_selected_nodes"), &EditorSelection::_get_selected_nodes); ClassDB::bind_method(D_METHOD("get_transformable_selected_nodes"), &EditorSelection::_get_transformable_selected_nodes); ADD_SIGNAL(MethodInfo("selection_changed")); diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 6bf92ddd2d..36fd86d88f 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -3218,24 +3218,24 @@ PoolVector<String> EditorImportExport::_get_export_platforms() { void EditorImportExport::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::add_import_plugin); - ClassDB::bind_method(D_METHOD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::remove_import_plugin); + ClassDB::bind_method(D_METHOD("add_import_plugin","plugin"),&EditorImportExport::add_import_plugin); + ClassDB::bind_method(D_METHOD("remove_import_plugin","plugin"),&EditorImportExport::remove_import_plugin); ClassDB::bind_method(D_METHOD("get_import_plugin_count"),&EditorImportExport::get_import_plugin_count); - ClassDB::bind_method(D_METHOD("get_import_plugin:EditorImportPlugin","idx"),&EditorImportExport::get_import_plugin); - ClassDB::bind_method(D_METHOD("get_import_plugin_by_name:EditorImportPlugin","name"),&EditorImportExport::get_import_plugin_by_name); + ClassDB::bind_method(D_METHOD("get_import_plugin","idx"),&EditorImportExport::get_import_plugin); + ClassDB::bind_method(D_METHOD("get_import_plugin_by_name","name"),&EditorImportExport::get_import_plugin_by_name); - ClassDB::bind_method(D_METHOD("add_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::add_export_plugin); - ClassDB::bind_method(D_METHOD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::remove_export_plugin); + ClassDB::bind_method(D_METHOD("add_export_plugin","plugin"),&EditorImportExport::add_export_plugin); + ClassDB::bind_method(D_METHOD("remove_export_plugin","plugin"),&EditorImportExport::remove_export_plugin); ClassDB::bind_method(D_METHOD("get_export_plugin_count"),&EditorImportExport::get_export_plugin_count); - ClassDB::bind_method(D_METHOD("get_export_plugin:EditorExportPlugin","idx"),&EditorImportExport::get_export_plugin); + ClassDB::bind_method(D_METHOD("get_export_plugin","idx"),&EditorImportExport::get_export_plugin); ClassDB::bind_method(D_METHOD("set_export_file_action","file","action"),&EditorImportExport::set_export_file_action); ClassDB::bind_method(D_METHOD("get_export_file_action","file"),&EditorImportExport::get_export_file_action); ClassDB::bind_method(D_METHOD("get_export_file_list"),&EditorImportExport::_get_export_file_list); - ClassDB::bind_method(D_METHOD("add_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); - //ClassDB::bind_method(D_METHOD("remove_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); - ClassDB::bind_method(D_METHOD("get_export_platform:EditorExportPlatform","name"),&EditorImportExport::get_export_platform); + ClassDB::bind_method(D_METHOD("add_export_platform","platform"),&EditorImportExport::add_export_platform); + //ClassDB::bind_method(D_METHOD("remove_export_platform","platform"),&EditorImportExport::add_export_platform); + ClassDB::bind_method(D_METHOD("get_export_platform","name"),&EditorImportExport::get_export_platform); ClassDB::bind_method(D_METHOD("get_export_platforms"),&EditorImportExport::_get_export_platforms); ClassDB::bind_method(D_METHOD("set_export_filter","filter"),&EditorImportExport::set_export_filter); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index c2a408e8ab..d572ee8724 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1154,7 +1154,7 @@ void EditorFileDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("set_current_path", "path"), &EditorFileDialog::set_current_path); ClassDB::bind_method(D_METHOD("set_mode", "mode"), &EditorFileDialog::set_mode); ClassDB::bind_method(D_METHOD("get_mode"), &EditorFileDialog::get_mode); - ClassDB::bind_method(D_METHOD("get_vbox:VBoxContainer"), &EditorFileDialog::get_vbox); + ClassDB::bind_method(D_METHOD("get_vbox"), &EditorFileDialog::get_vbox); ClassDB::bind_method(D_METHOD("set_access", "access"), &EditorFileDialog::set_access); ClassDB::bind_method(D_METHOD("get_access"), &EditorFileDialog::get_access); ClassDB::bind_method(D_METHOD("set_show_hidden_files", "show"), &EditorFileDialog::set_show_hidden_files); @@ -1454,9 +1454,9 @@ void EditorLineEditFileChooser::_bind_methods() { ClassDB::bind_method(D_METHOD("_browse"), &EditorLineEditFileChooser::_browse); ClassDB::bind_method(D_METHOD("_chosen"), &EditorLineEditFileChooser::_chosen); - ClassDB::bind_method(D_METHOD("get_button:Button"), &EditorLineEditFileChooser::get_button); - ClassDB::bind_method(D_METHOD("get_line_edit:LineEdit"), &EditorLineEditFileChooser::get_line_edit); - ClassDB::bind_method(D_METHOD("get_file_dialog:EditorFileDialog"), &EditorLineEditFileChooser::get_file_dialog); + ClassDB::bind_method(D_METHOD("get_button"), &EditorLineEditFileChooser::get_button); + ClassDB::bind_method(D_METHOD("get_line_edit"), &EditorLineEditFileChooser::get_line_edit); + ClassDB::bind_method(D_METHOD("get_file_dialog"), &EditorLineEditFileChooser::get_file_dialog); } void EditorLineEditFileChooser::_chosen(const String &p_text) { diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index ed58116304..eeb2f5ae8a 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -137,14 +137,14 @@ EditorFileSystemDirectory *EditorFileSystemDirectory::get_parent() { void EditorFileSystemDirectory::_bind_methods() { ClassDB::bind_method(D_METHOD("get_subdir_count"), &EditorFileSystemDirectory::get_subdir_count); - ClassDB::bind_method(D_METHOD("get_subdir:EditorFileSystemDirectory", "idx"), &EditorFileSystemDirectory::get_subdir); + ClassDB::bind_method(D_METHOD("get_subdir", "idx"), &EditorFileSystemDirectory::get_subdir); ClassDB::bind_method(D_METHOD("get_file_count"), &EditorFileSystemDirectory::get_file_count); ClassDB::bind_method(D_METHOD("get_file", "idx"), &EditorFileSystemDirectory::get_file); ClassDB::bind_method(D_METHOD("get_file_path", "idx"), &EditorFileSystemDirectory::get_file_path); ClassDB::bind_method(D_METHOD("get_file_type", "idx"), &EditorFileSystemDirectory::get_file_type); ClassDB::bind_method(D_METHOD("get_name"), &EditorFileSystemDirectory::get_name); ClassDB::bind_method(D_METHOD("get_path"), &EditorFileSystemDirectory::get_path); - ClassDB::bind_method(D_METHOD("get_parent:EditorFileSystemDirectory"), &EditorFileSystemDirectory::get_parent); + ClassDB::bind_method(D_METHOD("get_parent"), &EditorFileSystemDirectory::get_parent); ClassDB::bind_method(D_METHOD("find_file_index", "name"), &EditorFileSystemDirectory::find_file_index); ClassDB::bind_method(D_METHOD("find_dir_index", "name"), &EditorFileSystemDirectory::find_dir_index); } @@ -512,6 +512,8 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess if (FileAccess::exists(cd.plus_file(f).plus_file("project.godot"))) // skip if another project inside this continue; + if (FileAccess::exists(cd.plus_file(f).plus_file(".gdignore"))) // skip if another project inside this + continue; dirs.push_back(f); @@ -691,6 +693,8 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const if (FileAccess::exists(cd.plus_file(f).plus_file("project.godot"))) // skip if another project inside this continue; + if (FileAccess::exists(cd.plus_file(f).plus_file(".gdignore"))) // skip if another project inside this + continue; EditorFileSystemDirectory *efd = memnew(EditorFileSystemDirectory); @@ -1399,13 +1403,13 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) { void EditorFileSystem::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_filesystem:EditorFileSystemDirectory"), &EditorFileSystem::get_filesystem); + ClassDB::bind_method(D_METHOD("get_filesystem"), &EditorFileSystem::get_filesystem); ClassDB::bind_method(D_METHOD("is_scanning"), &EditorFileSystem::is_scanning); ClassDB::bind_method(D_METHOD("get_scanning_progress"), &EditorFileSystem::get_scanning_progress); ClassDB::bind_method(D_METHOD("scan"), &EditorFileSystem::scan); ClassDB::bind_method(D_METHOD("scan_sources"), &EditorFileSystem::scan_changes); ClassDB::bind_method(D_METHOD("update_file", "path"), &EditorFileSystem::update_file); - ClassDB::bind_method(D_METHOD("get_filesystem_path:EditorFileSystemDirectory", "path"), &EditorFileSystem::get_filesystem_path); + ClassDB::bind_method(D_METHOD("get_filesystem_path", "path"), &EditorFileSystem::get_filesystem_path); ClassDB::bind_method(D_METHOD("get_file_type", "path"), &EditorFileSystem::get_file_type); ADD_SIGNAL(MethodInfo("filesystem_changed")); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index e890082ee1..f80c4ee0e2 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1621,12 +1621,18 @@ void EditorHelp::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - //forward->set_icon(get_icon("Forward","EditorIcons")); //back->set_icon(get_icon("Back","EditorIcons")); _update_doc(); + } break; + case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { + Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); + style->set_bg_color(EditorSettings::get_singleton()->get("text_editor/highlighting/background_color")); + background_panel->add_style_override("panel", style); } break; + + default: break; } } @@ -1695,14 +1701,14 @@ EditorHelp::EditorHelp() { //class_list->set_selection_enabled(true); { - Panel *pc = memnew(Panel); + background_panel = memnew(Panel); Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); style->set_bg_color(EditorSettings::get_singleton()->get("text_editor/highlighting/background_color")); - pc->set_v_size_flags(SIZE_EXPAND_FILL); - pc->add_style_override("panel", style); //get_stylebox("normal","TextEdit")); - vbc->add_child(pc); + background_panel->set_v_size_flags(SIZE_EXPAND_FILL); + background_panel->add_style_override("panel", style); //get_stylebox("normal","TextEdit")); + vbc->add_child(background_panel); class_desc = memnew(RichTextLabel); - pc->add_child(class_desc); + background_panel->add_child(class_desc); class_desc->set_area_as_parent_rect(8); class_desc->connect("meta_clicked", this, "_class_desc_select"); class_desc->connect("gui_input", this, "_class_desc_input"); diff --git a/editor/editor_help.h b/editor/editor_help.h index 46d83490f4..de30b543fc 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -129,6 +129,7 @@ class EditorHelp : public VBoxContainer { HSplitContainer *h_split; static DocData *doc; + Panel *background_panel; ConfirmationDialog *search_dialog; LineEdit *search; diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 5d13c7c254..c5e15b97b0 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -36,7 +36,7 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type) { EditorLog *self = (EditorLog *)p_self; - if (self->current != Thread::get_caller_ID()) + if (self->current != Thread::get_caller_id()) return; String err_str; @@ -52,31 +52,6 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f */ err_str = " " + err_str; - self->log->add_newline(); - - Ref<Texture> icon; - - switch (p_type) { - case ERR_HANDLER_ERROR: { - - icon = self->get_icon("Error", "EditorIcons"); - return; // these are confusing - } break; - case ERR_HANDLER_WARNING: { - - icon = self->get_icon("Error", "EditorIcons"); - - } break; - case ERR_HANDLER_SCRIPT: { - - icon = self->get_icon("ScriptError", "EditorIcons"); - } break; - case ERR_HANDLER_SHADER: { - - icon = self->get_icon("Shader", "EditorIcons"); - } break; - } - self->add_message(err_str, true); } @@ -114,16 +89,16 @@ void EditorLog::clear() { void EditorLog::add_message(const String &p_msg, bool p_error) { + log->add_newline(); if (p_error) { + log->push_color(get_color("fg_error", "Editor")); Ref<Texture> icon = get_icon("Error", "EditorIcons"); log->add_image(icon); //button->set_icon(icon); - log->push_color(get_color("fg_error", "Editor")); } else { //button->set_icon(Ref<Texture>()); } - log->add_newline(); log->add_text(p_msg); //button->set_text(p_msg); @@ -168,15 +143,10 @@ EditorLog::EditorLog() { HBoxContainer *hb = memnew(HBoxContainer); vb->add_child(hb); title = memnew(Label); - title->set_text(TTR(" Output:")); + title->set_text(TTR("Output:")); title->set_h_size_flags(SIZE_EXPAND_FILL); hb->add_child(title); - //pd = memnew( PaneDrag ); - //hb->add_child(pd); - //pd->connect("dragged",this,"_dragged"); - //pd->set_default_cursor_shape(Control::CURSOR_MOVE); - clearbutton = memnew(Button); hb->add_child(clearbutton); clearbutton->set_text(TTR("Clear")); @@ -184,7 +154,7 @@ EditorLog::EditorLog() { ec = memnew(Control); vb->add_child(ec); - ec->set_custom_minimum_size(Size2(0, 180)); + ec->set_custom_minimum_size(Size2(0, 180) * EDSCALE); ec->set_v_size_flags(SIZE_EXPAND_FILL); pc = memnew(PanelContainer); @@ -204,7 +174,7 @@ EditorLog::EditorLog() { eh.userdata = this; add_error_handler(&eh); - current = Thread::get_caller_ID(); + current = Thread::get_caller_id(); EditorNode::get_undo_redo()->set_commit_notify_callback(_undo_redo_cbk, this); } diff --git a/editor/editor_name_dialog.cpp b/editor/editor_name_dialog.cpp index 7435e9a9f7..6ebfcbf313 100644 --- a/editor/editor_name_dialog.cpp +++ b/editor/editor_name_dialog.cpp @@ -42,8 +42,8 @@ void EditorNameDialog::_line_gui_input(const Ref<InputEvent> &p_event) { return; switch (k->get_scancode()) { - case KEY_ENTER: - case KEY_RETURN: { + case KEY_KP_ENTER: + case KEY_ENTER: { if (get_hide_on_ok()) hide(); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 4d5dd14172..730ba3cacc 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1358,7 +1358,7 @@ void EditorNode::push_item(Object *p_object, const String &p_property) { return; } - uint32_t id = p_object->get_instance_ID(); + uint32_t id = p_object->get_instance_id(); if (id != editor_history.get_current()) { if (p_property == "") diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index 8ce4f88590..fdac68ea1f 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -63,7 +63,7 @@ void EditorPath::_add_children_to_popup(Object *p_obj, int p_depth) { int index = popup->get_item_count(); popup->add_icon_item(icon, E->get().name.capitalize(), objects.size()); popup->set_item_h_offset(index, p_depth * 10 * EDSCALE); - objects.push_back(obj->get_instance_ID()); + objects.push_back(obj->get_instance_id()); _add_children_to_popup(obj, p_depth + 1); } diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index c65065db43..19c77ef737 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -407,41 +407,41 @@ EditorFileSystem *EditorPlugin::get_resource_file_system() { void EditorPlugin::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_control_to_container", "container", "control:Control"), &EditorPlugin::add_control_to_container); - ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel:ToolButton", "control:Control", "title"), &EditorPlugin::add_control_to_bottom_panel); - ClassDB::bind_method(D_METHOD("add_control_to_dock", "slot", "control:Control"), &EditorPlugin::add_control_to_dock); - ClassDB::bind_method(D_METHOD("remove_control_from_docks", "control:Control"), &EditorPlugin::remove_control_from_docks); - ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel", "control:Control"), &EditorPlugin::remove_control_from_bottom_panel); + ClassDB::bind_method(D_METHOD("add_control_to_container", "container", "control"), &EditorPlugin::add_control_to_container); + ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel", "control", "title"), &EditorPlugin::add_control_to_bottom_panel); + ClassDB::bind_method(D_METHOD("add_control_to_dock", "slot", "control"), &EditorPlugin::add_control_to_dock); + ClassDB::bind_method(D_METHOD("remove_control_from_docks", "control"), &EditorPlugin::remove_control_from_docks); + ClassDB::bind_method(D_METHOD("remove_control_from_bottom_panel", "control"), &EditorPlugin::remove_control_from_bottom_panel); //ClassDB::bind_method(D_METHOD("add_tool_menu_item", "name", "handler", "callback", "ud"),&EditorPlugin::add_tool_menu_item,DEFVAL(Variant())); - ClassDB::bind_method(D_METHOD("add_tool_submenu_item", "name", "submenu:PopupMenu"), &EditorPlugin::add_tool_submenu_item); + ClassDB::bind_method(D_METHOD("add_tool_submenu_item", "name", "submenu"), &EditorPlugin::add_tool_submenu_item); //ClassDB::bind_method(D_METHOD("remove_tool_menu_item", "name"),&EditorPlugin::remove_tool_menu_item); - ClassDB::bind_method(D_METHOD("add_custom_type", "type", "base", "script:Script", "icon:Texture"), &EditorPlugin::add_custom_type); + ClassDB::bind_method(D_METHOD("add_custom_type", "type", "base", "script", "icon"), &EditorPlugin::add_custom_type); ClassDB::bind_method(D_METHOD("remove_custom_type", "type"), &EditorPlugin::remove_custom_type); - ClassDB::bind_method(D_METHOD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport); + ClassDB::bind_method(D_METHOD("get_editor_viewport"), &EditorPlugin::get_editor_viewport); - ClassDB::bind_method(D_METHOD("get_resource_previewer:EditorResourcePreview"), &EditorPlugin::get_resource_previewer); - ClassDB::bind_method(D_METHOD("get_resource_filesystem:EditorFileSystem"), &EditorPlugin::get_resource_file_system); + ClassDB::bind_method(D_METHOD("get_resource_previewer"), &EditorPlugin::get_resource_previewer); + ClassDB::bind_method(D_METHOD("get_resource_filesystem"), &EditorPlugin::get_resource_file_system); ClassDB::bind_method(D_METHOD("inspect_object", "object", "for_property"), &EditorPlugin::inspect_object, DEFVAL(String())); ClassDB::bind_method(D_METHOD("update_canvas"), &EditorPlugin::update_canvas); - ClassDB::bind_method(D_METHOD("make_bottom_panel_item_visible", "item:Control"), &EditorPlugin::make_bottom_panel_item_visible); + ClassDB::bind_method(D_METHOD("make_bottom_panel_item_visible", "item"), &EditorPlugin::make_bottom_panel_item_visible); ClassDB::bind_method(D_METHOD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel); - ClassDB::bind_method(D_METHOD("get_base_control:Control"), &EditorPlugin::get_base_control); - ClassDB::bind_method(D_METHOD("get_undo_redo:UndoRedo"), &EditorPlugin::_get_undo_redo); - ClassDB::bind_method(D_METHOD("get_selection:EditorSelection"), &EditorPlugin::get_selection); - ClassDB::bind_method(D_METHOD("get_editor_settings:EditorSettings"), &EditorPlugin::get_editor_settings); - ClassDB::bind_method(D_METHOD("get_script_editor:ScriptEditor"), &EditorPlugin::get_script_editor); + ClassDB::bind_method(D_METHOD("get_base_control"), &EditorPlugin::get_base_control); + ClassDB::bind_method(D_METHOD("get_undo_redo"), &EditorPlugin::_get_undo_redo); + ClassDB::bind_method(D_METHOD("get_selection"), &EditorPlugin::get_selection); + ClassDB::bind_method(D_METHOD("get_editor_settings"), &EditorPlugin::get_editor_settings); + ClassDB::bind_method(D_METHOD("get_script_editor"), &EditorPlugin::get_script_editor); ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout); - ClassDB::bind_method(D_METHOD("edit_resource", "resource:Resource"), &EditorPlugin::edit_resource); + ClassDB::bind_method(D_METHOD("edit_resource", "resource"), &EditorPlugin::edit_resource); ClassDB::bind_method(D_METHOD("open_scene_from_path", "scene_filepath"), &EditorPlugin::open_scene_from_path); ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorPlugin::reload_scene_from_path); - ClassDB::bind_method(D_METHOD("add_import_plugin", "importer:EditorImportPlugin"), &EditorPlugin::add_import_plugin); - ClassDB::bind_method(D_METHOD("remove_import_plugin", "importer:EditorImportPlugin"), &EditorPlugin::remove_import_plugin); + ClassDB::bind_method(D_METHOD("add_import_plugin", "importer"), &EditorPlugin::add_import_plugin); + ClassDB::bind_method(D_METHOD("remove_import_plugin", "importer"), &EditorPlugin::remove_import_plugin); ClassDB::bind_method(D_METHOD("set_input_event_forwarding_always_enabled"), &EditorPlugin::set_input_event_forwarding_always_enabled); ClassDB::bind_method(D_METHOD("get_open_scenes"), &EditorPlugin::get_open_scenes); - ClassDB::bind_method(D_METHOD("get_edited_scene_root:Node"), &EditorPlugin::get_edited_scene_root); + ClassDB::bind_method(D_METHOD("get_edited_scene_root"), &EditorPlugin::get_edited_scene_root); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_draw_over_canvas", PropertyInfo(Variant::TRANSFORM2D, "canvas_xform"), PropertyInfo(Variant::OBJECT, "canvas:Control"))); diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index 63bee33092..712a3ac001 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -193,15 +193,16 @@ EditorPluginSettings::EditorPluginSettings() { plugin_list->set_column_expand(1, false); plugin_list->set_column_expand(2, false); plugin_list->set_column_expand(3, false); - plugin_list->set_column_min_width(1, 100); - plugin_list->set_column_min_width(2, 250); - plugin_list->set_column_min_width(3, 80); + plugin_list->set_column_min_width(1, 100 * EDSCALE); + plugin_list->set_column_min_width(2, 250 * EDSCALE); + plugin_list->set_column_min_width(3, 80 * EDSCALE); plugin_list->set_hide_root(true); plugin_list->connect("item_edited", this, "_plugin_activity_changed"); - MarginContainer *mc = memnew(MarginContainer); + VBoxContainer *mc = memnew(VBoxContainer); mc->add_child(plugin_list); mc->set_v_size_flags(SIZE_EXPAND_FILL); + mc->set_h_size_flags(SIZE_EXPAND_FILL); add_child(mc); diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index 64cf275c3a..78bc99caae 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -129,10 +129,11 @@ String EditorProfiler::_get_time_as_text(Metric &m, float p_time, int p_calls) { Color EditorProfiler::_get_color_from_signature(const StringName &p_signature) const { + Color bc = get_color("error_color", "Editor"); double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF)); Color c; - c.set_hsv(rot, 1, 1); - return c; + c.set_hsv(rot, bc.get_s(), bc.get_v()); + return c.linear_interpolate(get_color("base_color", "Editor"), 0.07); } void EditorProfiler::_item_edited() { @@ -387,7 +388,6 @@ void EditorProfiler::_update_frame() { if (plot_sigs.has(m.categories[i].signature)) { category->set_checked(0, true); - category->set_custom_bg_color(0, Color(0, 0, 0)); category->set_custom_color(0, _get_color_from_signature(m.categories[i].signature)); } @@ -411,7 +411,6 @@ void EditorProfiler::_update_frame() { if (plot_sigs.has(it.signature)) { item->set_checked(0, true); - item->set_custom_bg_color(0, Color(0, 0, 0)); item->set_custom_color(0, _get_color_from_signature(it.signature)); } } diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 89fa004eb1..dcfe68b286 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -295,7 +295,7 @@ void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p preview_mutex->lock(); - String path_id = "ID:" + itos(p_res->get_instance_ID()); + String path_id = "ID:" + itos(p_res->get_instance_id()); if (cache.has(path_id) && cache[path_id].last_hash == p_res->hash_edited_version()) { @@ -310,7 +310,7 @@ void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p //print_line("send to thread "+p_path); QueueItem item; item.function = p_receiver_func; - item.id = p_receiver->get_instance_ID(); + item.id = p_receiver->get_instance_id(); item.resource = p_res; item.path = path_id; item.userdata = p_userdata; @@ -334,7 +334,7 @@ void EditorResourcePreview::queue_resource_preview(const String &p_path, Object //print_line("send to thread "+p_path); QueueItem item; item.function = p_receiver_func; - item.id = p_receiver->get_instance_ID(); + item.id = p_receiver->get_instance_id(); item.path = p_path; item.userdata = p_userdata; @@ -362,10 +362,10 @@ void EditorResourcePreview::_bind_methods() { ClassDB::bind_method("_preview_ready", &EditorResourcePreview::_preview_ready); - ClassDB::bind_method(D_METHOD("queue_resource_preview", "path", "receiver", "receiver_func", "userdata:Variant"), &EditorResourcePreview::queue_resource_preview); - ClassDB::bind_method(D_METHOD("queue_edited_resource_preview", "resource:Resource", "receiver", "receiver_func", "userdata:Variant"), &EditorResourcePreview::queue_edited_resource_preview); - ClassDB::bind_method(D_METHOD("add_preview_generator", "generator:EditorResourcePreviewGenerator"), &EditorResourcePreview::add_preview_generator); - ClassDB::bind_method(D_METHOD("remove_preview_generator", "generator:EditorResourcePreviewGenerator"), &EditorResourcePreview::remove_preview_generator); + ClassDB::bind_method(D_METHOD("queue_resource_preview", "path", "receiver", "receiver_func", "userdata"), &EditorResourcePreview::queue_resource_preview); + ClassDB::bind_method(D_METHOD("queue_edited_resource_preview", "resource", "receiver", "receiver_func", "userdata"), &EditorResourcePreview::queue_edited_resource_preview); + ClassDB::bind_method(D_METHOD("add_preview_generator", "generator"), &EditorResourcePreview::add_preview_generator); + ClassDB::bind_method(D_METHOD("remove_preview_generator", "generator"), &EditorResourcePreview::remove_preview_generator); ClassDB::bind_method(D_METHOD("check_for_invalidation", "path"), &EditorResourcePreview::check_for_invalidation); ADD_SIGNAL(MethodInfo("preview_invalidated", PropertyInfo(Variant::STRING, "path"))); diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index aa97dd237b..4954b1f741 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -55,7 +55,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li } args.push_back("-epid"); - args.push_back(String::num(OS::get_singleton()->get_process_ID())); + args.push_back(String::num(OS::get_singleton()->get_process_id())); if (debug_collisions) { args.push_back("-debugcol"); diff --git a/editor/editor_run_script.cpp b/editor/editor_run_script.cpp index 0e980b040e..8bd1b8f4fd 100644 --- a/editor/editor_run_script.cpp +++ b/editor/editor_run_script.cpp @@ -81,8 +81,8 @@ void EditorScript::set_editor(EditorNode *p_editor) { void EditorScript::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_root_node", "node:Node"), &EditorScript::add_root_node); - ClassDB::bind_method(D_METHOD("get_scene:Node"), &EditorScript::get_scene); + ClassDB::bind_method(D_METHOD("add_root_node", "node"), &EditorScript::add_root_node); + ClassDB::bind_method(D_METHOD("get_scene"), &EditorScript::get_scene); BIND_VMETHOD(MethodInfo("_run")); } diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 755ac75180..07af60d634 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -216,17 +216,43 @@ Variant _EDITOR_DEF(const String &p_var, const Variant &p_default) { return p_default; } +static Dictionary _get_builtin_script_templates() { + Dictionary templates; + + //No Comments + templates["no_comments.gd"] = + "extends %BASE%\n" + "\n" + "func _ready():\n" + "%TS%pass\n"; + + //Empty + templates["empty.gd"] = + "extends %BASE%" + "\n" + "\n"; + + return templates; +} + static void _create_script_templates(const String &p_path) { - FileAccess *file = FileAccess::open(p_path.plus_file("no_comments.gd"), FileAccess::WRITE); - ERR_FAIL_COND(!file); - String script = String("extends %BASE%\n\nfunc _ready():\n%TS%pass\n"); - file->store_string(script); - file->close(); - file->reopen(p_path.plus_file("empty.gd"), FileAccess::WRITE); - script = "extends %BASE%\n\n"; - file->store_string(script); - file->close(); + Dictionary templates = _get_builtin_script_templates(); + List<Variant> keys; + templates.get_key_list(&keys); + FileAccess *file = FileAccess::create(FileAccess::ACCESS_FILESYSTEM); + + DirAccess *dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + dir->change_dir(p_path); + for (int i = 0; i < keys.size(); i++) { + if (!dir->file_exists(keys[i])) { + file->reopen(p_path.plus_file((String)keys[i]), FileAccess::WRITE); + ERR_FAIL_COND(!file); + file->store_string(templates[keys[i]]); + file->close(); + } + } + memdelete(file); } @@ -308,10 +334,10 @@ void EditorSettings::create() { if (dir->change_dir("script_templates") != OK) { dir->make_dir("script_templates"); - _create_script_templates(dir->get_current_dir() + "/script_templates"); } else { dir->change_dir(".."); } + _create_script_templates(dir->get_current_dir() + "/script_templates"); if (dir->change_dir("tmp") != OK) { dir->make_dir("tmp"); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index df16de947e..156f00f6a3 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -143,7 +143,7 @@ Ref<Theme> create_editor_theme() { Color light_color_1 = base_color.linear_interpolate(Color(1, 1, 1, 1), contrast); Color light_color_2 = base_color.linear_interpolate(Color(1, 1, 1, 1), contrast * 1.5); - const int border_width = (border_size % 3) * EDSCALE; + const int border_width = CLAMP(border_size, 0, 3) * EDSCALE; Color title_color_hl = base_color; if (highlight_tabs) @@ -163,7 +163,7 @@ Ref<Theme> create_editor_theme() { theme->set_color("light_color_1", "Editor", light_color_1); theme->set_color("light_color_2", "Editor", light_color_2); - Color success_color = highlight_color.linear_interpolate(Color(0, 1, .8), 0.8); + Color success_color = highlight_color.linear_interpolate(Color(.6, 1, .6), 0.8); Color warning_color = highlight_color.linear_interpolate(Color(1, 1, .2), 0.8); Color error_color = highlight_color.linear_interpolate(Color(1, .2, .2), 0.8); theme->set_color("success_color", "Editor", success_color); @@ -238,7 +238,7 @@ Ref<Theme> create_editor_theme() { theme->set_stylebox("panel", "TabContainer", style_content_panel); theme->set_stylebox("Content", "EditorStyles", style_content_panel_vp); - Ref<StyleBoxFlat> style_button_type = make_flat_stylebox(dark_color_1, 4, 4, 6, 4); + Ref<StyleBoxFlat> style_button_type = make_flat_stylebox(dark_color_1, 6, 4, 6, 4); style_button_type->set_draw_center(true); style_button_type->set_border_size(border_width); style_button_type->set_light_color(light_color_1); @@ -287,12 +287,12 @@ Ref<Theme> create_editor_theme() { // PopupMenu Ref<StyleBoxFlat> style_popup_menu = make_flat_stylebox(dark_color_1, 8, 8, 8, 8); - style_popup_menu->set_border_size(border_width); + style_popup_menu->set_border_size(MAX(EDSCALE, border_width)); style_popup_menu->set_light_color(light_color_1); style_popup_menu->set_dark_color(light_color_1); style_popup_menu->set_border_blend(false); theme->set_stylebox("panel", "PopupMenu", style_popup_menu); - theme->set_stylebox("separator", "PopupMenu", make_line_stylebox(separator_color, border_width, 8 - border_width)); + theme->set_stylebox("separator", "PopupMenu", make_line_stylebox(separator_color, MAX(EDSCALE, border_width), 8 - MAX(EDSCALE, border_width))); // Tree & ItemList background Ref<StyleBoxFlat> style_tree_bg = make_flat_stylebox(dark_color_1, 2, 4, 2, 4); @@ -382,12 +382,12 @@ Ref<Theme> create_editor_theme() { theme->set_stylebox("SceneTabBG", "EditorStyles", make_empty_stylebox(6, 5, 6, 5)); theme->set_icon("close", "Tabs", title_hl_close_icon); - // Separatos (no separatos) + // Separators (no separators) theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, border_width)); theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, border_width, 0, true)); // Debugger - Ref<StyleBoxFlat> style_panel_debugger = make_flat_stylebox(dark_color_2, 0, 4, 0, 0); + Ref<StyleBoxFlat> style_panel_debugger = make_flat_stylebox(dark_color_2, 4, 4, 4, 4); theme->set_stylebox("DebuggerPanel", "EditorStyles", style_panel_debugger); Ref<StyleBoxFlat> style_tab_fg_debugger = make_flat_stylebox(dark_color_2, 10, 5, 10, 5); @@ -431,7 +431,7 @@ Ref<Theme> create_editor_theme() { // WindowDialog Ref<StyleBoxFlat> style_window = make_flat_stylebox(dark_color_2, 4, 4, 4, 4); - style_window->set_border_size(border_width); + style_window->set_border_size(MAX(EDSCALE, border_width)); style_window->set_border_blend(false); style_window->set_light_color(title_color_hl); style_window->set_dark_color(title_color_hl); @@ -478,6 +478,9 @@ Ref<Theme> create_editor_theme() { theme->set_icon("grabber", "VSlider", theme->get_icon("GuiSliderGrabber", "EditorIcons")); theme->set_icon("grabber_highlight", "VSlider", theme->get_icon("GuiSliderGrabberHl", "EditorIcons")); + //RichTextLabel + theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox()); + // Panel theme->set_stylebox("panel", "Panel", style_panel); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 77ca1a5145..8e40850a0c 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -102,7 +102,7 @@ void FileSystemDock::_notification(int p_what) { case NOTIFICATION_RESIZED: { - bool new_mode = get_size().height < get_viewport_rect().size.height * 3 / 4; + bool new_mode = get_size().height < get_viewport_rect().size.height / 2; if (new_mode != split_mode) { @@ -589,7 +589,7 @@ void FileSystemDock::_go_to_dir(const String &p_dir) { void FileSystemDock::_preview_invalidated(const String &p_path) { - if (p_path.get_base_dir() == path && search_box->get_text() == String() && file_list_vb->is_visible_in_tree()) { + if (display_mode == DISPLAY_THUMBNAILS && p_path.get_base_dir() == path && search_box->get_text() == String() && file_list_vb->is_visible_in_tree()) { for (int i = 0; i < files->get_item_count(); i++) { @@ -1737,7 +1737,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { file_list_vb->set_v_size_flags(SIZE_EXPAND_FILL); path_hb = memnew(HBoxContainer); - path_hb->add_child(memnew(Control)); file_list_vb->add_child(path_hb); button_back = memnew(ToolButton); diff --git a/editor/icons/2x/icon_audio_stream_player_3_d.png b/editor/icons/2x/icon_audio_stream_player_3_d.png Binary files differnew file mode 100644 index 0000000000..917719f54b --- /dev/null +++ b/editor/icons/2x/icon_audio_stream_player_3_d.png diff --git a/editor/icons/2x/icon_bus_vu_frozen.png b/editor/icons/2x/icon_bus_vu_frozen.png Binary files differindex 367322b21c..94d5d335d6 100644 --- a/editor/icons/2x/icon_bus_vu_frozen.png +++ b/editor/icons/2x/icon_bus_vu_frozen.png diff --git a/editor/icons/2x/icon_connect.png b/editor/icons/2x/icon_connect.png Binary files differindex e3f4b8fd12..2a36b1716a 100644 --- a/editor/icons/2x/icon_connect.png +++ b/editor/icons/2x/icon_connect.png diff --git a/editor/icons/2x/icon_native_script.png b/editor/icons/2x/icon_native_script.png Binary files differnew file mode 100644 index 0000000000..31cc130867 --- /dev/null +++ b/editor/icons/2x/icon_native_script.png diff --git a/editor/icons/icon_audio_stream_player_3_d.png b/editor/icons/icon_audio_stream_player_3_d.png Binary files differnew file mode 100644 index 0000000000..60e3528ffd --- /dev/null +++ b/editor/icons/icon_audio_stream_player_3_d.png diff --git a/editor/icons/icon_bus_vu_frozen.png b/editor/icons/icon_bus_vu_frozen.png Binary files differindex 1a6ca6e767..4e9b8f4b4b 100644 --- a/editor/icons/icon_bus_vu_frozen.png +++ b/editor/icons/icon_bus_vu_frozen.png diff --git a/editor/icons/icon_connect.png b/editor/icons/icon_connect.png Binary files differindex 51615838a9..0963063bed 100644 --- a/editor/icons/icon_connect.png +++ b/editor/icons/icon_connect.png diff --git a/editor/icons/icon_native_script.png b/editor/icons/icon_native_script.png Binary files differnew file mode 100644 index 0000000000..ea4fe06704 --- /dev/null +++ b/editor/icons/icon_native_script.png diff --git a/editor/icons/source/icon_audio_stream_player_3_d.svg b/editor/icons/source/icon_audio_stream_player_3_d.svg new file mode 100644 index 0000000000..1858f8fe33 --- /dev/null +++ b/editor/icons/source/icon_audio_stream_player_3_d.svg @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_audio_stream_player_3_d.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient959-5" + inkscape:collect="always"> + <stop + style="stop-color:#ff8484;stop-opacity:1" + offset="0" + id="stop957-3" /> + <stop + id="stop955-5" + offset="0.5" + style="stop-color:#e1dc7a;stop-opacity:1" /> + <stop + style="stop-color:#84ffb1;stop-opacity:1" + offset="1" + id="stop953-6" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient959-5" + id="linearGradient4552" + x1="8" + y1="1" + x2="8" + y2="15" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="11.313709" + inkscape:cx="-0.23400447" + inkscape:cy="10.117538" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-midpoints="true" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#fc9c9c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.97227669;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 10.023235,1044.3625 c -0.5613918,-0.013 -1.0235345,0.4264 -1.0234377,0.9724 v 5.0542 c 6.911e-4,0.7482 0.8336124,1.2154 1.4999997,0.8414 l 4,-2.5262 c 0.666937,-0.3743 0.666937,-1.3104 0,-1.6847 l -4,-2.5261 c -0.145049,-0.082 -0.308928,-0.1269 -0.476562,-0.131 z" + id="path4507" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccc" /> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient4552);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 11.970703 1.0019531 A 1.0001 1.0001 0 0 0 11.724609 1.0390625 L 4.7246094 3.0390625 A 1.0001 1.0001 0 0 0 4 4 L 4 9.5507812 A 2.5 2.4999914 0 0 0 3.5 9.5 A 2.5 2.4999914 0 0 0 1 12 A 2.5 2.4999914 0 0 0 3.5 14.5 A 2.5 2.4999914 0 0 0 5.9960938 12.087891 A 1.0001 1.0001 0 0 0 6 12 L 6 4.7558594 L 11 3.328125 L 11 6.5 L 13 5.5 L 13 2 A 1.0001 1.0001 0 0 0 11.970703 1.0019531 z " + transform="translate(0,1036.3622)" + id="path4514" /> + </g> +</svg> diff --git a/editor/icons/source/icon_bus_vu_frozen.svg b/editor/icons/source/icon_bus_vu_frozen.svg index 0324076402..40577a1a77 100644 --- a/editor/icons/source/icon_bus_vu_frozen.svg +++ b/editor/icons/source/icon_bus_vu_frozen.svg @@ -15,7 +15,7 @@ viewBox="0 0 16 128" id="svg2" version="1.1" - inkscape:version="0.92.1 r" + inkscape:version="0.92+devel unknown" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_vu_empty.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -56,8 +56,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="5.6568543" - inkscape:cx="9.4951314" - inkscape:cy="71.853257" + inkscape:cx="14.809902" + inkscape:cy="65.349668" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -69,8 +69,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1600" - inkscape:window-height="836" + inkscape:window-width="1920" + inkscape:window-height="1016" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -78,7 +78,8 @@ inkscape:snap-intersection-paths="false" inkscape:object-nodes="false" inkscape:snap-smooth-nodes="false" - inkscape:snap-midpoints="false"> + inkscape:snap-midpoints="false" + inkscape:document-rotation="0"> <inkscape:grid type="xygrid" id="grid3336" @@ -92,7 +93,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -102,7 +103,7 @@ id="layer1" transform="translate(0,-924.3622)"> <path - style="fill:url(#linearGradient951);fill-opacity:1;stroke:none;stroke-width:1.28571427;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:url(#linearGradient951);fill-opacity:1;stroke:none;stroke-width:1.28571427;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;opacity:0.7" d="M 3 2 C 2.4459952 2 2 2.4459952 2 3 C 2 3.5540048 2.4459952 4 3 4 L 13 4 C 13.554005 4 14 3.5540048 14 3 C 14 2.4459952 13.554005 2 13 2 L 3 2 z M 3 5 C 2.4459952 5 2 5.4459952 2 6 C 2 6.5540048 2.4459952 7 3 7 L 13 7 C 13.554005 7 14 6.5540048 14 6 C 14 5.4459952 13.554005 5 13 5 L 3 5 z M 3 8 C 2.4459952 8 2 8.4459952 2 9 C 2 9.5540048 2.4459952 10 3 10 L 13 10 C 13.554005 10 14 9.5540048 14 9 C 14 8.4459952 13.554005 8 13 8 L 3 8 z M 3 11 C 2.4459952 11 2 11.445995 2 12 C 2 12.554005 2.4459952 13 3 13 L 13 13 C 13.554005 13 14 12.554005 14 12 C 14 11.445995 13.554005 11 13 11 L 3 11 z M 3 14 C 2.4459952 14 2 14.445995 2 15 C 2 15.554005 2.4459952 16 3 16 L 13 16 C 13.554005 16 14 15.554005 14 15 C 14 14.445995 13.554005 14 13 14 L 3 14 z M 3 17 C 2.4459952 17 2 17.445995 2 18 C 2 18.554005 2.4459952 19 3 19 L 13 19 C 13.554005 19 14 18.554005 14 18 C 14 17.445995 13.554005 17 13 17 L 3 17 z M 3 20 C 2.4459952 20 2 20.445995 2 21 C 2 21.554005 2.4459952 22 3 22 L 13 22 C 13.554005 22 14 21.554005 14 21 C 14 20.445995 13.554005 20 13 20 L 3 20 z M 3 23 C 2.4459952 23 2 23.445995 2 24 C 2 24.554005 2.4459952 25 3 25 L 13 25 C 13.554005 25 14 24.554005 14 24 C 14 23.445995 13.554005 23 13 23 L 3 23 z M 3 26 C 2.4459952 26 2 26.445995 2 27 C 2 27.554005 2.4459952 28 3 28 L 13 28 C 13.554005 28 14 27.554005 14 27 C 14 26.445995 13.554005 26 13 26 L 3 26 z M 3 31 C 2.4459952 31 2 31.445995 2 32 C 2 32.554005 2.4459952 33 3 33 L 13 33 C 13.554005 33 14 32.554005 14 32 C 14 31.445995 13.554005 31 13 31 L 3 31 z M 3 34 C 2.4459952 34 2 34.445995 2 35 C 2 35.554005 2.4459952 36 3 36 L 13 36 C 13.554005 36 14 35.554005 14 35 C 14 34.445995 13.554005 34 13 34 L 3 34 z M 3 37 C 2.4459952 37 2 37.445995 2 38 C 2 38.554005 2.4459952 39 3 39 L 13 39 C 13.554005 39 14 38.554005 14 38 C 14 37.445995 13.554005 37 13 37 L 3 37 z M 3 40 C 2.4459952 40 2 40.445995 2 41 C 2 41.554005 2.4459952 42 3 42 L 13 42 C 13.554005 42 14 41.554005 14 41 C 14 40.445995 13.554005 40 13 40 L 3 40 z M 3 43 C 2.4459952 43 2 43.445995 2 44 C 2 44.554005 2.4459952 45 3 45 L 13 45 C 13.554005 45 14 44.554005 14 44 C 14 43.445995 13.554005 43 13 43 L 3 43 z M 3 46 C 2.4459952 46 2 46.445995 2 47 C 2 47.554005 2.4459952 48 3 48 L 13 48 C 13.554005 48 14 47.554005 14 47 C 14 46.445995 13.554005 46 13 46 L 3 46 z M 3 49 C 2.4459952 49 2 49.445995 2 50 C 2 50.554005 2.4459952 51 3 51 L 13 51 C 13.554005 51 14 50.554005 14 50 C 14 49.445995 13.554005 49 13 49 L 3 49 z M 3 52 C 2.4459952 52 2 52.445995 2 53 C 2 53.554005 2.4459952 54 3 54 L 13 54 C 13.554005 54 14 53.554005 14 53 C 14 52.445995 13.554005 52 13 52 L 3 52 z M 3 55 C 2.4459952 55 2 55.445995 2 56 C 2 56.554005 2.4459952 57 3 57 L 13 57 C 13.554005 57 14 56.554005 14 56 C 14 55.445995 13.554005 55 13 55 L 3 55 z M 3 58 C 2.4459952 58 2 58.445995 2 59 C 2 59.554005 2.4459952 60 3 60 L 13 60 C 13.554005 60 14 59.554005 14 59 C 14 58.445995 13.554005 58 13 58 L 3 58 z M 3 61 C 2.4459952 61 2 61.445995 2 62 C 2 62.554005 2.4459952 63 3 63 L 13 63 C 13.554005 63 14 62.554005 14 62 C 14 61.445995 13.554005 61 13 61 L 3 61 z M 3 64 C 2.4459952 64 2 64.445995 2 65 C 2 65.554005 2.4459952 66 3 66 L 13 66 C 13.554005 66 14 65.554005 14 65 C 14 64.445995 13.554005 64 13 64 L 3 64 z M 3 67 C 2.4459952 67 2 67.445995 2 68 C 2 68.554005 2.4459952 69 3 69 L 13 69 C 13.554005 69 14 68.554005 14 68 C 14 67.445995 13.554005 67 13 67 L 3 67 z M 3 70 C 2.4459952 70 2 70.445995 2 71 C 2 71.554005 2.4459952 72 3 72 L 13 72 C 13.554005 72 14 71.554005 14 71 C 14 70.445995 13.554005 70 13 70 L 3 70 z M 3 73 C 2.4459952 73 2 73.445995 2 74 C 2 74.554005 2.4459952 75 3 75 L 13 75 C 13.554005 75 14 74.554005 14 74 C 14 73.445995 13.554005 73 13 73 L 3 73 z M 3 76 C 2.4459952 76 2 76.445995 2 77 C 2 77.554005 2.4459952 78 3 78 L 13 78 C 13.554005 78 14 77.554005 14 77 C 14 76.445995 13.554005 76 13 76 L 3 76 z M 3 79 C 2.4459952 79 2 79.445995 2 80 C 2 80.554005 2.4459952 81 3 81 L 13 81 C 13.554005 81 14 80.554005 14 80 C 14 79.445995 13.554005 79 13 79 L 3 79 z M 3 82 C 2.4459952 82 2 82.445995 2 83 C 2 83.554005 2.4459952 84 3 84 L 13 84 C 13.554005 84 14 83.554005 14 83 C 14 82.445995 13.554005 82 13 82 L 3 82 z M 3 85 C 2.4459952 85 2 85.445995 2 86 C 2 86.554005 2.4459952 87 3 87 L 13 87 C 13.554005 87 14 86.554005 14 86 C 14 85.445995 13.554005 85 13 85 L 3 85 z M 3 88 C 2.4459952 88 2 88.445995 2 89 C 2 89.554005 2.4459952 90 3 90 L 13 90 C 13.554005 90 14 89.554005 14 89 C 14 88.445995 13.554005 88 13 88 L 3 88 z M 3 91 C 2.4459952 91 2 91.445995 2 92 C 2 92.554005 2.4459952 93 3 93 L 13 93 C 13.554005 93 14 92.554005 14 92 C 14 91.445995 13.554005 91 13 91 L 3 91 z M 3 94 C 2.4459952 94 2 94.445995 2 95 C 2 95.554005 2.4459952 96 3 96 L 13 96 C 13.554005 96 14 95.554005 14 95 C 14 94.445995 13.554005 94 13 94 L 3 94 z M 3 97 C 2.4459952 97 2 97.445995 2 98 C 2 98.554005 2.4459952 99 3 99 L 13 99 C 13.554005 99 14 98.554005 14 98 C 14 97.445995 13.554005 97 13 97 L 3 97 z M 3 100 C 2.4459952 100 2 100.446 2 101 C 2 101.554 2.4459952 102 3 102 L 13 102 C 13.554005 102 14 101.554 14 101 C 14 100.446 13.554005 100 13 100 L 3 100 z M 3 103 C 2.4459952 103 2 103.446 2 104 C 2 104.554 2.4459952 105 3 105 L 13 105 C 13.554005 105 14 104.554 14 104 C 14 103.446 13.554005 103 13 103 L 3 103 z M 3 106 C 2.4459952 106 2 106.446 2 107 C 2 107.554 2.4459952 108 3 108 L 13 108 C 13.554005 108 14 107.554 14 107 C 14 106.446 13.554005 106 13 106 L 3 106 z M 3 109 C 2.4459952 109 2 109.446 2 110 C 2 110.554 2.4459952 111 3 111 L 13 111 C 13.554005 111 14 110.554 14 110 C 14 109.446 13.554005 109 13 109 L 3 109 z M 3 112 C 2.4459952 112 2 112.446 2 113 C 2 113.554 2.4459952 114 3 114 L 13 114 C 13.554005 114 14 113.554 14 113 C 14 112.446 13.554005 112 13 112 L 3 112 z M 3 115 C 2.4459952 115 2 115.446 2 116 C 2 116.554 2.4459952 117 3 117 L 13 117 C 13.554005 117 14 116.554 14 116 C 14 115.446 13.554005 115 13 115 L 3 115 z M 3 118 C 2.4459952 118 2 118.446 2 119 C 2 119.554 2.4459952 120 3 120 L 13 120 C 13.554005 120 14 119.554 14 119 C 14 118.446 13.554005 118 13 118 L 3 118 z M 3 121 C 2.4459952 121 2 121.446 2 122 C 2 122.554 2.4459952 123 3 123 L 13 123 C 13.554005 123 14 122.554 14 122 C 14 121.446 13.554005 121 13 121 L 3 121 z M 3 124 C 2.4459952 124 2 124.446 2 125 C 2 125.554 2.4459952 126 3 126 L 13 126 C 13.554005 126 14 125.554 14 125 C 14 124.446 13.554005 124 13 124 L 3 124 z " id="rect852" transform="translate(0,924.3622)" /> diff --git a/editor/icons/source/icon_g_d_native_script.svg b/editor/icons/source/icon_native_script.svg index 33a8e52a5d..33a8e52a5d 100644 --- a/editor/icons/source/icon_g_d_native_script.svg +++ b/editor/icons/source/icon_native_script.svg diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index 8cb712cb78..07f1f4dd9f 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -123,6 +123,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s int format_channels = 0; AudioStreamSample::LoopMode loop = AudioStreamSample::LOOP_DISABLED; + uint16_t compression_code = 1; bool format_found = false; bool data_found = false; int format_freq = 0; @@ -151,11 +152,10 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s if (chunkID[0] == 'f' && chunkID[1] == 'm' && chunkID[2] == 't' && chunkID[3] == ' ' && !format_found) { /* IS FORMAT CHUNK */ - uint16_t compression_code = file->get_16(); - //Issue: #7755 : Not a bug - usage of other formats (format codes) are unsupported in current importer version. //Consider revision for engine version 3.0 - if (compression_code != 1) { + compression_code = file->get_16(); + if (compression_code != 1 && compression_code != 3) { ERR_PRINT("Format not supported for WAVE file (not PCM). Save WAVE files as uncompressed PCM instead."); break; } @@ -210,33 +210,37 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s data.resize(frames * format_channels); - for (int i = 0; i < frames; i++) { - - for (int c = 0; c < format_channels; c++) { - - if (format_bits == 8) { - // 8 bit samples are UNSIGNED - - uint8_t s = file->get_8(); - s -= 128; - int8_t *sp = (int8_t *)&s; + if (format_bits == 8) { + for (int i = 0; i < frames * format_channels; i++) { + // 8 bit samples are UNSIGNED - data[i * format_channels + c] = float(*sp) / 128.0; + data[i] = int8_t(file->get_8() - 128) / 128.f; + } + } else if (format_bits == 32 && compression_code == 3) { + for (int i = 0; i < frames * format_channels; i++) { + //32 bit IEEE Float - } else { - //16+ bits samples are SIGNED - // if sample is > 16 bits, just read extra bytes + data[i] = file->get_float(); + } + } else if (format_bits == 16) { + for (int i = 0; i < frames * format_channels; i++) { + //16 bit SIGNED - uint32_t s = 0; - for (int b = 0; b < (format_bits >> 3); b++) { + data[i] = int16_t(file->get_16()) / 32768.f; + } + } else { + for (int i = 0; i < frames * format_channels; i++) { + //16+ bits samples are SIGNED + // if sample is > 16 bits, just read extra bytes - s |= ((uint32_t)file->get_8()) << (b * 8); - } - s <<= (32 - format_bits); - int32_t ss = s; + uint32_t s = 0; + for (int b = 0; b < (format_bits >> 3); b++) { - data[i * format_channels + c] = (ss >> 16) / 32768.0; + s |= ((uint32_t)file->get_8()) << (b * 8); } + s <<= (32 - format_bits); + + data[i] = (int32_t(s) >> 16) / 32768.f; } } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index a809a68c23..ac6d78adc2 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -375,6 +375,8 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) { int idx = skeleton_menu->get_item_index(SKELETON_SHOW_BONES); skeleton_menu->set_item_checked(idx, skeleton_show_bones); } + + viewport->update(); } void CanvasItemEditor::_add_canvas_item(CanvasItem *p_canvas_item) { @@ -385,7 +387,7 @@ void CanvasItemEditor::_add_canvas_item(CanvasItem *p_canvas_item) { return; canvas_items.insert(p_canvas_item,p_info); - p_canvas_item->connect("hide",this,"_visibility_changed",varray(p_canvas_item->get_instance_ID()),CONNECT_ONESHOT); + p_canvas_item->connect("hide",this,"_visibility_changed",varray(p_canvas_item->get_instance_id()),CONNECT_ONESHOT); #endif } @@ -1390,7 +1392,12 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) { while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_class("CanvasItem"))) { n = n->get_parent(); }; - c = n->cast_to<CanvasItem>(); + + if (n) { + c = n->cast_to<CanvasItem>(); + } else { + c = NULL; + } // Select the item additive_selection = b->get_shift(); @@ -2204,7 +2211,7 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2 &r_rect, cons if (c->has_meta("_edit_bone_")) { - ObjectID id = c->get_instance_ID(); + ObjectID id = c->get_instance_id(); if (!bone_list.has(id)) { BoneList bone; bone.bone = id; @@ -2769,7 +2776,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { pc.pos = n2d->get_position(); pc.rot = n2d->get_rotation(); pc.scale = n2d->get_scale(); - pc.id = n2d->get_instance_ID(); + pc.id = n2d->get_instance_id(); pose_clipboard.push_back(pc); } } diff --git a/editor/plugins/item_list_editor_plugin.h b/editor/plugins/item_list_editor_plugin.h index 4fed8e49f5..bc009b3d7a 100644 --- a/editor/plugins/item_list_editor_plugin.h +++ b/editor/plugins/item_list_editor_plugin.h @@ -116,8 +116,8 @@ public: virtual void set_item_enabled(int p_idx, int p_enabled) { ob->set_item_disabled(p_idx, !p_enabled); } virtual bool is_item_enabled(int p_idx) const { return !ob->is_item_disabled(p_idx); } - virtual void set_item_id(int p_idx, int p_id) { ob->set_item_ID(p_idx, p_id); } - virtual int get_item_id(int p_idx) const { return ob->get_item_ID(p_idx); } + virtual void set_item_id(int p_idx, int p_id) { ob->set_item_id(p_idx, p_id); } + virtual int get_item_id(int p_idx) const { return ob->get_item_id(p_idx); } virtual void add_item(); virtual int get_item_count() const; @@ -152,8 +152,8 @@ public: virtual void set_item_enabled(int p_idx, int p_enabled) { pp->set_item_disabled(p_idx, !p_enabled); } virtual bool is_item_enabled(int p_idx) const { return !pp->is_item_disabled(p_idx); } - virtual void set_item_id(int p_idx, int p_id) { pp->set_item_ID(p_idx, p_idx); } - virtual int get_item_id(int p_idx) const { return pp->get_item_ID(p_idx); } + virtual void set_item_id(int p_idx, int p_id) { pp->set_item_id(p_idx, p_idx); } + virtual int get_item_id(int p_idx) const { return pp->get_item_id(p_idx); } virtual void set_item_separator(int p_idx, bool p_separator) { pp->set_item_as_separator(p_idx, p_separator); } virtual bool is_item_separator(int p_idx) const { return pp->is_item_separator(p_idx); } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 77c540b746..1873a3f58b 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -211,9 +211,11 @@ void ScriptEditorQuickOpen::_confirmed() { void ScriptEditorQuickOpen::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { - connect("confirmed", this, "_confirmed"); + connect("confirmed", this, "_confirmed"); + } break; } } @@ -1064,58 +1066,73 @@ void ScriptEditor::_tab_changed(int p_which) { void ScriptEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - - editor->connect("play_pressed", this, "_editor_play"); - editor->connect("pause_pressed", this, "_editor_pause"); - editor->connect("stop_pressed", this, "_editor_stop"); - editor->connect("script_add_function_request", this, "_add_callback"); - editor->connect("resource_saved", this, "_res_saved_callback"); - script_list->connect("item_selected", this, "_script_selected"); - members_overview->connect("item_selected", this, "_members_overview_selected"); - script_split->connect("dragged", this, "_script_split_dragged"); - autosave_timer->connect("timeout", this, "_autosave_scripts"); - { - float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs"); - if (autosave_time > 0) { - autosave_timer->set_wait_time(autosave_time); - autosave_timer->start(); - } else { - autosave_timer->stop(); + switch (p_what) { + + case NOTIFICATION_ENTER_TREE: { + + editor->connect("play_pressed", this, "_editor_play"); + editor->connect("pause_pressed", this, "_editor_pause"); + editor->connect("stop_pressed", this, "_editor_stop"); + editor->connect("script_add_function_request", this, "_add_callback"); + editor->connect("resource_saved", this, "_res_saved_callback"); + script_list->connect("item_selected", this, "_script_selected"); + members_overview->connect("item_selected", this, "_members_overview_selected"); + script_split->connect("dragged", this, "_script_split_dragged"); + autosave_timer->connect("timeout", this, "_autosave_scripts"); + { + float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs"); + if (autosave_time > 0) { + autosave_timer->set_wait_time(autosave_time); + autosave_timer->start(); + } else { + autosave_timer->stop(); + } } - } - EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); - help_search->set_icon(get_icon("HelpSearch", "EditorIcons")); - site_search->set_icon(get_icon("Instance", "EditorIcons")); - class_search->set_icon(get_icon("ClassList", "EditorIcons")); + EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); + help_search->set_icon(get_icon("HelpSearch", "EditorIcons")); + site_search->set_icon(get_icon("Instance", "EditorIcons")); + class_search->set_icon(get_icon("ClassList", "EditorIcons")); - script_forward->set_icon(get_icon("Forward", "EditorIcons")); - script_back->set_icon(get_icon("Back", "EditorIcons")); - } + script_forward->set_icon(get_icon("Forward", "EditorIcons")); + script_back->set_icon(get_icon("Back", "EditorIcons")); + } break; - if (p_what == NOTIFICATION_READY) { + case NOTIFICATION_READY: { - get_tree()->connect("tree_changed", this, "_tree_changed"); - editor->connect("request_help", this, "_request_help"); - editor->connect("request_help_search", this, "_help_search"); - editor->connect("request_help_index", this, "_help_index"); - } + get_tree()->connect("tree_changed", this, "_tree_changed"); + editor->connect("request_help", this, "_request_help"); + editor->connect("request_help_search", this, "_help_search"); + editor->connect("request_help_index", this, "_help_index"); + } break; - if (p_what == NOTIFICATION_EXIT_TREE) { + case NOTIFICATION_EXIT_TREE: { - editor->disconnect("play_pressed", this, "_editor_play"); - editor->disconnect("pause_pressed", this, "_editor_pause"); - editor->disconnect("stop_pressed", this, "_editor_stop"); - } + editor->disconnect("play_pressed", this, "_editor_play"); + editor->disconnect("pause_pressed", this, "_editor_pause"); + editor->disconnect("stop_pressed", this, "_editor_stop"); + } break; - if (p_what == MainLoop::NOTIFICATION_WM_FOCUS_IN) { + case MainLoop::NOTIFICATION_WM_FOCUS_IN: { - _test_script_times_on_disk(); - _update_modified_scripts_for_external_editor(); - } + _test_script_times_on_disk(); + _update_modified_scripts_for_external_editor(); + } break; + + case NOTIFICATION_PROCESS: { + } break; - if (p_what == NOTIFICATION_PROCESS) { + case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { + + tab_container->add_style_override("panel", editor->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles")); + + Ref<StyleBox> sb = editor->get_gui_base()->get_stylebox("panel", "TabContainer")->duplicate(); + sb->set_default_margin(MARGIN_TOP, 0); + add_style_override("panel", sb); + } break; + + default: + break; } } diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index e3184a028e..62fcc4b489 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -456,7 +456,7 @@ String ScriptTextEditor::get_name() { } else if (script->get_name() != "") name = script->get_name(); else - name = script->get_class() + "(" + itos(script->get_instance_ID()) + ")"; + name = script->get_class() + "(" + itos(script->get_instance_id()) + ")"; return name; } diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 2d77bfb2c1..0dba1f12a2 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -57,6 +57,12 @@ #define FREELOOK_MIN_SPEED 0.1 +#define MIN_Z 0.01 +#define MAX_Z 10000 + +#define MIN_FOV 0.01 +#define MAX_FOV 179 + void SpatialEditorViewport::_update_camera() { if (orthogonal) { //camera->set_orthogonal(size.width*cursor.distance,get_znear(),get_zfar()); @@ -153,26 +159,15 @@ int SpatialEditorViewport::get_selected_count() const { float SpatialEditorViewport::get_znear() const { - float val = spatial_editor->get_znear(); - if (val < 0.001) - val = 0.001; - return val; + return CLAMP(spatial_editor->get_znear(), MIN_Z, MAX_Z); } float SpatialEditorViewport::get_zfar() const { - float val = spatial_editor->get_zfar(); - if (val < 0.001) - val = 0.001; - return val; + return CLAMP(spatial_editor->get_zfar(), MIN_Z, MAX_Z); } float SpatialEditorViewport::get_fov() const { - float val = spatial_editor->get_fov(); - if (val < 0.001) - val = 0.001; - if (val > 89) - val = 89; - return val; + return CLAMP(spatial_editor->get_fov(), MIN_FOV, MAX_FOV); } Transform SpatialEditorViewport::_get_camera_transform() const { @@ -665,7 +660,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { if (selection_results.size() == 1) { - clicked = selection_results[0].item->get_instance_ID(); + clicked = selection_results[0].item->get_instance_id(); selection_results.clear(); if (clicked) { @@ -1195,17 +1190,47 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { motion = motion_mask.dot(motion) * motion_mask; } + //set_message("Translating: "+motion); + + List<Node *> &selection = editor_selection->get_selected_node_list(); + float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { snap = spatial_editor->get_translate_snap(); - motion.snap(Vector3(snap, snap, snap)); - } + bool local_coords = spatial_editor->are_local_coords_enabled(); + + if (local_coords) { + bool multiple = false; + Spatial *node = NULL; + for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { + + Spatial *sp = E->get()->cast_to<Spatial>(); + if (!sp) { + continue; + } + if (node) { + multiple = true; + break; + } else { + node = sp; + } + } - //set_message("Translating: "+motion); + if (multiple) { + motion.snap(Vector3(snap, snap, snap)); + } else { + Basis b = node->get_global_transform().basis.orthonormalized(); + Vector3 local_motion = b.inverse().xform(motion); + local_motion.snap(Vector3(snap, snap, snap)); + motion = b.xform(local_motion); + } - List<Node *> &selection = editor_selection->get_selected_node_list(); + } else { + motion.snap(Vector3(snap, snap, snap)); + } + } for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -2166,7 +2191,7 @@ void SpatialEditorViewport::_selection_result_pressed(int p_result) { if (selection_results.size() <= p_result) return; - clicked = selection_results[p_result].item->get_instance_ID(); + clicked = selection_results[p_result].item->get_instance_id(); if (clicked) { _select_clicked(clicked_wants_append, true); @@ -2390,7 +2415,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu = memnew(MenuButton); surface->add_child(view_menu); - view_menu->set_position(Point2(4, 4)); + view_menu->set_position(Point2(4, 4) * EDSCALE); view_menu->set_self_modulate(Color(1, 1, 1, 0.5)); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/top_view"), VIEW_TOP); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/bottom_view"), VIEW_BOTTOM); @@ -2434,8 +2459,8 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed preview_camera = memnew(Button); preview_camera->set_toggle_mode(true); - preview_camera->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, 90); - preview_camera->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 10); + preview_camera->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, 90 * EDSCALE); + preview_camera->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 10 * EDSCALE); preview_camera->set_text("preview"); surface->add_child(preview_camera); preview_camera->hide(); @@ -2455,7 +2480,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed selection_menu = memnew(PopupMenu); add_child(selection_menu); - selection_menu->set_custom_minimum_size(Vector2(100, 0)); + selection_menu->set_custom_minimum_size(Size2(100, 0) * EDSCALE); selection_menu->connect("id_pressed", this, "_selection_result_pressed"); selection_menu->connect("popup_hide", this, "_selection_menu_hide"); @@ -2464,7 +2489,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed viewport->set_as_audio_listener(true); } - name = TTR("Top"); + name = ""; _update_name(); EditorSettings::get_singleton()->connect("settings_changed", this, "update_transform_gizmo_view"); @@ -3039,9 +3064,9 @@ void SpatialEditor::edit(Spatial *p_spatial) { /* if (p_spatial) { _validate_selection(); - if (selected.has(p_spatial->get_instance_ID()) && selected.size()==1) + if (selected.has(p_spatial->get_instance_id()) && selected.size()==1) return; - _select(p_spatial->get_instance_ID(),false,true); + _select(p_spatial->get_instance_id(),false,true); // should become the selection } @@ -3933,27 +3958,27 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_dialog->set_title(TTR("Viewport Settings")); add_child(settings_dialog); settings_vbc = memnew(VBoxContainer); - settings_vbc->set_custom_minimum_size(Size2(200, 0)); + settings_vbc->set_custom_minimum_size(Size2(200, 0) * EDSCALE); settings_dialog->add_child(settings_vbc); //settings_dialog->set_child_rect(settings_vbc); settings_fov = memnew(SpinBox); - settings_fov->set_max(179); - settings_fov->set_min(1); + settings_fov->set_max(MAX_FOV); + settings_fov->set_min(MIN_FOV); settings_fov->set_step(0.01); settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 55.0)); settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"), settings_fov); settings_znear = memnew(SpinBox); - settings_znear->set_max(10000); - settings_znear->set_min(0.1); + settings_znear->set_max(MAX_Z); + settings_znear->set_min(MIN_Z); settings_znear->set_step(0.01); settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.1)); settings_vbc->add_margin_child(TTR("View Z-Near:"), settings_znear); settings_zfar = memnew(SpinBox); - settings_zfar->set_max(10000); - settings_zfar->set_min(0.1); + settings_zfar->set_max(MAX_Z); + settings_zfar->set_min(MIN_Z); settings_zfar->set_step(0.01); settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far", 1500)); settings_vbc->add_margin_child(TTR("View Z-Far:"), settings_zfar); diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 9b626054c0..e9857f8b0c 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -514,6 +514,8 @@ public: float get_rotate_snap() const { return snap_rotate->get_text().to_double(); } float get_scale_snap() const { return snap_scale->get_text().to_double(); } + bool are_local_coords_enabled() const { return transform_menu->get_popup()->is_item_checked(transform_menu->get_popup()->get_item_index(SpatialEditor::MENU_TRANSFORM_LOCAL_COORDS)); } + Ref<ArrayMesh> get_move_gizmo(int idx) const { return move_gizmo[idx]; } Ref<ArrayMesh> get_rotate_gizmo(int idx) const { return rotate_gizmo[idx]; } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index f5bb9d4a35..d45a3b1312 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -104,7 +104,7 @@ struct _TECategory { Ref<T> item; StringName name; - bool operator<(const RefItem<T> &p) const { return item->get_instance_ID() < p.item->get_instance_ID(); } + bool operator<(const RefItem<T> &p) const { return item->get_instance_id() < p.item->get_instance_id(); } }; template <class T> diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index e7bc8a4dab..a52a875338 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -1451,6 +1451,11 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { ED_SHORTCUT("tile_map_editor/mirror_x", TTR("Mirror X"), KEY_A); ED_SHORTCUT("tile_map_editor/mirror_y", TTR("Mirror Y"), KEY_S); + HBoxContainer *tool_hb1 = memnew(HBoxContainer); + add_child(tool_hb1); + HBoxContainer *tool_hb2 = memnew(HBoxContainer); + add_child(tool_hb2); + search_box = memnew(LineEdit); search_box->set_h_size_flags(SIZE_EXPAND_FILL); search_box->connect("text_entered", this, "_text_entered"); @@ -1514,47 +1519,44 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { transp->set_tooltip(TTR("Transpose") + " (" + ED_GET_SHORTCUT("tile_map_editor/transpose")->get_as_text() + ")"); transp->set_focus_mode(FOCUS_NONE); transp->connect("pressed", this, "_update_transform_buttons", make_binds(transp)); - toolbar->add_child(transp); + tool_hb1->add_child(transp); mirror_x = memnew(ToolButton); mirror_x->set_toggle_mode(true); mirror_x->set_tooltip(TTR("Mirror X") + " (" + ED_GET_SHORTCUT("tile_map_editor/mirror_x")->get_as_text() + ")"); mirror_x->set_focus_mode(FOCUS_NONE); mirror_x->connect("pressed", this, "_update_transform_buttons", make_binds(mirror_x)); - toolbar->add_child(mirror_x); + tool_hb1->add_child(mirror_x); mirror_y = memnew(ToolButton); mirror_y->set_toggle_mode(true); mirror_y->set_tooltip(TTR("Mirror Y") + " (" + ED_GET_SHORTCUT("tile_map_editor/mirror_y")->get_as_text() + ")"); mirror_y->set_focus_mode(FOCUS_NONE); mirror_y->connect("pressed", this, "_update_transform_buttons", make_binds(mirror_y)); - toolbar->add_child(mirror_y); - - toolbar->add_child(memnew(VSeparator)); + tool_hb1->add_child(mirror_y); rotate_0 = memnew(ToolButton); rotate_0->set_toggle_mode(true); rotate_0->set_tooltip(TTR("Rotate 0 degrees")); rotate_0->set_focus_mode(FOCUS_NONE); rotate_0->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_0)); - toolbar->add_child(rotate_0); + tool_hb2->add_child(rotate_0); rotate_90 = memnew(ToolButton); rotate_90->set_toggle_mode(true); rotate_90->set_tooltip(TTR("Rotate 90 degrees")); rotate_90->set_focus_mode(FOCUS_NONE); rotate_90->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_90)); - toolbar->add_child(rotate_90); + tool_hb2->add_child(rotate_90); rotate_180 = memnew(ToolButton); rotate_180->set_toggle_mode(true); rotate_180->set_tooltip(TTR("Rotate 180 degrees")); rotate_180->set_focus_mode(FOCUS_NONE); rotate_180->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_180)); - toolbar->add_child(rotate_180); + tool_hb2->add_child(rotate_180); rotate_270 = memnew(ToolButton); rotate_270->set_toggle_mode(true); rotate_270->set_tooltip(TTR("Rotate 270 degrees")); rotate_270->set_focus_mode(FOCUS_NONE); rotate_270->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_270)); - toolbar->add_child(rotate_270); - toolbar->hide(); + tool_hb2->add_child(rotate_270); rotate_0->set_pressed(true); } diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 82f17b80d5..b77544befa 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -491,17 +491,8 @@ void ProjectManager::_update_project_buttons() { item->update(); } - bool has_runnable_scene = false; - for (Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) { - const String &selected_main = E->get(); - if (selected_main == "") continue; - has_runnable_scene = true; - break; - } - erase_btn->set_disabled(selected_list.size() < 1); open_btn->set_disabled(selected_list.size() < 1); - run_btn->set_disabled(!has_runnable_scene); } void ProjectManager::_panel_input(const Ref<InputEvent> &p_ev, Node *p_hb) { @@ -573,7 +564,7 @@ void ProjectManager::_unhandled_input(const Ref<InputEvent> &p_ev) { switch (k->get_scancode()) { - case KEY_RETURN: { + case KEY_ENTER: { _open_project(); } break; @@ -969,10 +960,22 @@ void ProjectManager::_run_project_confirm() { for (Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) { const String &selected_main = E->get(); - if (selected_main == "") continue; + if (selected_main == "") { + run_error_diag->set_text(TTR("Can't run project: no main scene defined.\nPlease edit the project and set the main scene in \"Project Settings\" under the \"Application\" category.")); + run_error_diag->popup_centered(); + return; + } + const String &selected = E->key(); String path = EditorSettings::get_singleton()->get("projects/" + selected); + + if (!DirAccess::exists(path + "/.import")) { + run_error_diag->set_text(TTR("Can't run project: Assets need to be imported.\nPlease edit the project to trigger the initial import.")); + run_error_diag->popup_centered(); + return; + } + print_line("OPENING: " + path + " (" + selected + ")"); List<String> args; @@ -1390,6 +1393,10 @@ ProjectManager::ProjectManager() { last_clicked = ""; SceneTree::get_singleton()->connect("files_dropped", this, "_files_dropped"); + + run_error_diag = memnew(AcceptDialog); + gui_base->add_child(run_error_diag); + run_error_diag->set_title(TTR("Can't run project")); } ProjectManager::~ProjectManager() { diff --git a/editor/project_manager.h b/editor/project_manager.h index 27886132c5..181d3cc5d9 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -57,6 +57,7 @@ class ProjectManager : public Control { ConfirmationDialog *multi_open_ask; ConfirmationDialog *multi_run_ask; ConfirmationDialog *multi_scan_ask; + AcceptDialog *run_error_diag; NewProjectDialog *npdialog; ScrollContainer *scroll; VBoxContainer *scroll_childs; diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 6238cad14d..019ed47e81 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -1534,14 +1534,14 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { VBoxContainer *vbc = memnew(VBoxContainer); input_base->add_child(vbc); - vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 5); - vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 5); - vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); - vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 5); + vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 0); + vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0); + vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 0); + vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0); l = memnew(Label); vbc->add_child(l); - l->set_position(Point2(6, 5)); + l->set_position(Point2(6, 5) * EDSCALE); l->set_text(TTR("Action:")); hbc = memnew(HBoxContainer); @@ -1632,6 +1632,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { //translations TabContainer *translations = memnew(TabContainer); + translations->add_style_override("panel", memnew(StyleBoxEmpty)); translations->set_tab_align(TabContainer::ALIGN_LEFT); translations->set_name(TTR("Localization")); tab_container->add_child(translations); @@ -1648,7 +1649,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { Button *addtr = memnew(Button(TTR("Add.."))); addtr->connect("pressed", this, "_translation_file_open"); thb->add_child(addtr); - MarginContainer *tmc = memnew(MarginContainer); + VBoxContainer *tmc = memnew(VBoxContainer); tvb->add_child(tmc); tmc->set_v_size_flags(SIZE_EXPAND_FILL); translation_list = memnew(Tree); @@ -1672,7 +1673,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { Button *addtr = memnew(Button(TTR("Add.."))); addtr->connect("pressed", this, "_translation_res_file_open"); thb->add_child(addtr); - MarginContainer *tmc = memnew(MarginContainer); + VBoxContainer *tmc = memnew(VBoxContainer); tvb->add_child(tmc); tmc->set_v_size_flags(SIZE_EXPAND_FILL); translation_remap = memnew(Tree); @@ -1694,7 +1695,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { addtr->connect("pressed", this, "_translation_res_option_file_open"); translation_res_option_add_button = addtr; thb->add_child(addtr); - tmc = memnew(MarginContainer); + tmc = memnew(VBoxContainer); tvb->add_child(tmc); tmc->set_v_size_flags(SIZE_EXPAND_FILL); translation_remap_options = memnew(Tree); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index ec085ea9f2..438eb2a73f 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -320,7 +320,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: CheckBox *c = checks20[0]; c->set_text("True"); - checks20gc->set_position(Vector2(4, 4)); + checks20gc->set_position(Vector2(4, 4) * EDSCALE); c->set_pressed(v); c->show(); @@ -433,14 +433,14 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: } else if (hint == PROPERTY_HINT_EXP_EASING) { - easing_draw->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5); - easing_draw->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 5); - easing_draw->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 5); - easing_draw->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 30); - type_button->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 3); - type_button->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 3); - type_button->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, 25); - type_button->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 7); + easing_draw->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 5 * EDSCALE); + easing_draw->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 5 * EDSCALE); + easing_draw->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 5 * EDSCALE); + easing_draw->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 30 * EDSCALE); + type_button->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 3 * EDSCALE); + type_button->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 3 * EDSCALE); + type_button->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, 25 * EDSCALE); + type_button->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 7 * EDSCALE); type_button->set_text(TTR("Preset..")); type_button->get_popup()->clear(); type_button->get_popup()->add_item(TTR("Linear"), EASING_LINEAR); @@ -523,7 +523,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: action_buttons[0]->set_anchor(MARGIN_TOP, ANCHOR_END); action_buttons[0]->set_anchor(MARGIN_RIGHT, ANCHOR_END); action_buttons[0]->set_anchor(MARGIN_BOTTOM, ANCHOR_END); - action_buttons[0]->set_begin(Point2(70, button_margin - 5)); + action_buttons[0]->set_begin(Point2(70 * EDSCALE, button_margin - 5 * EDSCALE)); action_buttons[0]->set_end(Point2(margin, margin)); action_buttons[0]->set_text(TTR("Close")); action_buttons[0]->show(); @@ -875,7 +875,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: break; menu->clear(); - menu->set_size(Size2(1, 1)); + menu->set_size(Size2(1, 1) * EDSCALE); if (p_name == "script" && hint_text == "Script" && owner->cast_to<Node>()) { menu->add_icon_item(get_icon("Script", "EditorIcons"), TTR("New Script"), OBJ_MENU_NEW_SCRIPT); @@ -924,7 +924,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: if (!RES(v).is_null()) { - menu->add_icon_item(get_icon("EditResource", "EditorIcons"), "Edit", OBJ_MENU_EDIT); + menu->add_icon_item(get_icon("Edit", "EditorIcons"), "Edit", OBJ_MENU_EDIT); menu->add_icon_item(get_icon("Del", "EditorIcons"), "Clear", OBJ_MENU_CLEAR); menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), "Make Unique", OBJ_MENU_MAKE_UNIQUE); RES r = v; @@ -2384,7 +2384,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String &p p_item->set_text(1, res->get_path().get_file()); } else if (!res->is_class("Texture")) { //texture already previews via itself - EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_resource_preview_done", p_item->get_instance_ID()); + EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_resource_preview_done", p_item->get_instance_id()); } } @@ -3644,7 +3644,7 @@ void PropertyEditor::update_tree() { item->set_text(1, res->get_path().get_file()); } else if (!res->is_class("Texture")) { //texture already previews via itself - EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_resource_preview_done", item->get_instance_ID()); + EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res, this, "_resource_preview_done", item->get_instance_id()); } } @@ -3872,7 +3872,7 @@ void PropertyEditor::_item_edited() { break; if (type == Variant::INT) - _edit_set(name, round(item->get_range(1)), refresh_all); + _edit_set(name, int64_t(round(item->get_range(1))), refresh_all); else _edit_set(name, item->get_range(1), refresh_all); } break; @@ -4600,7 +4600,7 @@ void SectionedPropertyEditor::edit(Object *p_object) { return; } - ObjectID id = p_object->get_instance_ID(); + ObjectID id = p_object->get_instance_id(); if (obj != id) { diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index c6af993676..bd68eac9f2 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -418,7 +418,7 @@ void PropertySelector::select_method_from_script(const Ref<Script> &p_script, co base_type = p_script->get_instance_base_type(); selected = p_current; type = Variant::NIL; - script = p_script->get_instance_ID(); + script = p_script->get_instance_id(); properties = false; instance = NULL; @@ -452,7 +452,7 @@ void PropertySelector::select_method_from_instance(Object *p_instance, const Str { Ref<Script> scr = p_instance->get_script(); if (scr.is_valid()) - script = scr->get_instance_ID(); + script = scr->get_instance_id(); } properties = false; instance = NULL; @@ -485,7 +485,7 @@ void PropertySelector::select_property_from_script(const Ref<Script> &p_script, base_type = p_script->get_instance_base_type(); selected = p_current; type = Variant::NIL; - script = p_script->get_instance_ID(); + script = p_script->get_instance_id(); properties = true; instance = NULL; diff --git a/editor/resources_dock.cpp b/editor/resources_dock.cpp index d3b68d92e4..db3bf6a352 100644 --- a/editor/resources_dock.cpp +++ b/editor/resources_dock.cpp @@ -204,7 +204,7 @@ void ResourcesDock::_update_name(TreeItem *item) { else if (res->get_path() != "" && res->get_path().find("::") == -1) item->set_text(0, res->get_path().get_file()); else - item->set_text(0, res->get_class() + " (" + itos(res->get_instance_ID()) + ")"); + item->set_text(0, res->get_class() + " (" + itos(res->get_instance_id()) + ")"); } void ResourcesDock::remove_resource(const Ref<Resource> &p_resource) { diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 47a9185389..ce3b85332f 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1369,8 +1369,8 @@ void SceneTreeDock::_delete_confirm() { editor_data->get_undo_redo().add_undo_reference(n); ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed, "live_debug_remove_and_keep_node", edited_scene->get_path_to(n), n->get_instance_ID()); - editor_data->get_undo_redo().add_undo_method(sed, "live_debug_restore_node", n->get_instance_ID(), edited_scene->get_path_to(n->get_parent()), n->get_index()); + editor_data->get_undo_redo().add_do_method(sed, "live_debug_remove_and_keep_node", edited_scene->get_path_to(n), n->get_instance_id()); + editor_data->get_undo_redo().add_undo_method(sed, "live_debug_restore_node", n->get_instance_id(), edited_scene->get_path_to(n->get_parent()), n->get_index()); } } editor_data->get_undo_redo().commit_action(); @@ -1824,7 +1824,7 @@ void SceneTreeDock::_add_children_to_popup(Object *p_obj, int p_depth) { int index = menu->get_item_count(); menu->add_icon_item(icon, E->get().name.capitalize(), EDIT_SUBRESOURCE_BASE + subresources.size()); menu->set_item_h_offset(index, p_depth * 10 * EDSCALE); - subresources.push_back(obj->get_instance_ID()); + subresources.push_back(obj->get_instance_id()); _add_children_to_popup(obj, p_depth + 1); } diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index f35e098065..94ef712c25 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -185,19 +185,19 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { if (part_of_subscene) { //item->set_selectable(0,marked_selectable); - item->set_custom_color(0, Color(0.8, 0.4, 0.20)); + item->set_custom_color(0, get_color("error_color", "Editor").linear_interpolate(get_color("warning_color", "Editor"), 0.4)); } else if (marked.has(p_node)) { item->set_selectable(0, marked_selectable); - item->set_custom_color(0, Color(0.8, 0.1, 0.10)); + item->set_custom_color(0, get_color("error_color", "Editor")); } else if (!marked_selectable && !marked_children_selectable) { Node *node = p_node; while (node) { if (marked.has(node)) { item->set_selectable(0, false); - item->set_custom_color(0, Color(0.8, 0.1, 0.10)); + item->set_custom_color(0, get_color("error_color", "Editor")); break; } node = node->get_parent(); @@ -411,9 +411,9 @@ void SceneTreeEditor::_update_tree() { void SceneTreeEditor::_compute_hash(Node *p_node, uint64_t &hash) { - hash = hash_djb2_one_64(p_node->get_instance_ID(), hash); + hash = hash_djb2_one_64(p_node->get_instance_id(), hash); if (p_node->get_parent()) - hash = hash_djb2_one_64(p_node->get_parent()->get_instance_ID(), hash); //so a reparent still produces a different hash + hash = hash_djb2_one_64(p_node->get_parent()->get_instance_id(), hash); //so a reparent still produces a different hash for (int i = 0; i < p_node->get_child_count(); i++) { @@ -625,8 +625,8 @@ void SceneTreeEditor::_renamed() { } else { undo_redo->create_action(TTR("Rename Node")); emit_signal("node_prerename", n, new_name); - undo_redo->add_do_method(this, "_rename_node", n->get_instance_ID(), new_name); - undo_redo->add_undo_method(this, "_rename_node", n->get_instance_ID(), n->get_name()); + undo_redo->add_do_method(this, "_rename_node", n->get_instance_id(), new_name); + undo_redo->add_undo_method(this, "_rename_node", n->get_instance_id(), n->get_name()); undo_redo->commit_action(); } } diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index f4ed430d3d..01cfdc1b57 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -637,7 +637,6 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da } else if (p_msg == "profile_sig") { //cache a signature - print_line("SIG: " + String(Variant(p_data))); profiler_signature[p_data[1]] = p_data[0]; } else if (p_msg == "profile_frame" || p_msg == "profile_total") { @@ -796,8 +795,9 @@ void ScriptEditorDebugger::_performance_draw() { r.position += graph_sb->get_offset(); r.size -= graph_sb->get_minimum_size(); int pi = which[i]; - Color c = Color(0.7, 0.9, 0.5); + Color c = get_color("success_color", "Editor"); c.set_hsv(Math::fmod(c.get_h() + pi * 0.7654, 1), c.get_s(), c.get_v()); + //c = c.linear_interpolate(get_color("base_color", "Editor"), 0.9); c.a = 0.8; perf_draw->draw_string(graph_font, r.position + Point2(0, graph_font->get_ascent()), perf_items[pi]->get_text(0), c, r.size.x); @@ -848,6 +848,8 @@ void ScriptEditorDebugger::_notification(int p_what) { error_stack->connect("item_selected", this, "_error_stack_selected"); vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); + reason->add_color_override("font_color", get_color("error_color", "Editor")); + } break; case NOTIFICATION_PROCESS: { @@ -1595,6 +1597,7 @@ void ScriptEditorDebugger::_bind_methods() { ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { ppeer = Ref<PacketPeerStream>(memnew(PacketPeerStream)); + ppeer->set_input_buffer_max_size(1024 * 1024 * 8); //8mb should be enough editor = p_editor; tabs = memnew(TabContainer); @@ -1615,13 +1618,10 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { HBoxContainer *hbc = memnew(HBoxContainer); vbc->add_child(hbc); - reason = memnew(LineEdit); + reason = memnew(Label); reason->set_text(""); - reason->set_editable(false); hbc->add_child(reason); - reason->add_color_override("font_color", Color(1, 0.4, 0.0, 0.8)); reason->set_h_size_flags(SIZE_EXPAND_FILL); - //reason->set_clip_text(true); hbc->add_child(memnew(VSeparator)); @@ -1647,8 +1647,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { docontinue->set_tooltip(TTR("Continue")); docontinue->connect("pressed", this, "debug_continue"); - //hbc->add_child( memnew( VSeparator) ); - back = memnew(Button); hbc->add_child(back); back->set_tooltip(TTR("Inspect Previous Instance")); @@ -1690,10 +1688,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { breaked = false; tabs->add_child(dbg); - //tabs->move_child(vbc,0); - - hbc = memnew(HBoxContainer); - vbc->add_child(hbc); } { //errors @@ -1821,7 +1815,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { vmem_vb->add_child(vmem_hb); vmem_refresh->connect("pressed", this, "_video_mem_request"); - MarginContainer *vmmc = memnew(MarginContainer); + VBoxContainer *vmmc = memnew(VBoxContainer); vmem_tree = memnew(Tree); vmem_tree->set_v_size_flags(SIZE_EXPAND_FILL); vmem_tree->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index 907c267d49..d255d73167 100644 --- a/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h @@ -89,7 +89,7 @@ class ScriptEditorDebugger : public Control { TabContainer *tabs; - LineEdit *reason; + Label *reason; ScriptEditorDebuggerVariables *variables; Button *step; diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index faf9dee5d0..24be2095ce 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -70,7 +70,7 @@ void EditorSpatialGizmo::redraw() { void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base) { instance = VS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario()); - VS::get_singleton()->instance_attach_object_instance_ID(instance, p_base->get_instance_ID()); + VS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id()); if (skeleton.is_valid()) VS::get_singleton()->instance_attach_skeleton(instance, skeleton); if (extra_margin) @@ -562,13 +562,13 @@ void EditorSpatialGizmo::free() { void EditorSpatialGizmo::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_lines", "lines", "material:Material", "billboard"), &EditorSpatialGizmo::add_lines, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("add_mesh", "mesh:Mesh", "billboard", "skeleton"), &EditorSpatialGizmo::add_mesh, DEFVAL(false), DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("add_lines", "lines", "material", "billboard"), &EditorSpatialGizmo::add_lines, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("add_mesh", "mesh", "billboard", "skeleton"), &EditorSpatialGizmo::add_mesh, DEFVAL(false), DEFVAL(RID())); ClassDB::bind_method(D_METHOD("add_collision_segments", "segments"), &EditorSpatialGizmo::add_collision_segments); - ClassDB::bind_method(D_METHOD("add_collision_triangles", "triangles:TriangleMesh"), &EditorSpatialGizmo::add_collision_triangles); - ClassDB::bind_method(D_METHOD("add_unscaled_billboard", "material:Material", "default_scale"), &EditorSpatialGizmo::add_unscaled_billboard, DEFVAL(1)); + ClassDB::bind_method(D_METHOD("add_collision_triangles", "triangles"), &EditorSpatialGizmo::add_collision_triangles); + ClassDB::bind_method(D_METHOD("add_unscaled_billboard", "material", "default_scale"), &EditorSpatialGizmo::add_unscaled_billboard, DEFVAL(1)); ClassDB::bind_method(D_METHOD("add_handles", "handles", "billboard", "secondary"), &EditorSpatialGizmo::add_handles, DEFVAL(false), DEFVAL(false)); - ClassDB::bind_method(D_METHOD("set_spatial_node", "node:Spatial"), &EditorSpatialGizmo::_set_spatial_node); + ClassDB::bind_method(D_METHOD("set_spatial_node", "node"), &EditorSpatialGizmo::_set_spatial_node); ClassDB::bind_method(D_METHOD("clear"), &EditorSpatialGizmo::clear); BIND_VMETHOD(MethodInfo("redraw")); |