diff options
-rw-r--r-- | SConstruct | 2 | ||||
-rw-r--r-- | core/string/translation.cpp | 6 | ||||
-rw-r--r-- | editor/create_dialog.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/sub_viewport_preview_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/texture_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shader_compiler_rd.cpp | 8 |
6 files changed, 29 insertions, 10 deletions
diff --git a/SConstruct b/SConstruct index 601b2d6e80..5dec3f2020 100644 --- a/SConstruct +++ b/SConstruct @@ -759,7 +759,7 @@ if "env" in locals(): def print_elapsed_time(): elapsed_time_sec = round(time.time() - time_at_start, 3) time_ms = round((elapsed_time_sec % 1) * 1000) - print(f"[Time elapsed: {time.strftime('%H:%M:%S', time.gmtime(elapsed_time_sec))}.{time_ms:03}]") + print("[Time elapsed: {}.{:03}]".format(time.strftime("%H:%M:%S", time.gmtime(elapsed_time_sec)), time_ms)) atexit.register(print_elapsed_time) diff --git a/core/string/translation.cpp b/core/string/translation.cpp index 153f0190fd..678f8fb207 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -84,6 +84,7 @@ static const char *locale_list[] = { "ast_ES", // Asturian (Spain) "ayc_PE", // Southern Aymara (Peru) "ay_PE", // Aymara (Peru) + "az", // Azerbaijani "az_AZ", // Azerbaijani (Azerbaijan) "be", // Belarusian "be_BY", // Belarusian (Belarus) @@ -240,6 +241,7 @@ static const char *locale_list[] = { "ka_GE", // Georgian (Georgia) "kk_KZ", // Kazakh (Kazakhstan) "kl_GL", // Kalaallisut (Greenland) + "km", // Central Khmer "km_KH", // Central Khmer (Cambodia) "kn_IN", // Kannada (India) "kok_IN", // Konkani (India) @@ -390,6 +392,7 @@ static const char *locale_list[] = { "tr_CY", // Turkish (Cyprus) "tr_TR", // Turkish (Turkey) "ts_ZA", // Tsonga (South Africa) + "tt", // Tatar "tt_RU", // Tatar (Russia) "tzm", // Central Atlas Tamazight "tzm_MA", // Central Atlas Tamazight (Marrocos) @@ -458,6 +461,7 @@ static const char *locale_names[] = { "Asturian (Spain)", "Southern Aymara (Peru)", "Aymara (Peru)", + "Azerbaijani", "Azerbaijani (Azerbaijan)", "Belarusian", "Belarusian (Belarus)", @@ -614,6 +618,7 @@ static const char *locale_names[] = { "Georgian (Georgia)", "Kazakh (Kazakhstan)", "Kalaallisut (Greenland)", + "Central Khmer", "Central Khmer (Cambodia)", "Kannada (India)", "Konkani (India)", @@ -764,6 +769,7 @@ static const char *locale_names[] = { "Turkish (Cyprus)", "Turkish (Turkey)", "Tsonga (South Africa)", + "Tatar", "Tatar (Russia)", "Central Atlas Tamazight", "Central Atlas Tamazight (Marrocos)", diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 3b002961f9..bfbd697409 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -195,7 +195,8 @@ void CreateDialog::_update_search() { select_type(_top_result(candidates, search_text)); } else { favorite->set_disabled(true); - help_bit->set_text(""); + help_bit->set_text(vformat(TTR("No results for \"%s\"."), search_text)); + help_bit->get_rich_text()->set_self_modulate(Color(1, 1, 1, 0.5)); get_ok_button()->set_disabled(true); search_options->deselect_all(); } @@ -393,8 +394,15 @@ void CreateDialog::select_type(const String &p_type) { to_select->select(0); search_options->scroll_to_item(to_select); - if (EditorHelp::get_doc_data()->class_list.has(p_type)) { - help_bit->set_text(DTR(EditorHelp::get_doc_data()->class_list[p_type].brief_description)); + if (EditorHelp::get_doc_data()->class_list.has(p_type) && !DTR(EditorHelp::get_doc_data()->class_list[p_type].brief_description).is_empty()) { + // Display both class name and description, since the help bit may be displayed + // far away from the location (especially if the dialog was resized to be taller). + help_bit->set_text(vformat("[b]%s[/b]: %s", p_type, DTR(EditorHelp::get_doc_data()->class_list[p_type].brief_description))); + help_bit->get_rich_text()->set_self_modulate(Color(1, 1, 1, 1)); + } else { + // Use nested `vformat()` as translators shouldn't interfere with BBCode tags. + help_bit->set_text(vformat(TTR("No description available for %s."), vformat("[b]%s[/b]", p_type))); + help_bit->get_rich_text()->set_self_modulate(Color(1, 1, 1, 0.5)); } favorite->set_disabled(false); diff --git a/editor/plugins/sub_viewport_preview_editor_plugin.cpp b/editor/plugins/sub_viewport_preview_editor_plugin.cpp index 5fd173cae3..75c47bda2e 100644 --- a/editor/plugins/sub_viewport_preview_editor_plugin.cpp +++ b/editor/plugins/sub_viewport_preview_editor_plugin.cpp @@ -38,6 +38,7 @@ void EditorInspectorPluginSubViewportPreview::parse_begin(Object *p_object) { SubViewport *sub_viewport = Object::cast_to<SubViewport>(p_object); TexturePreview *sub_viewport_preview = memnew(TexturePreview(sub_viewport->get_texture(), false)); + // Otherwise `sub_viewport_preview`'s `texture_display` doesn't update properly when `sub_viewport`'s size changes. sub_viewport->connect("size_changed", callable_mp((CanvasItem *)sub_viewport_preview->get_texture_display(), &CanvasItem::update)); add_custom_control(sub_viewport_preview); } diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 6ee652098d..4029d6785c 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -37,10 +37,8 @@ TextureRect *TexturePreview::get_texture_display() { } TexturePreview::TexturePreview(Ref<Texture2D> p_texture, bool p_show_metadata) { - Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme(); - TextureRect *checkerboard = memnew(TextureRect); - checkerboard->set_texture(theme->get_icon("Checkerboard", "EditorIcons")); + checkerboard->set_texture(get_theme_icon("Checkerboard", "EditorIcons")); checkerboard->set_stretch_mode(TextureRect::STRETCH_TILE); checkerboard->set_texture_repeat(CanvasItem::TEXTURE_REPEAT_ENABLED); checkerboard->set_custom_minimum_size(Size2(0.0, 256.0) * EDSCALE); @@ -70,10 +68,10 @@ TexturePreview::TexturePreview(Ref<Texture2D> p_texture, bool p_show_metadata) { metadata_label->add_theme_font_size_override("font_size", 16 * EDSCALE); metadata_label->add_theme_color_override("font_outline_color", Color::named("black")); metadata_label->add_theme_constant_override("outline_size", 2 * EDSCALE); - Ref<Font> metadata_label_font = theme->get_font("expression", "EditorFonts"); + Ref<Font> metadata_label_font = get_theme_font("expression", "EditorFonts"); metadata_label->add_theme_font_override("font", metadata_label_font); - // it's okay that these colors are static since the grid color is static too + // It's okay that these colors are static since the grid color is static too. metadata_label->add_theme_color_override("font_color", Color::named("white")); metadata_label->add_theme_color_override("font_color_shadow", Color::named("black")); diff --git a/servers/rendering/renderer_rd/shader_compiler_rd.cpp b/servers/rendering/renderer_rd/shader_compiler_rd.cpp index b347197289..1dde92d8ff 100644 --- a/servers/rendering/renderer_rd/shader_compiler_rd.cpp +++ b/servers/rendering/renderer_rd/shader_compiler_rd.cpp @@ -1351,7 +1351,13 @@ Error ShaderCompilerRD::compile(RS::ShaderMode p_mode, const String &p_code, Ide if (err != OK) { Vector<String> shader = p_code.split("\n"); for (int i = 0; i < shader.size(); i++) { - print_line(itos(i + 1) + " " + shader[i]); + if (i + 1 == parser.get_error_line()) { + // Mark the error line to be visible without having to look at + // the trace at the end. + print_line(vformat("E%4d-> %s", i + 1, shader[i])); + } else { + print_line(vformat("%5d | %s", i + 1, shader[i])); + } } _err_print_error(nullptr, p_path.utf8().get_data(), parser.get_error_line(), parser.get_error_text().utf8().get_data(), ERR_HANDLER_SHADER); |