bevy/crates
Doonv ba0f8f996f
Add insert_state to App. (#11043)
# Objective

Fix #10731.

## Solution

Rename `App::add_state<T>(&mut self)` to `init_state`, and add
`App::insert_state<T>(&mut self, state: T)`. I decided on these names
because they are more similar to `init_resource` and `insert_resource`.

I also removed the `States` trait's requirement for `Default`. Instead,
`init_state` requires `FromWorld`.

---

## Changelog

- Renamed `App::add_state` to `init_state`.
- Added `App::insert_state`.
- Removed the `States` trait's requirement for `Default`.

## Migration Guide

- Renamed `App::add_state` to `init_state`.
2023-12-21 14:09:24 +00:00
..
bevy_a11y Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_animation docs: AnimationPlayer::play doesn't have transition_duration arg (#10970) 2023-12-13 18:51:34 +00:00
bevy_app Add insert_state to App. (#11043) 2023-12-21 14:09:24 +00:00
bevy_asset Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
bevy_audio Non-Intrusive refactor of play_queued_audio_system() (#10910) 2023-12-09 14:27:39 +00:00
bevy_core Replace deprecated elements (#10999) 2023-12-16 23:24:49 +00:00
bevy_core_pipeline Introduce AspectRatio struct (#10368) 2023-12-17 02:01:26 +00:00
bevy_derive Reexport winit::platform::android::activity::* in bevy_winit (#11011) 2023-12-19 20:15:03 +00:00
bevy_diagnostic Some doc to bevy_diagnostic (#11020) 2023-12-19 08:16:22 +00:00
bevy_dylib Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_dynamic_plugin Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_ecs Add insert_state to App. (#11043) 2023-12-21 14:09:24 +00:00
bevy_ecs_compile_fail_tests Rename WorldQueryData & WorldQueryFilter to QueryData & QueryFilter (#10779) 2023-12-12 19:45:50 +00:00
bevy_encase_derive Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_gilrs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
bevy_gizmos Rename WorldQueryData & WorldQueryFilter to QueryData & QueryFilter (#10779) 2023-12-12 19:45:50 +00:00
bevy_gltf Update base64 requirement from 0.13.0 to 0.21.5 (#10336) 2023-12-21 00:55:54 +00:00
bevy_hierarchy Simplify equality assertions (#10988) 2023-12-16 23:58:41 +00:00
bevy_input Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
bevy_internal Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
bevy_log Add helper macro's for logging only once (#10808) 2023-12-05 01:56:40 +00:00
bevy_macro_utils Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
bevy_macros_compile_fail_tests Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_math Introduce AspectRatio struct (#10368) 2023-12-17 02:01:26 +00:00
bevy_mikktspace Enable clippy::undocumented_unsafe_blocks warning across the workspace (#10646) 2023-11-21 02:06:24 +00:00
bevy_pbr Introduce AspectRatio struct (#10368) 2023-12-17 02:01:26 +00:00
bevy_ptr Simplify equality assertions (#10988) 2023-12-16 23:58:41 +00:00
bevy_reflect Fix debug printing for dynamic types (#10740) 2023-12-12 19:44:43 +00:00
bevy_reflect_compile_fail_tests Fix nested generics in Reflect derive (#10791) 2023-11-29 01:46:09 +00:00
bevy_render OrthographicProjection.scaling_mode is not just for resize (#11024) 2023-12-19 18:01:53 +00:00
bevy_scene Implement Std traits for SceneInstanceReady (#11003) 2023-12-17 15:39:13 +00:00
bevy_sprite Update AABB when Sprite component changes in calculate_bounds_2d() (#11016) 2023-12-18 20:55:12 +00:00
bevy_tasks Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
bevy_text Replace deprecated elements (#10999) 2023-12-16 23:24:49 +00:00
bevy_time Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
bevy_transform Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
bevy_ui Remove unnecessary parentheses (#10990) 2023-12-16 02:26:18 +00:00
bevy_utils Add SystemTime to bevy_utils (#11054) 2023-12-21 14:05:27 +00:00
bevy_window Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
bevy_winit Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00