Persist watch rom setting
This commit is contained in:
+3
-3
@@ -73,6 +73,7 @@ impl GameWindow {
|
||||
) -> Self {
|
||||
let config = SimConfig::load(&persistence, sim_id);
|
||||
let _ = proxy.send_event(UserEvent::LowBattery(sim_id, config.low_battery));
|
||||
client.send_command(EmulatorCommand::WatchRom(sim_id, config.watch_rom));
|
||||
let toasts = Toasts::new()
|
||||
.with_anchor(Anchor::BottomLeft)
|
||||
.with_margin((10.0, 10.0).into())
|
||||
@@ -333,6 +334,7 @@ impl GameWindow {
|
||||
}
|
||||
let watch_rom = self.client.is_rom_watched(self.sim_id);
|
||||
if ui.selectable_button(watch_rom, "Watch ROM").clicked() {
|
||||
self.update_config(|c| c.watch_rom = !watch_rom);
|
||||
self.client
|
||||
.send_command(EmulatorCommand::WatchRom(self.sim_id, !watch_rom));
|
||||
}
|
||||
@@ -393,9 +395,7 @@ impl GameWindow {
|
||||
ui.separator();
|
||||
let low_battery = self.config.low_battery;
|
||||
if ui.selectable_button(low_battery, "Low Battery").clicked() {
|
||||
self.update_config(|c| {
|
||||
c.low_battery = !low_battery;
|
||||
});
|
||||
self.update_config(|c| c.low_battery = !low_battery);
|
||||
let _ = self
|
||||
.proxy
|
||||
.send_event(UserEvent::LowBattery(self.sim_id, !low_battery));
|
||||
|
||||
Reference in New Issue
Block a user