fix: start discord rpc before game
This commit is contained in:
parent
5f309f68df
commit
e00eae6a87
1 changed files with 14 additions and 13 deletions
|
@ -277,6 +277,19 @@ pub fn run() -> anyhow::Result<()> {
|
|||
Sessions::apply(current, config.get_wine_prefix_path())?;
|
||||
}
|
||||
|
||||
// Start Discord RPC just before the game
|
||||
#[cfg(feature = "discord-rpc")]
|
||||
let rpc = if config.launcher.discord_rpc.enabled {
|
||||
Some(DiscordRpc::new(config.launcher.discord_rpc.clone().into()))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
#[cfg(feature = "discord-rpc")]
|
||||
if let Some(rpc) = &rpc {
|
||||
rpc.update(RpcUpdates::Connect)?;
|
||||
}
|
||||
|
||||
// Run command
|
||||
|
||||
let variables = command
|
||||
|
@ -291,18 +304,6 @@ pub fn run() -> anyhow::Result<()> {
|
|||
command.current_dir(config.game.path.for_edition(config.launcher.edition))
|
||||
.spawn()?.wait_with_output()?;
|
||||
|
||||
#[cfg(feature = "discord-rpc")]
|
||||
let rpc = if config.launcher.discord_rpc.enabled {
|
||||
Some(DiscordRpc::new(config.launcher.discord_rpc.clone().into()))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
#[cfg(feature = "discord-rpc")]
|
||||
if let Some(rpc) = &rpc {
|
||||
rpc.update(RpcUpdates::Connect)?;
|
||||
}
|
||||
|
||||
loop {
|
||||
std::thread::sleep(std::time::Duration::from_secs(3));
|
||||
|
||||
|
|
Loading…
Reference in a new issue