bevy/crates
Mike 33fdc5f5db
Move schedule name into Schedule (#9600)
# Objective

- Move schedule name into `Schedule` to allow the schedule name to be
used for errors and tracing in Schedule methods
- Fixes #9510

## Solution

- Move label onto `Schedule` and adjust api's on `World` and `Schedule`
to not pass explicit label where it makes sense to.
- add name to errors and tracing.
- `Schedule::new` now takes a label so either add the label or use
`Schedule::default` which uses a default label. `default` is mostly used
in doc examples and tests.

---

## Changelog

- move label onto `Schedule` to improve error message and logging for
schedules.

## Migration Guide

`Schedule::new` and `App::add_schedule`
```rust
// old
let schedule = Schedule::new();
app.add_schedule(MyLabel, schedule);

// new
let schedule = Schedule::new(MyLabel);
app.add_schedule(schedule);
```

if you aren't using a label and are using the schedule struct directly
you can use the default constructor.
```rust
// old
let schedule = Schedule::new();
schedule.run(world);

// new
let schedule = Schedule::default();
schedule.run(world);
```

`Schedules:insert`
```rust
// old
let schedule = Schedule::new();
schedules.insert(MyLabel, schedule);

// new
let schedule = Schedule::new(MyLabel);
schedules.insert(schedule);
```

`World::add_schedule`
```rust
// old
let schedule = Schedule::new();
world.add_schedule(MyLabel, schedule);

// new
let schedule = Schedule::new(MyLabel);
world.add_schedule(schedule);
```
2023-08-28 20:44:48 +00:00
..
bevy_a11y Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_animation check root node for animations (#9407) 2023-08-28 17:06:12 +00:00
bevy_app Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
bevy_asset Fix panic when using .load_folder() with absolute paths (#9490) 2023-08-28 17:23:44 +00:00
bevy_audio Clarify what happens when setting the audio volume (#9480) 2023-08-28 18:21: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 bevy_derive: Fix #[deref] breaking other attributes (#9551) 2023-08-28 17:36:18 +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 Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +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 only take up to the max number of joints (#9351) 2023-08-28 16:58:45 +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: Fix #[deref] breaking other attributes (#9551) 2023-08-28 17:36:18 +00:00
bevy_math Rename Bezier to CubicBezier for clarity (#9554) 2023-08-28 17:37:42 +00:00
bevy_mikktspace Bump Version after Release (#9106) 2023-07-10 21:19:27 +00:00
bevy_pbr only take up to the max number of joints (#9351) 2023-08-28 16:58:45 +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 Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
bevy_scene Replaced EntityMap with HashMap (#9461) 2023-08-28 17:18:16 +00:00
bevy_sprite Improve documentation relating to Frustum and HalfSpace (#9136) 2023-08-28 16:47:25 +00:00
bevy_tasks elaborate on TaskPool and bevy tasks (#8750) 2023-08-11 21:07:28 +00:00
bevy_text Cleanup some bevy_text pipeline.rs (#9111) 2023-08-28 16:46:16 +00:00
bevy_time Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
bevy_transform Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
bevy_ui UI node bundle comment fix (#9404) 2023-08-28 18:55:35 +00:00
bevy_utils Add system.map(...) for transforming the output of a system (#8526) 2023-08-28 16:36:46 +00:00
bevy_window Check cursor position for out of bounds of the window (#8855) 2023-08-28 16:37:44 +00:00
bevy_winit Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00