more sound effects

This commit is contained in:
2025-03-27 12:17:47 +08:00
parent 1f6f4ed2ca
commit 82ce62f24a
9 changed files with 25 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
use super::{BackbackSwapEvent, Backpack, BackpackHead};
use crate::{GameState, heads_ui::HeadsImages, loading_assets::UIAssets};
use crate::{GameState, heads_ui::HeadsImages, loading_assets::UIAssets, sounds::PlaySound};
use bevy::prelude::*;
static HEAD_SLOTS: usize = 5;
@@ -270,6 +270,7 @@ fn swap_head_inputs(
let action = *trigger.event();
if action == BackpackAction::OpenClose {
state.open = !state.open;
commands.trigger(PlaySound::Backpack { open: state.open });
}
if !state.open {
@@ -290,6 +291,7 @@ fn swap_head_inputs(
}
if changed {
commands.trigger(PlaySound::Selection);
sync(&backpack, &mut state);
}
}