Skip to content

Commit

Permalink
feat: Prevent installation of Vanilla+ mod
Browse files Browse the repository at this point in the history
as it has special installation requirements
  • Loading branch information
GeckoEidechse committed Aug 7, 2024
1 parent 863a7fb commit f56d1ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src-tauri/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 11 additions & 1 deletion src-tauri/src/mod_management/mod.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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?;

Expand Down

0 comments on commit f56d1ed

Please sign in to comment.