aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2024-08-08 12:09:40 +0200
committerGitHub <noreply@github.com>2024-08-08 12:09:40 +0200
commit3cab2a7852fdc4663c8c7f4df6a52b831e610e92 (patch)
treef23a4dd3c3cf9648cf3270a78809f36718c0e50d
parent863a7fbedfb8d443a528e7475edb5de541499ce9 (diff)
downloadFlightCore-3cab2a7852fdc4663c8c7f4df6a52b831e610e92.tar.gz
FlightCore-3cab2a7852fdc4663c8c7f4df6a52b831e610e92.zip
feat: Prevent installation of Vanilla+ mod (#996)
as it has special installation requirements that makes it not installable like common Northstar mods.
-rw-r--r--src-tauri/src/constants.rs3
-rw-r--r--src-tauri/src/mod_management/mod.rs12
2 files changed, 14 insertions, 1 deletions
diff --git a/src-tauri/src/constants.rs b/src-tauri/src/constants.rs
index 47eeef19..3ad2d6e8 100644
--- a/src-tauri/src/constants.rs
+++ b/src-tauri/src/constants.rs
@@ -26,6 +26,9 @@ pub const BLACKLISTED_MODS: [&str; 3] = [
"ebkr-r2modman",
];
+/// List of Thunderstoremods that have some specific install requirements that makes them different from standard mods
+pub const MODS_WITH_SPECIAL_REQUIREMENTS: [&str; 1] = ["NanohmProtogen-VanillaPlus"];
+
/// Order in which the sections for release notes should be displayed
pub const SECTION_ORDER: [&str; 11] = [
"feat", "fix", "docs", "style", "refactor", "build", "test", "i18n", "ci", "chore", "other",
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs
index ebbcf431..2a018920 100644
--- a/src-tauri/src/mod_management/mod.rs
+++ b/src-tauri/src/mod_management/mod.rs
@@ -1,6 +1,6 @@
// This file contains various mod management functions
-use crate::constants::{BLACKLISTED_MODS, CORE_MODS};
+use crate::constants::{BLACKLISTED_MODS, CORE_MODS, MODS_WITH_SPECIAL_REQUIREMENTS};
use async_recursion::async_recursion;
use thermite::prelude::ThermiteError;
@@ -609,6 +609,16 @@ pub async fn fc_download_mod_and_install(
}
}
+ // Prevent installing mods that have specific install requirements
+ for special_mod in MODS_WITH_SPECIAL_REQUIREMENTS {
+ if thunderstore_mod_string.contains(special_mod) {
+ return Err(format!(
+ "{} has special install requirements and cannot be installed with FlightCore",
+ thunderstore_mod_string
+ ));
+ }
+ }
+
// Get download URL for the specified mod
let download_url = get_ns_mod_download_url(thunderstore_mod_string).await?;