mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
* Remove dependency on failure * Update flatpak cargo-lock * Update cargo version * Update release manifest
52 lines
1.2 KiB
Rust
52 lines
1.2 KiB
Rust
use crate::platform::{Platform, SettingsValidity};
|
|
|
|
use super::{get_egs_manifests, EpicGamesLauncherSettings, ManifestItem};
|
|
|
|
pub struct EpicPlatform {
|
|
settings: EpicGamesLauncherSettings,
|
|
}
|
|
|
|
impl EpicPlatform {
|
|
pub fn new(settings: &EpicGamesLauncherSettings) -> Self {
|
|
EpicPlatform {
|
|
settings: settings.clone(),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Platform<ManifestItem, String> for EpicPlatform {
|
|
fn enabled(&self) -> bool {
|
|
self.settings.enabled
|
|
}
|
|
|
|
fn name(&self) -> &str {
|
|
"EGS"
|
|
}
|
|
|
|
fn get_shortcuts(&self) -> Result<Vec<ManifestItem>, String> {
|
|
get_egs_manifests(&self.settings)
|
|
}
|
|
|
|
#[cfg(target_family = "unix")]
|
|
fn create_symlinks(&self) -> bool {
|
|
false
|
|
}
|
|
|
|
fn settings_valid(&self) -> SettingsValidity {
|
|
let shortcuts_res = self.get_shortcuts();
|
|
match shortcuts_res {
|
|
Ok(_) => SettingsValidity::Valid,
|
|
Err(err) => SettingsValidity::Invalid {
|
|
reason: format!("{}", err),
|
|
},
|
|
}
|
|
}
|
|
|
|
fn needs_proton(&self, _input: &ManifestItem) -> bool {
|
|
#[cfg(target_family = "unix")]
|
|
return true;
|
|
#[cfg(target_os = "windows")]
|
|
return false;
|
|
}
|
|
}
|