Epic safe launch (#85)

This feature lets users force some Epic Games to be launched through the Epic Launcher
This commit is contained in:
Philip Kristoffersen
2022-04-18 14:00:06 +02:00
committed by GitHub
parent 03aab2e088
commit e9d10499f2
7 changed files with 212 additions and 118 deletions
+14
View File
@@ -31,6 +31,9 @@ pub(crate) struct ManifestItem {
#[serde(alias = "ExpectingDLCInstalled")]
pub expected_dlc: Option<HashMap<String, bool>>,
#[serde(default)]
pub safe_launch: bool,
}
fn exe_shortcut(manifest: ManifestItem) -> ShortcutOwned {
@@ -96,7 +99,18 @@ impl ManifestItem {
self.catalog_namespace, self.catalog_item_id, self.app_name
)
}
pub fn get_key(&self) -> String{
format!(
"{}-{}-{}",
self.catalog_namespace, self.catalog_item_id, self.app_name
)
}
fn needs_launcher(&self) -> bool {
if self.safe_launch{
return true;
}
match (&self.is_managed, &self.expected_dlc) {
(true, _) => true,
(false, Some(map)) => !map.is_empty(),