Support manual/automatic ROM reloading

This commit is contained in:
2025-11-23 15:45:57 -05:00
parent 2e474df3e8
commit 2034f7934b
8 changed files with 248 additions and 22 deletions
+16
View File
@@ -85,6 +85,10 @@ impl GameWindow {
.send_command(EmulatorCommand::LoadGame(self.sim_id, path));
}
}
Command::ReloadRom => {
self.client
.send_command(EmulatorCommand::ReloadRom(self.sim_id));
}
Command::Quit => {
let _ = self.proxy.send_event(UserEvent::Quit(self.sim_id));
}
@@ -137,6 +141,18 @@ impl GameWindow {
.send_command(EmulatorCommand::LoadGame(self.sim_id, path));
}
}
if ui
.add(self.button_for(ui.ctx(), "Reload ROM", Command::ReloadRom))
.clicked()
{
self.client
.send_command(EmulatorCommand::ReloadRom(self.sim_id));
}
let watch_rom = self.client.is_rom_watched(self.sim_id);
if ui.selectable_button(watch_rom, "Watch ROM").clicked() {
self.client
.send_command(EmulatorCommand::WatchRom(self.sim_id, !watch_rom));
}
if ui
.add(self.button_for(ui.ctx(), "Quit", Command::Quit))
.clicked()