aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/lib.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-11-10 00:21:41 +0100
committerGitHub <noreply@github.com>2022-11-10 00:21:41 +0100
commit6515ea9cf6922dc431090fba3457400d95f74a57 (patch)
tree98429087ca67e10d362b051c219f63e79d0aa8a5 /src-tauri/src/lib.rs
parent32fd7e37d0a2e72a88bac3462fbfac3a5d4b6015 (diff)
downloadFlightCore-6515ea9cf6922dc431090fba3457400d95f74a57.tar.gz
FlightCore-6515ea9cf6922dc431090fba3457400d95f74a57.zip
feat: Parse actually installed mods (#38)
* feat: Parse actually installed mods Instead of using solely `enabledmods.json` parse the `mod.json` of found mods in `mods` folder. * refactor: Remove leftover print statements * refactor: Move logic into dedicated module * fix: Load mods despite `enabledmods.json` missing Previously we would error out early if `enabledmods.json` was missing despite not actually needing it for mod list. * style: Autoformat
Diffstat (limited to 'src-tauri/src/lib.rs')
-rw-r--r--src-tauri/src/lib.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index e4f67108..79c5165e 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -448,27 +448,3 @@ pub fn get_enabled_mods(game_install: GameInstall) -> Result<serde_json::value::
// Return parsed data
Ok(res)
}
-
-/// Gets list of installed mods and their properties
-/// - name
-/// - is enabled?
-pub fn get_installed_mods_and_properties(game_install: GameInstall) -> Result<Vec<NorthstarMod>, String> {
- // Get enabled mods as JSON
- let res: serde_json::Value = get_enabled_mods(game_install)?;
-
- let mut installed_mods = Vec::new();
-
- for (key, value) in res.as_object().unwrap() {
-
- let current_mod: NorthstarMod = NorthstarMod {
- name: key.to_string(),
- enabled: value.as_bool().unwrap(),
- };
- installed_mods.push(current_mod);
- }
-
- dbg!(&res);
- dbg!(installed_mods.clone());
-
- Ok(installed_mods)
-}