Let sims link/unlink/reset independently
This commit is contained in:
+18
-5
@@ -211,8 +211,8 @@ impl GameWindow {
|
||||
}
|
||||
});
|
||||
ui.menu("Emulation", || {
|
||||
let has_game = self.client.has_game();
|
||||
if self.client.is_running() {
|
||||
let has_game = self.client.has_game(self.sim_id);
|
||||
if self.client.is_running(self.sim_id) {
|
||||
if ui.menu_item_config("Pause").enabled(has_game).build() {
|
||||
self.client.send_command(EmulatorCommand::Pause);
|
||||
}
|
||||
@@ -220,7 +220,8 @@ impl GameWindow {
|
||||
self.client.send_command(EmulatorCommand::Resume);
|
||||
}
|
||||
if ui.menu_item_config("Reset").enabled(has_game).build() {
|
||||
self.client.send_command(EmulatorCommand::Reset);
|
||||
self.client
|
||||
.send_command(EmulatorCommand::Reset(self.sim_id));
|
||||
}
|
||||
});
|
||||
ui.menu("Video", || {
|
||||
@@ -243,11 +244,23 @@ impl GameWindow {
|
||||
}
|
||||
});
|
||||
ui.menu("Multiplayer", || {
|
||||
if self.sim_id == SimId::Player1 && ui.menu_item("Open Player 2") {
|
||||
if self.sim_id == SimId::Player1
|
||||
&& !self.client.has_player_2()
|
||||
&& ui.menu_item("Open Player 2")
|
||||
{
|
||||
self.client
|
||||
.send_command(EmulatorCommand::StartSecondSim(None));
|
||||
self.proxy.send_event(UserEvent::OpenPlayer2Window).unwrap();
|
||||
}
|
||||
if self.client.has_player_2() {
|
||||
let linked = self.client.are_sims_linked();
|
||||
if linked && ui.menu_item("Unlink") {
|
||||
self.client.send_command(EmulatorCommand::Unlink);
|
||||
}
|
||||
if !linked && ui.menu_item("Link") {
|
||||
self.client.send_command(EmulatorCommand::Link);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -326,7 +339,7 @@ impl AppWindow for GameWindow {
|
||||
WindowEvent::Resized(size) => {
|
||||
self.window.handle_resize(size);
|
||||
if self.window.minimized {
|
||||
if self.client.is_running() {
|
||||
if self.client.is_running(self.sim_id) {
|
||||
self.client.send_command(EmulatorCommand::Pause);
|
||||
self.paused_due_to_minimize = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user