fix factory reset (light amp and flashlight power)
This commit is contained in:
parent
fa504097bb
commit
06f23bf7ac
|
@ -803,7 +803,7 @@ pub fn handle_input(
|
|||
MenuAction::ResetSettings => {
|
||||
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::PowerDown));
|
||||
*settings = Settings::default();
|
||||
*prefs = Preferences::default();
|
||||
prefs.reset();
|
||||
// prefs.save(); // prefs are saved by the GameEvents already
|
||||
ew_game.send(GameEvent::SetShadows(Turn::Unchanged));
|
||||
ew_game.send(GameEvent::SetFullscreen(Turn::Unchanged));
|
||||
|
|
|
@ -543,6 +543,14 @@ impl Preferences {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reset(&mut self) {
|
||||
*self = Preferences::default();
|
||||
|
||||
// why is this necessary?...
|
||||
self.light_amp = Preferences::default_light_amp();
|
||||
self.flashlight_power = Preferences::default_flashlight_power();
|
||||
}
|
||||
}
|
||||
|
||||
fn file_is_readable(file_path: &str) -> bool {
|
||||
|
|
Loading…
Reference in a new issue