mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
* Added Ubisoft connect (Linux Proton) support * Update src/platforms/uplay/platform.rs Co-authored-by: Philip Kristoffersen <philipkristoffersen@gmail.com> * Update src/platforms/uplay/platform.rs Co-authored-by: Philip Kristoffersen <philipkristoffersen@gmail.com> * Fixed needing "find_subsequence". * Update platform.rs * Update platform.rs * Fix trying to use 'None' as a function. --------- Co-authored-by: Ofacy <git@ofacy.com> Co-authored-by: Philip Kristoffersen <philipkristoffersen@gmail.com>
32 lines
1.1 KiB
Rust
32 lines
1.1 KiB
Rust
use std::path::{Path, PathBuf};
|
|
|
|
use steam_shortcuts_util::shortcut::{Shortcut, ShortcutOwned};
|
|
|
|
#[derive(Clone)]
|
|
pub(crate) struct UplayGame {
|
|
pub(crate) name: String,
|
|
pub(crate) icon: String,
|
|
pub(crate) id: String,
|
|
pub(crate) launcher: PathBuf,
|
|
pub(crate) launcher_compat_folder: Option<PathBuf>,
|
|
pub(crate) launch_id: u8,
|
|
}
|
|
|
|
impl From<UplayGame> for ShortcutOwned {
|
|
fn from(game: UplayGame) -> Self {
|
|
let launch = match game.launcher_compat_folder{
|
|
Some(compat_folder) => format!
|
|
("STEAM_COMPAT_DATA_PATH=\"{}\" %command% \"uplay://launch/{}/{}\"",
|
|
compat_folder.to_string_lossy(), game.id, game.launch_id),
|
|
None => format!("\"uplay://launch/{}/{}\"", game.id, game.launch_id)
|
|
};
|
|
let start_dir = game
|
|
.launcher
|
|
.parent()
|
|
.unwrap_or_else(|| Path::new(""))
|
|
.to_string_lossy();
|
|
let exe = format!("\"{}\"", game.launcher.to_string_lossy());
|
|
Shortcut::new("0", &game.name, &exe, &start_dir, &game.icon, "", &launch).to_owned()
|
|
}
|
|
}
|