diff options
-rw-r--r-- | core/core_bind.cpp | 11 | ||||
-rw-r--r-- | core/core_bind.h | 3 | ||||
-rw-r--r-- | core/os/os.h | 3 | ||||
-rw-r--r-- | doc/classes/CollisionObject3D.xml | 6 | ||||
-rw-r--r-- | doc/classes/ConvexPolygonShape3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/OS.xml | 12 | ||||
-rw-r--r-- | doc/classes/PhysicsServer3DManager.xml | 2 | ||||
-rw-r--r-- | doc/classes/RichTextLabel.xml | 1 | ||||
-rw-r--r-- | doc/classes/Skeleton2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/SkeletonModification2D.xml | 2 | ||||
-rw-r--r-- | drivers/gles3/storage/texture_storage.cpp | 15 | ||||
-rw-r--r-- | drivers/unix/os_unix.cpp | 19 | ||||
-rw-r--r-- | drivers/unix/os_unix.h | 4 | ||||
-rw-r--r-- | editor/connections_dialog.cpp | 1 | ||||
-rw-r--r-- | editor/editor_toaster.cpp | 49 | ||||
-rw-r--r-- | editor/editor_toaster.h | 2 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 1 | ||||
-rw-r--r-- | editor/import/scene_import_settings.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 29 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.h | 1 | ||||
-rw-r--r-- | main/main.cpp | 3 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 13 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 3 |
23 files changed, 147 insertions, 43 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index ab433bd8f1..96e1da9dde 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -322,8 +322,12 @@ String OS::get_environment(const String &p_var) const { return ::OS::get_singleton()->get_environment(p_var); } -bool OS::set_environment(const String &p_var, const String &p_value) const { - return ::OS::get_singleton()->set_environment(p_var, p_value); +void OS::set_environment(const String &p_var, const String &p_value) const { + ::OS::get_singleton()->set_environment(p_var, p_value); +} + +void OS::unset_environment(const String &p_var) const { + ::OS::get_singleton()->unset_environment(p_var); } String OS::get_name() const { @@ -548,9 +552,10 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("is_process_running", "pid"), &OS::is_process_running); ClassDB::bind_method(D_METHOD("get_process_id"), &OS::get_process_id); + ClassDB::bind_method(D_METHOD("has_environment", "variable"), &OS::has_environment); ClassDB::bind_method(D_METHOD("get_environment", "variable"), &OS::get_environment); ClassDB::bind_method(D_METHOD("set_environment", "variable", "value"), &OS::set_environment); - ClassDB::bind_method(D_METHOD("has_environment", "variable"), &OS::has_environment); + ClassDB::bind_method(D_METHOD("unset_environment", "variable"), &OS::unset_environment); ClassDB::bind_method(D_METHOD("get_name"), &OS::get_name); ClassDB::bind_method(D_METHOD("get_distribution_name"), &OS::get_distribution_name); diff --git a/core/core_bind.h b/core/core_bind.h index 7ef346d1c4..c0c87fd009 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -162,7 +162,8 @@ public: bool has_environment(const String &p_var) const; String get_environment(const String &p_var) const; - bool set_environment(const String &p_var, const String &p_value) const; + void set_environment(const String &p_var, const String &p_value) const; + void unset_environment(const String &p_var) const; String get_name() const; String get_distribution_name() const; diff --git a/core/os/os.h b/core/os/os.h index b80efa47b7..4818e9281a 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -167,7 +167,8 @@ public: virtual bool has_environment(const String &p_var) const = 0; virtual String get_environment(const String &p_var) const = 0; - virtual bool set_environment(const String &p_var, const String &p_value) const = 0; + virtual void set_environment(const String &p_var, const String &p_value) const = 0; + virtual void unset_environment(const String &p_var) const = 0; virtual String get_name() const = 0; virtual String get_distribution_name() const = 0; diff --git a/doc/classes/CollisionObject3D.xml b/doc/classes/CollisionObject3D.xml index c302963b92..31b5842930 100644 --- a/doc/classes/CollisionObject3D.xml +++ b/doc/classes/CollisionObject3D.xml @@ -216,13 +216,13 @@ <signal name="mouse_entered"> <description> Emitted when the mouse pointer enters any of this object's shapes. Requires [member input_ray_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set. - [b]Note:[/b] Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [CollisionObject2D]'s area is small. This signal may also not be emitted if another [CollisionObject2D] is overlapping the [CollisionObject2D] in question. + [b]Note:[/b] Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [CollisionObject3D]'s area is small. This signal may also not be emitted if another [CollisionObject3D] is overlapping the [CollisionObject3D] in question. </description> </signal> <signal name="mouse_exited"> <description> Emitted when the mouse pointer exits all this object's shapes. Requires [member input_ray_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set. - [b]Note:[/b] Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [CollisionObject2D]'s area is small. This signal may also not be emitted if another [CollisionObject2D] is overlapping the [CollisionObject2D] in question. + [b]Note:[/b] Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [CollisionObject3D]'s area is small. This signal may also not be emitted if another [CollisionObject3D] is overlapping the [CollisionObject3D] in question. </description> </signal> </signals> @@ -232,7 +232,7 @@ Automatically re-added to the physics simulation when the [Node] is processed again. </constant> <constant name="DISABLE_MODE_MAKE_STATIC" value="1" enum="DisableMode"> - When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], make the body static. Doesn't affect [Area2D]. [PhysicsBody3D] can't be affected by forces or other bodies while static. + When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], make the body static. Doesn't affect [Area3D]. [PhysicsBody3D] can't be affected by forces or other bodies while static. Automatically set [PhysicsBody3D] back to its original mode when the [Node] is processed again. </constant> <constant name="DISABLE_MODE_KEEP_ACTIVE" value="2" enum="DisableMode"> diff --git a/doc/classes/ConvexPolygonShape3D.xml b/doc/classes/ConvexPolygonShape3D.xml index 32dc8f673b..66d2280280 100644 --- a/doc/classes/ConvexPolygonShape3D.xml +++ b/doc/classes/ConvexPolygonShape3D.xml @@ -4,7 +4,7 @@ Convex polygon shape resource for 3D physics. </brief_description> <description> - 3D convex polygon shape resource to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. Unlike [ConcavePolygonShape3D], [ConvexPolygonShape3D] cannot store concave polygon shapes. [ConvexPolygonShape2D]s can be manually drawn in the editor using the [CollisionPolygon3D] node. + 3D convex polygon shape resource to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. Unlike [ConcavePolygonShape3D], [ConvexPolygonShape3D] cannot store concave polygon shapes. [ConvexPolygonShape3D]s can be manually drawn in the editor using the [CollisionPolygon3D] node. [b]Convex decomposition:[/b] Concave objects' collisions can be represented accurately using [i]several[/i] [ConvexPolygonShape3D]s. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). This is available in the editor by selecting the [MeshInstance3D], going to the [b]Mesh[/b] menu and choosing [b]Create Multiple Convex Collision Siblings[/b]. Alternatively, [method MeshInstance3D.create_multiple_convex_collisions] can be called in a script to perform this decomposition at run-time. [b]Performance:[/b] [ConvexPolygonShape3D] is faster to check collisions against compared to [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] or [BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by a primitive shape. </description> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 6dab7b4ebe..1bc81ffb42 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -592,12 +592,12 @@ </description> </method> <method name="set_environment" qualifiers="const"> - <return type="bool" /> + <return type="void" /> <param index="0" name="variable" type="String" /> <param index="1" name="value" type="String" /> <description> Sets the value of the environment variable [param variable] to [param value]. The environment variable will be set for the Godot process and any process executed with [method execute] after running [method set_environment]. The environment variable will [i]not[/i] persist to processes run after the Godot process was terminated. - [b]Note:[/b] Double-check the casing of [param variable]. Environment variable names are case-sensitive on all platforms except Windows. + [b]Note:[/b] Environment variable names are case-sensitive on all platforms except Windows. The [param variable] name cannot be empty or include the [code]=[/code] character. On Windows, there is a 32767 characters limit for the combined length of [param variable], [param value], and the [code]=[/code] and null terminator characters that will be registered in the environment block. </description> </method> <method name="set_restart_on_exit"> @@ -637,6 +637,14 @@ [b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS and Windows. </description> </method> + <method name="unset_environment" qualifiers="const"> + <return type="void" /> + <param index="0" name="variable" type="String" /> + <description> + Removes the environment [param variable] from the current environment, if it exists. The environment variable will be removed for the Godot process and any process executed with [method execute] after running [method unset_environment]. The removal of the environment variable will [i]not[/i] persist to processes run after the Godot process was terminated. + [b]Note:[/b] Environment variable names are case-sensitive on all platforms except Windows. The [param variable] name cannot be empty or include the [code]=[/code] character. + </description> + </method> </methods> <members> <member name="low_processor_usage_mode" type="bool" setter="set_low_processor_usage_mode" getter="is_in_low_processor_usage_mode" default="false"> diff --git a/doc/classes/PhysicsServer3DManager.xml b/doc/classes/PhysicsServer3DManager.xml index 3ec03fede4..4d789ceb3f 100644 --- a/doc/classes/PhysicsServer3DManager.xml +++ b/doc/classes/PhysicsServer3DManager.xml @@ -15,7 +15,7 @@ <param index="0" name="name" type="String" /> <param index="1" name="create_callback" type="Callable" /> <description> - Register a [PhysicsServer3D] implementation by passing a [param name] and a [Callable] that returns a [PhysicsServer2D] object. + Register a [PhysicsServer3D] implementation by passing a [param name] and a [Callable] that returns a [PhysicsServer3D] object. </description> </method> <method name="set_default_server"> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index dd291a425d..5550bf0955 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -283,6 +283,7 @@ <return type="void" /> <param index="0" name="font_size" type="int" /> <description> + Adds a [code][font_size][/code] tag to the tag stack. Overrides default font size for its duration. </description> </method> <method name="push_hint"> diff --git a/doc/classes/Skeleton2D.xml b/doc/classes/Skeleton2D.xml index 808f93b491..39bdc5c796 100644 --- a/doc/classes/Skeleton2D.xml +++ b/doc/classes/Skeleton2D.xml @@ -16,7 +16,7 @@ <param index="0" name="delta" type="float" /> <param index="1" name="execution_mode" type="int" /> <description> - Executes all the modifications on the [SkeletonModificationStack2D], if the Skeleton3D has one assigned. + Executes all the modifications on the [SkeletonModificationStack2D], if the Skeleton2D has one assigned. </description> </method> <method name="get_bone"> diff --git a/doc/classes/SkeletonModification2D.xml b/doc/classes/SkeletonModification2D.xml index 77aaf0213b..3a78f13bff 100644 --- a/doc/classes/SkeletonModification2D.xml +++ b/doc/classes/SkeletonModification2D.xml @@ -56,7 +56,7 @@ <method name="get_modification_stack"> <return type="SkeletonModificationStack2D" /> <description> - Returns the [SkeletonModificationStack2D] that this modification is bound to. Through the modification stack, you can access the Skeleton3D the modification is operating on. + Returns the [SkeletonModificationStack2D] that this modification is bound to. Through the modification stack, you can access the Skeleton2D the modification is operating on. </description> </method> <method name="set_editor_draw_gizmo"> diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index 489c328f64..8818ab2118 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -567,23 +567,29 @@ Ref<Image> TextureStorage::_get_gl_image_and_format(const Ref<Image> &p_image, I } } break; case Image::FORMAT_ETC2_RA_AS_RG: { +#ifndef WEB_ENABLED if (config->etc2_supported) { r_gl_internal_format = _EXT_COMPRESSED_RGBA8_ETC2_EAC; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - } else { + } else +#endif + { need_decompress = true; } decompress_ra_to_rg = true; } break; case Image::FORMAT_DXT5_RA_AS_RG: { +#ifndef WEB_ENABLED if (config->s3tc_supported) { r_gl_internal_format = _EXT_COMPRESSED_RGBA_S3TC_DXT5_EXT; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; - } else { + } else +#endif + { need_decompress = true; } decompress_ra_to_rg = true; @@ -1137,6 +1143,7 @@ void TextureStorage::texture_set_data(RID p_texture, const Ref<Image> &p_image, texture->gl_set_filter(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST); texture->gl_set_repeat(RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); +#ifndef WEB_ENABLED switch (texture->format) { #ifdef GLES_OVER_GL case Image::FORMAT_L8: { @@ -1151,7 +1158,8 @@ void TextureStorage::texture_set_data(RID p_texture, const Ref<Image> &p_image, glTexParameteri(texture->target, GL_TEXTURE_SWIZZLE_B, GL_RED); glTexParameteri(texture->target, GL_TEXTURE_SWIZZLE_A, GL_GREEN); } break; -#endif +#endif // GLES3_OVER_GL + case Image::FORMAT_ETC2_RA_AS_RG: case Image::FORMAT_DXT5_RA_AS_RG: { glTexParameteri(texture->target, GL_TEXTURE_SWIZZLE_R, GL_RED); @@ -1172,6 +1180,7 @@ void TextureStorage::texture_set_data(RID p_texture, const Ref<Image> &p_image, glTexParameteri(texture->target, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); } break; } +#endif // WEB_ENABLED int mipmaps = img->has_mipmaps() ? img->get_mipmap_count() + 1 : 1; diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index c37b3d9c87..178f01b185 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -411,10 +411,6 @@ bool OS_Unix::is_process_running(const ProcessID &p_pid) const { return true; } -bool OS_Unix::has_environment(const String &p_var) const { - return getenv(p_var.utf8().get_data()) != nullptr; -} - String OS_Unix::get_locale() const { if (!has_environment("LANG")) { return "en"; @@ -487,6 +483,10 @@ Error OS_Unix::set_cwd(const String &p_cwd) { return OK; } +bool OS_Unix::has_environment(const String &p_var) const { + return getenv(p_var.utf8().get_data()) != nullptr; +} + String OS_Unix::get_environment(const String &p_var) const { if (getenv(p_var.utf8().get_data())) { return getenv(p_var.utf8().get_data()); @@ -494,8 +494,15 @@ String OS_Unix::get_environment(const String &p_var) const { return ""; } -bool OS_Unix::set_environment(const String &p_var, const String &p_value) const { - return setenv(p_var.utf8().get_data(), p_value.utf8().get_data(), /* overwrite: */ true) == 0; +void OS_Unix::set_environment(const String &p_var, const String &p_value) const { + ERR_FAIL_COND_MSG(p_var.is_empty() || p_var.contains("="), vformat("Invalid environment variable name '%s', cannot be empty or include '='.", p_var)); + int err = setenv(p_var.utf8().get_data(), p_value.utf8().get_data(), /* overwrite: */ 1); + ERR_FAIL_COND_MSG(err != 0, vformat("Failed setting environment variable '%s', the system is out of memory.", p_var)); +} + +void OS_Unix::unset_environment(const String &p_var) const { + ERR_FAIL_COND_MSG(p_var.is_empty() || p_var.contains("="), vformat("Invalid environment variable name '%s', cannot be empty or include '='.", p_var)); + unsetenv(p_var.utf8().get_data()); } String OS_Unix::get_user_data_dir() const { diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index 416311307c..03429622ae 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -81,7 +81,9 @@ public: virtual bool has_environment(const String &p_var) const override; virtual String get_environment(const String &p_var) const override; - virtual bool set_environment(const String &p_var, const String &p_value) const override; + virtual void set_environment(const String &p_var, const String &p_value) const override; + virtual void unset_environment(const String &p_var) const override; + virtual String get_locale() const override; virtual void initialize_debugging() override; diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 03d2a6565a..6f4736dca7 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -1196,6 +1196,7 @@ ConnectionsDock::ConnectionsDock() { tree->set_columns(1); tree->set_select_mode(Tree::SELECT_ROW); tree->set_hide_root(true); + tree->set_column_clip_content(0, true); vbc->add_child(tree); tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); tree->set_allow_rmb_select(true); diff --git a/editor/editor_toaster.cpp b/editor/editor_toaster.cpp index dd5d68a08e..558423df78 100644 --- a/editor/editor_toaster.cpp +++ b/editor/editor_toaster.cpp @@ -90,11 +90,12 @@ void EditorToaster::_notification(int p_what) { } // Hide element if it is not visible anymore. - if (modulate_fade.a <= 0) { - if (element.key->is_visible()) { - element.key->hide(); - needs_update = true; - } + if (modulate_fade.a <= 0 && element.key->is_visible()) { + element.key->hide(); + needs_update = true; + } else if (modulate_fade.a >= 0 && !element.key->is_visible()) { + element.key->show(); + needs_update = true; } } @@ -419,12 +420,21 @@ void EditorToaster::_popup_str(String p_message, Severity p_severity, String p_t // Create a new message if needed. if (control == nullptr) { + HBoxContainer *hb = memnew(HBoxContainer); + hb->add_theme_constant_override("separation", 0); + Label *label = memnew(Label); + hb->add_child(label); - control = popup(label, p_severity, default_message_duration, p_tooltip); + Label *count_label = memnew(Label); + hb->add_child(count_label); + + control = popup(hb, p_severity, default_message_duration, p_tooltip); toasts[control].message = p_message; toasts[control].tooltip = p_tooltip; toasts[control].count = 1; + toasts[control].message_label = label; + toasts[control].message_count_label = count_label; } else { if (toasts[control].popped) { toasts[control].count += 1; @@ -441,14 +451,31 @@ void EditorToaster::_popup_str(String p_message, Severity p_severity, String p_t main_button->queue_redraw(); } - // Retrieve the label back then update the text. - Label *label = Object::cast_to<Label>(control->get_child(0)->get_child(0)); - ERR_FAIL_COND(!label); + // Retrieve the label back, then update the text. + Label *message_label = toasts[control].message_label; + ERR_FAIL_COND(!message_label); + message_label->set_text(p_message); + message_label->set_text_overrun_behavior(TextServer::OVERRUN_NO_TRIMMING); + message_label->set_custom_minimum_size(Size2()); + + Size2i size = message_label->get_combined_minimum_size(); + int limit_width = get_viewport_rect().size.x / 2; // Limit label size to half the viewport size. + if (size.x > limit_width) { + message_label->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS); + message_label->set_custom_minimum_size(Size2(limit_width, 0)); + } + + // Retrieve the count label back, then update the text. + Label *message_count_label = toasts[control].message_count_label; if (toasts[control].count == 1) { - label->set_text(p_message); + message_count_label->hide(); } else { - label->set_text(vformat("%s (%d)", p_message, toasts[control].count)); + message_count_label->set_text(vformat("(%d)", toasts[control].count)); + message_count_label->show(); } + + vbox_container->reset_size(); + is_processing_error = false; } diff --git a/editor/editor_toaster.h b/editor/editor_toaster.h index acd2a8fbf3..6b834f8288 100644 --- a/editor/editor_toaster.h +++ b/editor/editor_toaster.h @@ -79,6 +79,8 @@ private: String message; String tooltip; int count = 0; + Label *message_label = nullptr; + Label *message_count_label = nullptr; }; HashMap<Control *, Toast> toasts; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 17cdab60c8..9db352c3fd 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -3127,6 +3127,7 @@ FileSystemDock::FileSystemDock() { tree->set_allow_rmb_select(true); tree->set_select_mode(Tree::SELECT_MULTI); tree->set_custom_minimum_size(Size2(0, 15 * EDSCALE)); + tree->set_column_clip_content(0, true); split_box->add_child(tree); tree->connect("item_activated", callable_mp(this, &FileSystemDock::_tree_activate_file)); diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp index 60415ff926..044f7475c2 100644 --- a/editor/import/scene_import_settings.cpp +++ b/editor/import/scene_import_settings.cpp @@ -1236,6 +1236,12 @@ SceneImportSettings::SceneImportSettings() { action_menu = memnew(MenuButton); action_menu->set_text(TTR("Actions...")); + // Style the MenuButton like a regular Button to make it more noticeable. + action_menu->set_flat(false); + action_menu->add_theme_style_override("normal", get_theme_stylebox("normal", "Button")); + action_menu->add_theme_style_override("hover", get_theme_stylebox("hover", "Button")); + action_menu->add_theme_style_override("pressed", get_theme_stylebox("pressed", "Button")); + action_menu->set_focus_mode(Control::FOCUS_ALL); menu_hb->add_child(action_menu); action_menu->get_popup()->add_item(TTR("Extract Materials"), ACTION_EXTRACT_MATERIALS); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 9f2cfc8d9c..eab5eb0404 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -705,6 +705,12 @@ const char *EditorAssetLibrary::support_key[SUPPORT_MAX] = { "testing", }; +const char *EditorAssetLibrary::support_text[SUPPORT_MAX] = { + TTRC("Official"), + TTRC("Community"), + TTRC("Testing"), +}; + void EditorAssetLibrary::_select_author(int p_id) { // Open author window. } @@ -1242,15 +1248,28 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const library_vb->add_child(asset_bottom_page); if (result.is_empty()) { + String support_list; + for (int i = 0; i < SUPPORT_MAX; i++) { + if (support->get_popup()->is_item_checked(i)) { + if (!support_list.is_empty()) { + support_list += ", "; + } + support_list += TTRGET(support_text[i]); + } + } + if (support_list.is_empty()) { + support_list = "-"; + } + if (!filter->get_text().is_empty()) { library_info->set_text( - vformat(TTR("No results for \"%s\"."), filter->get_text())); + vformat(TTR("No results for \"%s\" for support level(s): %s."), filter->get_text(), support_list)); } else { // No results, even though the user didn't search for anything specific. // This is typically because the version number changed recently // and no assets compatible with the new version have been published yet. library_info->set_text( - vformat(TTR("No results compatible with %s %s."), String(VERSION_SHORT_NAME).capitalize(), String(VERSION_BRANCH))); + vformat(TTR("No results compatible with %s %s for support level(s): %s.\nCheck the enabled support levels using the 'Support' button in the top-right corner."), String(VERSION_SHORT_NAME).capitalize(), String(VERSION_BRANCH), support_list)); } library_info->show(); } else { @@ -1510,9 +1529,9 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { search_hb2->add_child(support); support->set_text(TTR("Support")); support->get_popup()->set_hide_on_checkable_item_selection(false); - support->get_popup()->add_check_item(TTR("Official"), SUPPORT_OFFICIAL); - support->get_popup()->add_check_item(TTR("Community"), SUPPORT_COMMUNITY); - support->get_popup()->add_check_item(TTR("Testing"), SUPPORT_TESTING); + support->get_popup()->add_check_item(TTRGET(support_text[SUPPORT_OFFICIAL]), SUPPORT_OFFICIAL); + support->get_popup()->add_check_item(TTRGET(support_text[SUPPORT_COMMUNITY]), SUPPORT_COMMUNITY); + support->get_popup()->add_check_item(TTRGET(support_text[SUPPORT_TESTING]), SUPPORT_TESTING); support->get_popup()->set_item_checked(SUPPORT_OFFICIAL, true); support->get_popup()->set_item_checked(SUPPORT_COMMUNITY, true); support->get_popup()->connect("id_pressed", callable_mp(this, &EditorAssetLibrary::_support_toggled)); diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h index 0667f474da..8c74da0e2a 100644 --- a/editor/plugins/asset_library_editor_plugin.h +++ b/editor/plugins/asset_library_editor_plugin.h @@ -234,6 +234,7 @@ class EditorAssetLibrary : public PanelContainer { static const char *sort_key[SORT_MAX]; static const char *sort_text[SORT_MAX]; static const char *support_key[SUPPORT_MAX]; + static const char *support_text[SUPPORT_MAX]; ///MainListing diff --git a/main/main.cpp b/main/main.cpp index 7ba5ffab2a..00c6b1fecd 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -3030,6 +3030,9 @@ bool Main::iteration() { PhysicsServer2D::get_singleton()->flush_queries(); if (OS::get_singleton()->get_main_loop()->physics_process(physics_step * time_scale)) { + PhysicsServer3D::get_singleton()->end_sync(); + PhysicsServer2D::get_singleton()->end_sync(); + exit = true; break; } diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index b3831573cf..130c5f7b97 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1166,8 +1166,17 @@ String OS_Windows::get_environment(const String &p_var) const { return ""; } -bool OS_Windows::set_environment(const String &p_var, const String &p_value) const { - return (bool)SetEnvironmentVariableW((LPCWSTR)(p_var.utf16().get_data()), (LPCWSTR)(p_value.utf16().get_data())); +void OS_Windows::set_environment(const String &p_var, const String &p_value) const { + ERR_FAIL_COND_MSG(p_var.is_empty() || p_var.contains("="), vformat("Invalid environment variable name '%s', cannot be empty or include '='.", p_var)); + Char16String var = p_var.utf16(); + Char16String value = p_value.utf16(); + ERR_FAIL_COND_MSG(var.length() + value.length() + 2 > 32767, vformat("Invalid definition for environment variable '%s', cannot exceed 32767 characters.", p_var)); + SetEnvironmentVariableW((LPCWSTR)(var.get_data()), (LPCWSTR)(value.get_data())); +} + +void OS_Windows::unset_environment(const String &p_var) const { + ERR_FAIL_COND_MSG(p_var.is_empty() || p_var.contains("="), vformat("Invalid environment variable name '%s', cannot be empty or include '='.", p_var)); + SetEnvironmentVariableW((LPCWSTR)(p_var.utf16().get_data()), nullptr); // Null to delete. } String OS_Windows::get_stdin_string() { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index c33e0f6740..05110c2614 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -186,7 +186,8 @@ public: virtual bool has_environment(const String &p_var) const override; virtual String get_environment(const String &p_var) const override; - virtual bool set_environment(const String &p_var, const String &p_value) const override; + virtual void set_environment(const String &p_var, const String &p_value) const override; + virtual void unset_environment(const String &p_var) const override; virtual Vector<String> get_system_fonts() const override; virtual String get_system_font_path(const String &p_font_name, int p_weight = 400, int p_stretch = 100, bool p_italic = false) const override; |