Skip to content

Commit 095463c

Browse files
Update Bevy (#245)
* Update Bevy * Fix Rust 1.89 Lints * Reduce the amount of debug info generated in CI * Switch back to cart's branch * Trigger CI
1 parent b81adf1 commit 095463c

File tree

17 files changed

+107
-209
lines changed

17 files changed

+107
-209
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
env:
1212
CARGO_TERM_COLOR: always
13-
RUSTFLAGS: --deny warnings
13+
RUSTFLAGS: --deny warnings -C debuginfo=line-tables-only
1414
RUSTDOCFLAGS: --deny warnings
1515
# This can be any valid Cargo version requirement, but should start with a caret `^` to opt-in to
1616
# SemVer-compatible changes. Please keep this in sync with `book.yaml`.

Cargo.toml

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

2929
[workspace.dependencies]
30-
bevy = { git = "https://github.com/cart/bevy.git", rev = "40e6f12bbad44dfe2566fda2ead83469d53717d0", features = [
30+
bevy = { git = "https://github.com/cart/bevy.git", rev = "05b79c229a070224c007994e5c2be8b67439d7d9", features = [
3131
"wayland",
3232
"experimental_bevy_feathers",
3333
] }
34-
bevy_render = { git = "https://github.com/cart/bevy.git", rev = "40e6f12bbad44dfe2566fda2ead83469d53717d0" }
35-
bevy_derive = { git = "https://github.com/cart/bevy.git", rev = "40e6f12bbad44dfe2566fda2ead83469d53717d0" }
36-
bevy_macro_utils = { git = "https://github.com/cart/bevy.git", rev = "40e6f12bbad44dfe2566fda2ead83469d53717d0" }
34+
bevy_render = { git = "https://github.com/cart/bevy.git", rev = "05b79c229a070224c007994e5c2be8b67439d7d9" }
35+
bevy_derive = { git = "https://github.com/cart/bevy.git", rev = "05b79c229a070224c007994e5c2be8b67439d7d9" }
36+
bevy_macro_utils = { git = "https://github.com/cart/bevy.git", rev = "05b79c229a070224c007994e5c2be8b67439d7d9" }
3737
thiserror = "2.0"
3838
serde = { version = "1", features = ["derive"] }
3939
tracing-test = "0.2.5"

bevy_editor_panes/bevy_2d_viewport/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ fn on_pane_creation(
127127
],
128128
]
129129
})
130-
.insert(Node::default())
131130
.insert(ChildOf(structure.root));
132131

133132
commands

bevy_editor_panes/bevy_3d_viewport/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ fn on_pane_creation(
203203
],
204204
]
205205
})
206-
.insert(Node::default())
207206
.insert(ChildOf(structure.root));
208207

209208
let camera_id = commands

bevy_editor_panes/bevy_asset_browser/src/ui/nodes.rs

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
use atomicow::CowArc;
44
use bevy::{
55
asset::io::{AssetSource, AssetSourceBuilders, AssetSourceId},
6+
feathers::cursor::EntityCursor,
67
prelude::*,
78
window::SystemCursorIcon,
8-
winit::cursor::CursorIcon,
99
};
1010
use bevy_context_menu::{ContextMenu, ContextMenuOption};
1111
use bevy_editor_styles::Theme;
@@ -200,7 +200,7 @@ pub(crate) fn spawn_file_node<'a>(
200200
}
201201

202202
fn spawn_base_node<'a>(commands: &'a mut Commands, theme: &Res<Theme>) -> EntityCommands<'a> {
203-
let mut base_node_ec = commands.spawn((
203+
commands.spawn((
204204
Button,
205205
Node {
206206
margin: UiRect::all(Val::Px(5.0)),
@@ -215,30 +215,6 @@ fn spawn_base_node<'a>(commands: &'a mut Commands, theme: &Res<Theme>) -> Entity
215215
},
216216
ZIndex(1),
217217
theme.general.border_radius,
218-
));
219-
220-
// Hover effect
221-
base_node_ec
222-
.observe(
223-
move |_trigger: On<Pointer<Move>>,
224-
window_query: Query<Entity, With<Window>>,
225-
mut commands: Commands| {
226-
let window = window_query.single().unwrap();
227-
commands
228-
.entity(window)
229-
.insert(CursorIcon::System(SystemCursorIcon::Pointer));
230-
},
231-
)
232-
.observe(
233-
move |_trigger: On<Pointer<Out>>,
234-
window_query: Query<Entity, With<Window>>,
235-
mut commands: Commands| {
236-
let window = window_query.single().unwrap();
237-
commands
238-
.entity(window)
239-
.insert(CursorIcon::System(SystemCursorIcon::Default));
240-
},
241-
);
242-
243-
base_node_ec
218+
EntityCursor::System(SystemCursorIcon::Pointer),
219+
))
244220
}

bevy_editor_panes/bevy_asset_browser/src/ui/top_bar.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bevy::{prelude::*, window::SystemCursorIcon, winit::cursor::CursorIcon};
1+
use bevy::{feathers::cursor::EntityCursor, prelude::*, window::SystemCursorIcon};
22
use bevy_editor_styles::Theme;
33

44
use crate::{AssetBrowserLocation, io};
@@ -130,6 +130,7 @@ fn spawn_path_segment_ui<'a>(
130130
BackgroundColor(PATH_SEGMENT_BACKGROUND_COLOR),
131131
theme.general.border_radius,
132132
segment_type,
133+
EntityCursor::System(SystemCursorIcon::Pointer),
133134
));
134135
segment_ec
135136
.with_children(|parent| {
@@ -178,26 +179,6 @@ fn spawn_path_segment_ui<'a>(
178179
};
179180
commands.run_system_cached(io::task::fetch_directory_content);
180181
},
181-
)
182-
.observe(
183-
move |_trigger: On<Pointer<Move>>,
184-
window_query: Query<Entity, With<Window>>,
185-
mut commands: Commands| {
186-
let window = window_query.single().unwrap();
187-
commands
188-
.entity(window)
189-
.insert(CursorIcon::System(SystemCursorIcon::Pointer));
190-
},
191-
)
192-
.observe(
193-
move |_trigger: On<Pointer<Out>>,
194-
window_query: Query<Entity, With<Window>>,
195-
mut commands: Commands| {
196-
let window = window_query.single().unwrap();
197-
commands
198-
.entity(window)
199-
.insert(CursorIcon::System(SystemCursorIcon::Default));
200-
},
201182
);
202183
segment_ec
203184
}

bevy_editor_panes/bevy_properties_pane/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ fn setup_pane(pane: In<PaneStructure>, mut commands: Commands) {
4343
PropertiesPaneBody
4444
]
4545
})
46-
.insert(Node::default())
4746
.insert(ChildOf(pane.root));
4847
}
4948

@@ -57,7 +56,6 @@ fn update_properties_pane(
5756
commands.entity(pane_body).despawn_children();
5857
commands
5958
.spawn_scene(properties_pane(&selection, world))
60-
.insert(Node::default())
6159
.insert(ChildOf(pane_body));
6260
}
6361
}

bevy_widgets/bevy_context_menu/src/ui.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bevy::{prelude::*, window::SystemCursorIcon, winit::cursor::CursorIcon};
1+
use bevy::{feathers::cursor::EntityCursor, prelude::*, window::SystemCursorIcon};
22
use bevy_editor_styles::Theme;
33

44
use crate::ContextMenu;
@@ -55,6 +55,7 @@ pub(crate) fn spawn_option<'a>(
5555
..default()
5656
},
5757
theme.context_menu.option_border_radius,
58+
EntityCursor::System(SystemCursorIcon::Pointer),
5859
))
5960
.observe(
6061
|trigger: On<Pointer<Over>>,
@@ -68,26 +69,6 @@ pub(crate) fn spawn_option<'a>(
6869
query.get_mut(trigger.target()).unwrap().0 = Color::NONE;
6970
},
7071
)
71-
.observe(
72-
move |_trigger: On<Pointer<Over>>,
73-
window_query: Query<Entity, With<Window>>,
74-
mut commands: Commands| {
75-
let window = window_query.single().unwrap();
76-
commands
77-
.entity(window)
78-
.insert(CursorIcon::System(SystemCursorIcon::Pointer));
79-
},
80-
)
81-
.observe(
82-
|_trigger: On<Pointer<Out>>,
83-
window_query: Query<Entity, With<Window>>,
84-
mut commands: Commands| {
85-
let window = window_query.single().unwrap();
86-
commands
87-
.entity(window)
88-
.insert(CursorIcon::System(SystemCursorIcon::Default));
89-
},
90-
)
9172
.observe(
9273
move |trigger: On<Pointer<Release>>,
9374
mut commands: Commands,

bevy_widgets/bevy_text_editing/src/editable_text_line/input.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ pub fn on_key_input(
8888
// Process modifier key combinations
8989
match &input.key_code {
9090
KeyCode::KeyC => {
91-
if let Some(selected_text) = text_field.get_selected_text() {
92-
if let Err(e) = clipboard.set_text(selected_text) {
93-
warn!("Clipboard error: {}", e);
94-
}
91+
if let Some(selected_text) = text_field.get_selected_text()
92+
&& let Err(e) = clipboard.set_text(selected_text)
93+
{
94+
warn!("Clipboard error: {}", e);
9595
}
9696
}
9797
KeyCode::KeyV => match clipboard.get_text() {
@@ -114,10 +114,10 @@ pub fn on_key_input(
114114
}
115115
},
116116
KeyCode::KeyX => {
117-
if let Some(selected_text) = text_field.get_selected_text() {
118-
if let Err(e) = clipboard.set_text(selected_text) {
119-
warn!("Clipboard error: {}", e);
120-
}
117+
if let Some(selected_text) = text_field.get_selected_text()
118+
&& let Err(e) = clipboard.set_text(selected_text)
119+
{
120+
warn!("Clipboard error: {}", e);
121121
}
122122
if let Some(selected_range) = text_field.selection_range() {
123123
text_change = TextChange::remove_change(selected_range);
@@ -137,10 +137,10 @@ pub fn on_key_input(
137137
// Process regular (non-modifier) key press
138138
match &input.logical_key {
139139
Key::Space => {
140-
if let Some(allowed_chars) = &text_field.allowed_chars {
141-
if !allowed_chars.contains(&' ') {
142-
return;
143-
}
140+
if let Some(allowed_chars) = &text_field.allowed_chars
141+
&& !allowed_chars.contains(&' ')
142+
{
143+
return;
144144
}
145145

146146
if let Some((start, end)) = text_field.selection_range() {
@@ -269,11 +269,11 @@ pub fn update_has_focus(
269269
// Gained focus
270270
commands.entity(entity).insert(HasFocus(true));
271271

272-
if let Ok(mut text_field) = q_editable_texts.get_mut(entity) {
273-
if text_field.cursor_position.is_none() {
274-
text_field.cursor_position = Some(CharPosition(0));
275-
commands.trigger_targets(RenderWidget::show_cursor(), entity);
276-
}
272+
if let Ok(mut text_field) = q_editable_texts.get_mut(entity)
273+
&& text_field.cursor_position.is_none()
274+
{
275+
text_field.cursor_position = Some(CharPosition(0));
276+
commands.trigger_targets(RenderWidget::show_cursor(), entity);
277277
}
278278
}
279279
} else if has_focus.0 {

crates/bevy_editor_settings/src/file_system/de/mod.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,15 @@ pub fn load_preferences(world: &mut World, table: toml::Table, settings_type: Se
241241
.map(|key| key.0.to_string())
242242
.unwrap_or_else(|| enm.reflect_type_ident().unwrap().to_snake_case());
243243

244-
if let Some(table) = table.get(&name).and_then(|v| v.as_table()) {
245-
if let Some(value) = table.get("variant") {
246-
LoadEnum {
247-
enum_info,
248-
enm,
249-
toml_value: value,
250-
}
251-
.load_enum();
244+
if let Some(table) = table.get(&name).and_then(|v| v.as_table())
245+
&& let Some(value) = table.get("variant")
246+
{
247+
LoadEnum {
248+
enum_info,
249+
enm,
250+
toml_value: value,
252251
}
252+
.load_enum();
253253
}
254254
}
255255
}
@@ -274,17 +274,16 @@ pub fn load_preferences(world: &mut World, table: toml::Table, settings_type: Se
274274
tuple_struct.reflect_type_ident().unwrap().to_snake_case()
275275
});
276276

277-
if let Some(table) = table.get(&name).and_then(|v| v.as_table()) {
278-
if let Some(array_value) =
277+
if let Some(table) = table.get(&name).and_then(|v| v.as_table())
278+
&& let Some(array_value) =
279279
table.get("fields").and_then(|v| v.as_array())
280-
{
281-
LoadTupleStruct {
282-
tuple_struct_info,
283-
table: array_value,
284-
tuple_struct,
285-
}
286-
.load_tuple_struct();
280+
{
281+
LoadTupleStruct {
282+
tuple_struct_info,
283+
table: array_value,
284+
tuple_struct,
287285
}
286+
.load_tuple_struct();
288287
}
289288
}
290289
}

0 commit comments

Comments
 (0)