mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Set origin compat folder
This commit is contained in:
@@ -7,15 +7,19 @@ pub struct OriginGame {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
pub origin_location: Option<PathBuf>,
|
||||
pub origin_compat_folder: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl From<OriginGame> for ShortcutOwned {
|
||||
fn from(game: OriginGame) -> Self {
|
||||
let launch = format!(
|
||||
let launch = match game.origin_compat_folder{
|
||||
Some(compat_folder) =>
|
||||
format!("STEAM_COMPAT_DATA_PATH=\"{}\" %command% \"origin2://game/launch?offerIds={}&autoDownload=1&authCode=&cmdParams=\"", compat_folder.to_string_lossy().to_string(), game.id)
|
||||
,
|
||||
None => format!(
|
||||
"\"origin2://game/launch?offerIds={}&autoDownload=1&authCode=&cmdParams=\"",
|
||||
game.id
|
||||
);
|
||||
|
||||
game.id)
|
||||
};
|
||||
let mut owned_shortcut = if let Some(origin_location) = game.origin_location {
|
||||
let origin_location = format!("\"{}\"", origin_location.to_string_lossy());
|
||||
Shortcut::new(
|
||||
|
||||
@@ -57,6 +57,7 @@ impl Platform<OriginGame, OriginErrors> for OriginPlatform {
|
||||
id,
|
||||
title: game_title,
|
||||
origin_location: origin_exe.clone(),
|
||||
origin_compat_folder: origin_folders.compat_folder.clone(),
|
||||
})
|
||||
});
|
||||
Ok(games.collect())
|
||||
@@ -77,7 +78,6 @@ impl Platform<OriginGame, OriginErrors> for OriginPlatform {
|
||||
return false;
|
||||
#[cfg(target_family = "unix")]
|
||||
{
|
||||
//TODO Update this when origin gets support on linux
|
||||
true
|
||||
}
|
||||
}
|
||||
@@ -118,6 +118,8 @@ struct OriginPathData {
|
||||
exe_path: Option<PathBuf>,
|
||||
//~/.steam/steam/steamapps/compatdata/X/pfx/drive_c/ProgramData/Origin/LocalContent
|
||||
local_content_path: Option<PathBuf>,
|
||||
//~/.steam/steam/steamapps/compatdata/X
|
||||
compat_folder: Option<PathBuf>,
|
||||
}
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
@@ -150,6 +152,7 @@ fn get_default_locations() -> OriginPathData {
|
||||
if origin_exe_path.exists() && origin_local_content.exists() {
|
||||
res.exe_path = Some(origin_exe_path);
|
||||
res.local_content_path = Some(origin_local_content);
|
||||
res.compat_folder = Some(dir.path().to_path_buf());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user