Skip to content

Commit

Permalink
Update to released bevy 0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasEi committed Nov 29, 2024
1 parent 64f9eae commit e50a2ee
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
43 changes: 30 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_kira_audio"
version = "0.21.0-rc.1"
version = "0.21.0"
authors = ["Niklas Eicker <hello@nikl.me>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -22,7 +22,7 @@ wav = ["kira/wav"]
settings_loader = ["dep:ron", "dep:serde", "kira/serde"]

[dependencies]
bevy = { version = "0.15.0-rc.1", default-features = false, features = ["bevy_asset"] }
bevy = { version = "0.15.0", default-features = false, features = ["bevy_asset"] }
anyhow = "1.0"
uuid = { version = "1", features = ["fast-rng"] }
kira = { version = "0.8.7", default-features = false, features = ["cpal"] }
Expand All @@ -32,24 +32,41 @@ parking_lot = "0.12"
thiserror = "1.0"

[dev-dependencies.bevy]
version = "0.15.0-rc.1"
version = "0.15.0"
default-features = false
# default features minus "bevy_audio" and "vorbis"
features = [
"android-game-activity",
"animation",
"bevy_asset",
"bevy_winit",
"bevy_render",
"x11",
"bevy_ui",
"bevy_text",
"bevy_color",
"bevy_core_pipeline",
"bevy_sprite",
"bevy_gilrs",
"bevy_gizmos",
"bevy_gltf",
"bevy_scene",
"bevy_mesh_picking_backend",
"bevy_pbr",
"bevy_picking",
"bevy_render",
"bevy_scene",
"bevy_sprite",
"bevy_sprite_picking_backend",
"bevy_state",
"bevy_text",
"bevy_ui",
"bevy_ui_picking_backend",
"bevy_window",
"bevy_winit",
"custom_cursor",
"default_font",
"hdr",
"multi_threaded",
"png",
"smaa_luts",
"sysinfo_plugin",
"tonemapping_luts",
"ktx2",
"zstd",
"multi_threaded"
"webgl2",
"x11",
]

[[example]]
Expand Down
12 changes: 6 additions & 6 deletions examples/multiple_channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn play_pause_button<T: Component + Default>(
mut channel_state: ResMut<ChannelAudioState<T>>,
time: Res<Time>,
mut last_action: ResMut<LastAction>,
mut interaction_query: Query<(&Interaction, &mut UiImage), With<PlayPauseButton<T>>>,
mut interaction_query: Query<(&Interaction, &mut ImageNode), With<PlayPauseButton<T>>>,
mut play_pause_text: Query<&mut TextSpan, With<PlayPauseButton<T>>>,
) {
let (interaction, mut image) = interaction_query.single_mut();
Expand Down Expand Up @@ -74,7 +74,7 @@ fn stop_button<T: Component + Default>(
time: Res<Time>,
mut last_action: ResMut<LastAction>,
mut channel_state: ResMut<ChannelAudioState<T>>,
mut interaction_query: Query<(&Interaction, &mut UiImage), With<StopButton<T>>>,
mut interaction_query: Query<(&Interaction, &mut ImageNode), With<StopButton<T>>>,
) {
let (interaction, mut image) = interaction_query.single_mut();
image.color = if channel_state.stopped {
Expand Down Expand Up @@ -102,7 +102,7 @@ fn loop_button<T: Component + Default>(
mut last_action: ResMut<LastAction>,
mut channel_state: ResMut<ChannelAudioState<T>>,
audio_handles: Res<AudioHandles>,
mut interaction_query: Query<(&Interaction, &mut UiImage), With<StartLoopButton<T>>>,
mut interaction_query: Query<(&Interaction, &mut ImageNode), With<StartLoopButton<T>>>,
) {
let (interaction, mut image) = interaction_query.single_mut();
image.color = if !channel_state.loop_started {
Expand Down Expand Up @@ -133,7 +133,7 @@ fn play_sound_button<T: Component + Default>(
mut last_action: ResMut<LastAction>,
mut channel_state: ResMut<ChannelAudioState<T>>,
audio_handles: Res<AudioHandles>,
mut interaction_query: Query<(&Interaction, &mut UiImage), With<PlaySoundButton<T>>>,
mut interaction_query: Query<(&Interaction, &mut ImageNode), With<PlaySoundButton<T>>>,
) {
let (interaction, mut image) = interaction_query.single_mut();
image.color = if interaction == &Interaction::Hovered {
Expand All @@ -156,7 +156,7 @@ fn volume_buttons<T: Component + Default>(
time: Res<Time>,
mut last_action: ResMut<LastAction>,
mut channel_state: ResMut<ChannelAudioState<T>>,
mut interaction_query: Query<(&Interaction, &mut UiImage, &ChangeVolumeButton<T>)>,
mut interaction_query: Query<(&Interaction, &mut ImageNode, &ChangeVolumeButton<T>)>,
) {
for (interaction, mut image, volume) in &mut interaction_query {
image.color = if interaction == &Interaction::Hovered {
Expand Down Expand Up @@ -390,7 +390,7 @@ fn spawn_button<T: Component + Clone>(
align_items: AlignItems::Center,
..Default::default()
},
UiImage::default().with_color(color),
ImageNode::default().with_color(color),
Button,
))
.insert(marker.clone())
Expand Down

0 comments on commit e50a2ee

Please sign in to comment.