Simplify setting new options on user confirmation
This commit is contained in:
parent
3862080cb1
commit
30c82a64ac
@ -308,7 +308,6 @@ impl eframe::App for AltairEmulator {
|
||||
if self.running {
|
||||
self.run_cpu_cycle();
|
||||
}
|
||||
let old_fan_enabled = self.options.fan_enabled;
|
||||
if let Some(option_window) = self.option_window.as_mut() {
|
||||
if option_window.draw(ctx, &mut self.options) {
|
||||
self.option_window = None;
|
||||
@ -320,14 +319,13 @@ impl eframe::App for AltairEmulator {
|
||||
.send(AudioMessage::SetVolume(self.options.volume))
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
if (old_fan_enabled != self.options.fan_enabled) && self.fp_state.power() {
|
||||
if self.options.fan_enabled {
|
||||
if self.options.fan_enabled && self.fp_state.power() {
|
||||
self.audio_tx.send(AudioMessage::FanOn).unwrap();
|
||||
} else {
|
||||
self.audio_tx.send(AudioMessage::FanOff).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
if self.running {
|
||||
ctx.request_repaint();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user