This commit is contained in:
yuni 2024-06-17 01:16:53 +02:00
parent 1bd1525eb8
commit 548386ef54
3 changed files with 13 additions and 10 deletions

View file

@ -184,7 +184,10 @@ pub fn handle_game_event(
prefs.save(); prefs.save();
} }
GameEvent::SetSound(cycle) => { GameEvent::SetSound(cycle) => {
match cycle.to_index(settings.noise_cancellation_mode, &settings.noise_cancellation_modes) { match cycle.to_index(
settings.noise_cancellation_mode,
&settings.noise_cancellation_modes,
) {
Some(mode) => { Some(mode) => {
settings.set_noise_cancellation_mode(mode); settings.set_noise_cancellation_mode(mode);
} }

View file

@ -34,8 +34,8 @@ pub mod prelude {
pub use crate::{ pub use crate::{
actor, audio, camera, chat, cmd, common, game, hud, load, menu, nature, var, visual, world, actor, audio, camera, chat, cmd, common, game, hud, load, menu, nature, var, visual, world,
}; };
pub use game::Turn::Toggle;
pub use game::Cycle::Next; pub use game::Cycle::Next;
pub use game::Turn::Toggle;
pub use game::{GameEvent, Turn}; pub use game::{GameEvent, Turn};
} }

View file

@ -458,14 +458,14 @@ pub fn update_menu(
match MENUDEF[i].1 { match MENUDEF[i].1 {
MenuAction::ToggleSound => { MenuAction::ToggleSound => {
let noisecancel = let noisecancel = if let Some(noisecancel) = settings
if let Some(noisecancel) = .noise_cancellation_modes
settings.noise_cancellation_modes.get(settings.noise_cancellation_mode) .get(settings.noise_cancellation_mode)
{ {
noisecancel noisecancel
} else { } else {
&settings.noise_cancellation_modes[0] &settings.noise_cancellation_modes[0]
}; };
text.sections[i].value = format!("Noise Cancellation: {noisecancel}\n"); text.sections[i].value = format!("Noise Cancellation: {noisecancel}\n");
} }
MenuAction::ToggleMusic => { MenuAction::ToggleMusic => {