aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/repair_and_verify
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-11-27 20:35:11 +0100
committerGitHub <noreply@github.com>2022-11-27 20:35:11 +0100
commit8d40bca06dc8eea63c5eb7e4ae93f38e29654c7b (patch)
treeaa34f767f23150aa9c72cd13b7fa2543f0dc37f4 /src-tauri/src/repair_and_verify
parent516bbf8830b6038018666a7cc87684eed5f1e6aa (diff)
downloadFlightCore-8d40bca06dc8eea63c5eb7e4ae93f38e29654c7b.tar.gz
FlightCore-8d40bca06dc8eea63c5eb7e4ae93f38e29654c7b.zip
refactor: Make var containing core mods pub const (#74)
This way we only define them in one place
Diffstat (limited to 'src-tauri/src/repair_and_verify')
-rw-r--r--src-tauri/src/repair_and_verify/mod.rs15
1 files changed, 4 insertions, 11 deletions
diff --git a/src-tauri/src/repair_and_verify/mod.rs b/src-tauri/src/repair_and_verify/mod.rs
index 32715622..47ec4cc9 100644
--- a/src-tauri/src/repair_and_verify/mod.rs
+++ b/src-tauri/src/repair_and_verify/mod.rs
@@ -1,7 +1,7 @@
/// Contains various functions to repair common issues and verifying installation
use app::{get_enabled_mods, GameInstall};
-use crate::mod_management::set_mod_enabled_status;
+use crate::{mod_management::set_mod_enabled_status, northstar::CORE_MODS};
use anyhow::anyhow;
/// Verifies Titanfall2 game files
@@ -15,17 +15,10 @@ pub fn verify_game_files(game_install: GameInstall) -> Result<String, String> {
pub fn disable_all_but_core(game_install: GameInstall) -> Result<(), String> {
let current_mods = get_enabled_mods(game_install.clone())?;
- // These are the mods we do not want to disable
- let core_mods = [
- "Northstar.Client",
- "Northstar.Custom",
- "Northstar.CustomServers",
- ];
- // let sub_values: Vec<HashMap<String, Value>> = serde_json::from_str(&json)?;
-
+ // Disable all mods, set core mods to enabled
for (key, _value) in current_mods.as_object().unwrap() {
- if core_mods.contains(&key.as_str()) {
- // This is a core mod
+ if CORE_MODS.contains(&key.as_str()) {
+ // This is a core mod, we do not want to disable it
set_mod_enabled_status(game_install.clone(), key.to_string(), true)?;
} else {
// Not a core mod