Skip to content

Commit 1894a61

Browse files
authored
chore: migrate to some new bevy 0.17 features (#50)
1 parent 86010ba commit 1894a61

File tree

10 files changed

+124
-122
lines changed

10 files changed

+124
-122
lines changed

Cargo.lock

Lines changed: 50 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2024"
55

66
[dependencies]
7-
bevy = { version = "0.17.2", features = ["wayland"] }
7+
bevy = { version = "0.17.2", features = ["wayland", "experimental_bevy_ui_widgets"] }
88
bevy-inspector-egui = "0.34.0"
99
bevy_aseprite_ultra = "0.7.0"
1010
bevy_ecs_tilemap = { version = "0.17.0-rc.1" }

devenv.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1758829446,
6+
"lastModified": 1759527603,
77
"owner": "cachix",
88
"repo": "devenv",
9-
"rev": "babde55e249190decef99c1c90281e0730536443",
9+
"rev": "ce82fad570fd74ac5dfe3ce587ee8b37e918d71f",
1010
"type": "github"
1111
},
1212
"original": {
@@ -40,10 +40,10 @@
4040
]
4141
},
4242
"locked": {
43-
"lastModified": 1758108966,
43+
"lastModified": 1759523803,
4444
"owner": "cachix",
4545
"repo": "git-hooks.nix",
46-
"rev": "54df955a695a84cd47d4a43e08e1feaf90b1fd9b",
46+
"rev": "cfc9f7bb163ad8542029d303e599c0f7eee09835",
4747
"type": "github"
4848
},
4949
"original": {
@@ -74,10 +74,10 @@
7474
},
7575
"nixpkgs": {
7676
"locked": {
77-
"lastModified": 1758690382,
77+
"lastModified": 1759381078,
7878
"owner": "nixos",
7979
"repo": "nixpkgs",
80-
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
80+
"rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee",
8181
"type": "github"
8282
},
8383
"original": {
@@ -105,10 +105,10 @@
105105
]
106106
},
107107
"locked": {
108-
"lastModified": 1758767687,
108+
"lastModified": 1759544920,
109109
"owner": "oxalica",
110110
"repo": "rust-overlay",
111-
"rev": "b8bcc09d4f627f4e325408f6e7a85c3ac31f0eeb",
111+
"rev": "bd3a63bbff2c4cb3cd48e9d49f54c2ccad457f70",
112112
"type": "github"
113113
},
114114
"original": {

src/dev_tools.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use bevy::dev_tools::fps_overlay::FpsOverlayPlugin;
12
use bevy::dev_tools::states::log_transitions;
23
use bevy::input::common_conditions::{input_just_pressed, input_toggle_active};
34
use bevy::prelude::*;
@@ -9,8 +10,11 @@ use crate::screens::Screen;
910
const TOGGLE_KEY: KeyCode = KeyCode::Backquote;
1011

1112
pub fn plugin(app: &mut App) {
12-
app.add_plugins(EguiPlugin::default());
13-
app.add_plugins(WorldInspectorPlugin::new().run_if(input_toggle_active(false, TOGGLE_KEY)));
13+
app.add_plugins((
14+
FpsOverlayPlugin::default(),
15+
EguiPlugin::default(),
16+
WorldInspectorPlugin::new().run_if(input_toggle_active(false, TOGGLE_KEY)),
17+
));
1418

1519
app.add_systems(Update, log_transitions::<Screen>);
1620

src/gameplay/hud/inspect/info.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use bevy::{
2-
ecs::{relationship::RelatedSpawner, spawn::SpawnWith},
3-
prelude::*,
4-
};
1+
use bevy::{prelude::*, ui_widgets::observe};
52

63
use crate::{
74
assets::indexing::IndexMap,
@@ -86,15 +83,18 @@ pub fn open_recipe_menu(
8683
align_items: AlignItems::Center,
8784
..default()
8885
},
89-
Children::spawn(SpawnWith(|parent: &mut RelatedSpawner<ChildOf>| {
90-
parent
91-
.spawn((Text::new("Deselect"), TextColor(Color::BLACK)))
92-
.observe(on_deselect_recipe);
93-
94-
parent
95-
.spawn((Text::new("Close"), TextColor(Color::BLACK)))
96-
.observe(on_close_menu);
97-
})),
86+
children![
87+
(
88+
Text::new("Deselect"),
89+
TextColor(Color::BLACK),
90+
observe(on_deselect_recipe),
91+
),
92+
(
93+
Text::new("Close"),
94+
TextColor(Color::BLACK),
95+
observe(on_close_menu),
96+
)
97+
],
9898
));
9999

100100
let recipe_view_id = commands

src/gameplay/hud/inspect/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub fn plugin(app: &mut App) {
2020
}
2121

2222
#[derive(States, Reflect, Default, Debug, Hash, PartialEq, Eq, Clone, Copy)]
23-
#[states(scoped_entities)]
2423
pub enum InspectionMenuState {
2524
#[default]
2625
Closed,

0 commit comments

Comments
 (0)