bevy/crates
st0rmbtw 9d804a231e
Make run_if_inner public and rename to run_if_dyn (#9576)
# Objective

Sometimes you want to create a plugin with a custom run condition. In a
function, you take the `Condition` trait and then make a
`BoxedCondition` from it to store it. And then you want to add that
condition to a system, but you can't, because there is only the `run_if`
function available which takes `impl Condition<M>` instead of
`BoxedCondition`. So you have to create a wrapper type for the
`BoxedCondition` and implement the `System` and `ReadOnlySystem` traits
for the wrapper (Like it's done in the picture below). It's very
inconvenient and boilerplate. But there is an easy solution for that:
make the `run_if_inner` system that takes a `BoxedCondition` public.
Also, it makes sense to make `in_set_inner` function public as well with
the same motivation.


![image](https://github.com/bevyengine/bevy/assets/61053971/a4455180-7e0c-4c2b-9372-cd8b4a9e682e)
A chunk of the source code of the `bevy-inspector-egui` crate.

## Solution

Make `run_if_inner` function public.
Rename `run_if_inner` to `run_if_dyn`.

Make `in_set_inner` function public.
Rename `in_set_inner` to `in_set_dyn`.

## Changelog

Changed visibility of `run_if_inner` from `pub(crate)` to `pub`.
Renamed `run_if_inner` to `run_if_dyn`.

Changed visibility of `in_set_inner` from `pub(crate)` to `pub`.
Renamed `in_set_inner` to `in_set_dyn`.

## Migration Guide

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Joseph <21144246+JoJoJet@users.noreply.github.com>
2023-08-27 17:53:37 +00:00
..
bevy_a11y Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_animation Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
bevy_app Add SpawnScene to prelude (#9451) 2023-08-19 19:42:12 +00:00
bevy_asset Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
bevy_audio audio sinks don't need their custom drop anymore (#9336) 2023-08-11 21:16:12 +00:00
bevy_core Remove Resource and add Debug to TaskPoolOptions (#9485) 2023-08-20 22:32:41 +00:00
bevy_core_pipeline Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_derive Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_diagnostic Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_dylib Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_dynamic_plugin Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_ecs Make run_if_inner public and rename to run_if_dyn (#9576) 2023-08-27 17:53:37 +00:00
bevy_ecs_compile_fail_tests Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
bevy_encase_derive Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_gilrs input: allow multiple gamepad inputs to be registered for one button in one frame (#9446) 2023-08-15 21:50:29 +00:00
bevy_gizmos Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_gltf Add support for KHR_materials_emissive_strength (#9553) 2023-08-24 00:17:44 +00:00
bevy_hierarchy Prevent setting parent as itself (#8980) 2023-08-07 23:00:48 +00:00
bevy_input Bevy Input Docs : the modules (#9467) 2023-08-23 12:44:49 +00:00
bevy_internal fix clippy::default_constructed_unit_structs and trybuild errors (#9144) 2023-07-13 22:23:04 +00:00
bevy_log Update tracy-client requirement from 0.15 to 0.16 (#9436) 2023-08-15 07:45:21 +00:00
bevy_macro_utils Add some more helpful errors to BevyManifest when it doesn't find Cargo.toml (#9207) 2023-07-19 12:05:04 +00:00
bevy_macros_compile_fail_tests bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_math Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
bevy_mikktspace Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_pbr Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_ptr Put #[repr(transparent)] attr to bevy_ptr types (#9068) 2023-07-14 18:55:15 +00:00
bevy_reflect Make the reflect path parser utf-8-unaware (#9371) 2023-08-25 23:12:25 +00:00
bevy_reflect_compile_fail_tests Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
bevy_render Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_scene Add SceneInstanceReady (#9313) 2023-08-15 19:45:01 +00:00
bevy_sprite Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_tasks elaborate on TaskPool and bevy tasks (#8750) 2023-08-11 21:07:28 +00:00
bevy_text Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_time Add missing documentation to bevy_time (#9428) 2023-08-15 21:48:37 +00:00
bevy_transform Simplify parallel iteration methods (#8854) 2023-07-23 11:09:24 +00:00
bevy_ui Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
bevy_utils change 'collapse_type_name' to retain enum types (#9587) 2023-08-26 14:50:12 +00:00
bevy_window User controlled window visibility (#9355) 2023-08-20 22:42:07 +00:00
bevy_winit Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00