CLI flag to open player 2 (thx Elrinth)
This commit is contained in:
parent
640078e9b9
commit
d269082c8b
11
src/app.rs
11
src/app.rs
|
|
@ -84,7 +84,7 @@ impl Application {
|
|||
let proxy = proxy.clone();
|
||||
thread::spawn(|| process_gamepad_input(mappings, proxy));
|
||||
}
|
||||
Self {
|
||||
let app = Self {
|
||||
icon,
|
||||
wgpu,
|
||||
client,
|
||||
|
|
@ -106,7 +106,16 @@ impl Application {
|
|||
init_framebuffers: args.frame_buffers,
|
||||
init_registers: args.registers,
|
||||
init_terminal: args.terminal,
|
||||
};
|
||||
if args.player2 {
|
||||
app.client
|
||||
.send_command(EmulatorCommand::StartSecondSim(args.rom.clone()));
|
||||
|
||||
app.proxy
|
||||
.send_event(UserEvent::OpenPlayer2)
|
||||
.expect("Failed to open Player 2 window");
|
||||
}
|
||||
app
|
||||
}
|
||||
|
||||
fn open(&mut self, event_loop: &ActiveEventLoop, window: Box<dyn AppWindow>) {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ pub struct CliArgs {
|
|||
/// Watch ROM files for changes, automatically reload
|
||||
#[arg(short, long)]
|
||||
pub watch: bool,
|
||||
/// Automatically open Player 2 for multiplayer
|
||||
#[arg(long)]
|
||||
pub player2: bool,
|
||||
}
|
||||
|
||||
pub const COLOR_PRESETS: [[Color32; 2]; 3] = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue