cleanup
This commit is contained in:
parent
1bd1525eb8
commit
548386ef54
|
@ -184,7 +184,10 @@ pub fn handle_game_event(
|
|||
prefs.save();
|
||||
}
|
||||
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) => {
|
||||
settings.set_noise_cancellation_mode(mode);
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ pub mod prelude {
|
|||
pub use crate::{
|
||||
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::Turn::Toggle;
|
||||
pub use game::{GameEvent, Turn};
|
||||
}
|
||||
|
||||
|
|
16
src/menu.rs
16
src/menu.rs
|
@ -458,14 +458,14 @@ pub fn update_menu(
|
|||
|
||||
match MENUDEF[i].1 {
|
||||
MenuAction::ToggleSound => {
|
||||
let noisecancel =
|
||||
if let Some(noisecancel) =
|
||||
settings.noise_cancellation_modes.get(settings.noise_cancellation_mode)
|
||||
{
|
||||
noisecancel
|
||||
} else {
|
||||
&settings.noise_cancellation_modes[0]
|
||||
};
|
||||
let noisecancel = if let Some(noisecancel) = settings
|
||||
.noise_cancellation_modes
|
||||
.get(settings.noise_cancellation_mode)
|
||||
{
|
||||
noisecancel
|
||||
} else {
|
||||
&settings.noise_cancellation_modes[0]
|
||||
};
|
||||
text.sections[i].value = format!("Noise Cancellation: {noisecancel}\n");
|
||||
}
|
||||
MenuAction::ToggleMusic => {
|
||||
|
|
Loading…
Reference in a new issue