Skip to content

Commit 4894f0e

Browse files
authored
Update bevy version (#176)
* update bevy version * remove unused * more fixes * yeet example changes
1 parent 872d170 commit 4894f0e

File tree

12 files changed

+35
-36
lines changed

12 files changed

+35
-36
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ unsafe_op_in_unsafe_fn = "warn"
2727
unused_qualifications = "warn"
2828

2929
[workspace.dependencies]
30-
bevy = { git = "https://github.com/bevyengine/bevy.git", rev = "85eceb022da0326b47ac2b0d9202c9c9f01835bb", features = [
30+
bevy = { git = "https://github.com/bevyengine/bevy.git", rev = "909b02e9de418fcf3b8960e98c3de423505eadd5", features = [
3131
"wayland",
3232
] }
33-
bevy_derive = { git = "https://github.com/bevyengine/bevy.git", rev = "85eceb022da0326b47ac2b0d9202c9c9f01835bb" }
34-
bevy_macro_utils = { git = "https://github.com/bevyengine/bevy.git", rev = "85eceb022da0326b47ac2b0d9202c9c9f01835bb" }
33+
bevy_derive = { git = "https://github.com/bevyengine/bevy.git", rev = "909b02e9de418fcf3b8960e98c3de423505eadd5" }
34+
bevy_macro_utils = { git = "https://github.com/bevyengine/bevy.git", rev = "909b02e9de418fcf3b8960e98c3de423505eadd5" }
3535
thiserror = "1"
3636
serde = { version = "1", features = ["derive"] }
3737
tracing-test = "0.2.5"

bevy_widgets/bevy_field_forms/examples/nickname.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This example demonstrates how to use the `ValidatedInputFieldPlugin` to create a validated input field for a character name.
22
3-
use bevy::{prelude::*, utils::HashSet};
3+
use bevy::{platform_support::collections::HashSet, prelude::*};
44
use bevy_field_forms::{
55
input_field::{InputField, InputFieldPlugin, Validable, ValidationChanged, ValidationState},
66
validate_highlight::SimpleBorderHighlight,

bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/hierarchy.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use core::marker::PhantomData;
22

33
use bevy::ecs::{
4-
component::{ComponentHooks, ComponentId, Immutable, StorageType},
4+
component::{ComponentHooks, HookContext, Immutable, StorageType},
55
prelude::*,
66
world::DeferredWorld,
77
};
@@ -51,14 +51,10 @@ impl<B: Bundle> Component for WithChild<B> {
5151
/// A hook that runs whenever [`WithChild`] is added to an entity.
5252
///
5353
/// Generates a [`WithChildCommand`].
54-
fn with_child_hook<B: Bundle>(
55-
mut world: DeferredWorld<'_>,
56-
entity: Entity,
57-
_component_id: ComponentId,
58-
) {
54+
fn with_child_hook<B: Bundle>(mut world: DeferredWorld<'_>, context: HookContext) {
5955
// Component hooks can't perform structural changes, so we need to rely on commands.
6056
world.commands().queue(WithChildCommand {
61-
parent_entity: entity,
57+
parent_entity: context.entity,
6258
_phantom: PhantomData::<B>,
6359
});
6460
}
@@ -160,12 +156,11 @@ impl<B: Bundle, I: IntoIterator<Item = B> + Send + Sync + 'static> Component
160156
/// Generates a [`WithChildrenCommand`].
161157
fn with_children_hook<B: Bundle, I: IntoIterator<Item = B> + Send + Sync + 'static>(
162158
mut world: DeferredWorld<'_>,
163-
entity: Entity,
164-
_component_id: ComponentId,
159+
context: HookContext,
165160
) {
166161
// Component hooks can't perform structural changes, so we need to rely on commands.
167162
world.commands().queue(WithChildrenCommand {
168-
parent_entity: entity,
163+
parent_entity: context.entity,
169164
_phantom: PhantomData::<(B, I)>,
170165
});
171166
}

bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/maybe.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use core::marker::PhantomData;
22

33
use bevy::ecs::{
4-
component::{ComponentHooks, ComponentId, Immutable, StorageType},
4+
component::{ComponentHooks, HookContext, Immutable, StorageType},
55
prelude::*,
66
world::DeferredWorld,
77
};
@@ -90,10 +90,10 @@ impl<B: Bundle> Default for Maybe<B> {
9090
/// A hook that runs whenever [`Maybe`] is added to an entity.
9191
///
9292
/// Generates a [`MaybeCommand`].
93-
fn maybe_hook<B: Bundle>(mut world: DeferredWorld<'_>, entity: Entity, _component_id: ComponentId) {
93+
fn maybe_hook<B: Bundle>(mut world: DeferredWorld<'_>, context: HookContext) {
9494
// Component hooks can't perform structural changes, so we need to rely on commands.
9595
world.commands().queue(MaybeCommand {
96-
entity,
96+
entity: context.entity,
9797
_phantom: PhantomData::<B>,
9898
});
9999
}

bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/template.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::collections::{HashMap, HashSet};
22
use std::mem;
33

4+
use bevy::ecs::component::HookContext;
45
use bevy::ecs::{
56
component::ComponentId, prelude::*, system::IntoObserverSystem, world::DeferredWorld,
67
};
@@ -258,23 +259,23 @@ impl From<Observer> for Callback {
258259
}
259260
}
260261

261-
fn insert_callback(mut world: DeferredWorld, entity_id: Entity, _component: ComponentId) {
262-
let mut callback = world.get_mut::<Callback>(entity_id).unwrap();
262+
fn insert_callback(mut world: DeferredWorld, context: HookContext) {
263+
let mut callback = world.get_mut::<Callback>(context.entity).unwrap();
263264
let Some(mut observer) = mem::take(&mut callback.observer) else {
264265
return;
265266
};
266-
if let Some(parent_id) = world.get::<ChildOf>(entity_id).map(ChildOf::get) {
267+
if let Some(parent_id) = world.get::<ChildOf>(context.entity).map(ChildOf::get) {
267268
observer.watch_entity(parent_id);
268269
}
269270
let mut commands = world.commands();
270-
let mut entity_commands = commands.entity(entity_id);
271+
let mut entity_commands = commands.entity(context.entity);
271272
entity_commands.remove::<Observer>();
272273
entity_commands.insert(observer);
273274
}
274275

275-
fn remove_callback(mut world: DeferredWorld, entity_id: Entity, _component: ComponentId) {
276+
fn remove_callback(mut world: DeferredWorld, context: HookContext) {
276277
let mut commands = world.commands();
277-
commands.entity(entity_id).remove::<Observer>();
278+
commands.entity(context.entity).remove::<Observer>();
278279
}
279280

280281
// -----------------------------------------------------------------------------

bevy_widgets/bevy_text_editing/src/editable_text_line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
mod input;
44
mod render;
55

6-
use bevy::{prelude::*, utils::HashSet};
6+
use bevy::{platform_support::collections::HashSet, prelude::*};
77
use bevy_clipboard::ClipboardPlugin;
88
use bevy_focus::{FocusPlugin, Focusable, SetFocus};
99

crates/bevy_bsn/src/construct_impls.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,20 @@ impl Component for ConstructTextFont {
183183
type Mutability = Immutable;
184184

185185
fn register_component_hooks(hooks: &mut ComponentHooks) {
186-
hooks.on_insert(|mut world, entity, _component_id| {
187-
let constructable = world.get::<ConstructTextFont>(entity).unwrap().clone();
188-
world.commands().entity(entity).insert(TextFont {
186+
hooks.on_insert(|mut world, context| {
187+
let constructable = world
188+
.get::<ConstructTextFont>(context.entity)
189+
.unwrap()
190+
.clone();
191+
world.commands().entity(context.entity).insert(TextFont {
189192
font: constructable.font.into(),
190193
font_size: constructable.font_size,
191194
font_smoothing: constructable.font_smoothing,
192195
line_height: constructable.line_height,
193196
});
194197
});
195-
hooks.on_remove(|mut world, entity, _component_id| {
196-
if let Some(mut entity) = world.commands().get_entity(entity) {
198+
hooks.on_remove(|mut world, context| {
199+
if let Some(mut entity) = world.commands().get_entity(context.entity) {
197200
entity.remove::<TextFont>();
198201
}
199202
});

crates/bevy_editor_cam/src/extensions/dolly_zoom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use std::time::Duration;
88
use bevy::app::prelude::*;
99
use bevy::ecs::prelude::*;
1010
use bevy::math::prelude::*;
11+
use bevy::platform_support::collections::HashMap;
1112
use bevy::platform_support::time::Instant;
1213
use bevy::reflect::prelude::*;
1314
use bevy::render::{camera::ScalingMode, prelude::*};
1415
use bevy::transform::prelude::*;
15-
use bevy::utils::HashMap;
1616
use bevy::window::RequestRedraw;
1717

1818
use crate::prelude::{motion::CurrentMotion, EditorCam, EnabledMotion};

crates/bevy_editor_cam/src/extensions/look_to.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use std::{f32::consts::PI, time::Duration};
66
use bevy::app::prelude::*;
77
use bevy::ecs::prelude::*;
88
use bevy::math::{prelude::*, DQuat, DVec3};
9+
use bevy::platform_support::collections::HashMap;
910
use bevy::platform_support::time::Instant;
1011
use bevy::reflect::prelude::*;
1112
use bevy::transform::prelude::*;
12-
use bevy::utils::HashMap;
1313
use bevy::window::RequestRedraw;
1414

1515
use crate::prelude::*;

crates/bevy_editor_cam/src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use bevy::input::{
55
prelude::*,
66
};
77
use bevy::math::{prelude::*, DVec2, DVec3};
8+
use bevy::platform_support::collections::HashMap;
89
use bevy::reflect::prelude::*;
910
use bevy::render::{camera::CameraProjection, prelude::*};
1011
use bevy::transform::prelude::*;
11-
use bevy::utils::hashbrown::HashMap;
1212
use bevy::window::PrimaryWindow;
1313
use bevy::{app::prelude::*, picking::pointer::PointerInput};
1414
use bevy::{ecs::prelude::*, picking::pointer::PointerAction};

0 commit comments

Comments
 (0)