aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-29 00:32:23 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-29 00:32:23 +0200
commit93cec9e9cf8d1f67c38e4194b6c912aff06a3f22 (patch)
treec2f93a9904548d9ef1352830d28cef5dc7c8f64e /src-tauri/src/main.rs
parent4e53e84c9dab6da2289d1a82009ed06a8a4c697b (diff)
downloadFlightCore-93cec9e9cf8d1f67c38e4194b6c912aff06a3f22.tar.gz
FlightCore-93cec9e9cf8d1f67c38e4194b6c912aff06a3f22.zip
Add ability to enable/disable mods
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index f75f78c7..4089d72b 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -13,7 +13,7 @@ use app::{
check_is_flightcore_outdated, check_is_valid_game_path, check_northstar_running,
check_origin_running, convert_release_candidate_number, find_game_install_location,
get_enabled_mods, get_host_os, get_log_list, get_northstar_version_number, install_northstar,
- launch_northstar, GameInstall,
+ launch_northstar, set_mod_enabled_status, GameInstall,
};
mod repair_and_verify;
@@ -84,7 +84,8 @@ fn main() {
check_is_flightcore_outdated_caller,
get_log_list_caller,
verify_game_files_caller,
- get_enabled_mods_caller
+ get_enabled_mods_caller,
+ set_mod_enabled_status_caller
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
@@ -262,3 +263,12 @@ fn verify_game_files_caller(game_install: GameInstall) -> Result<String, String>
fn get_enabled_mods_caller(game_install: GameInstall) -> Result<serde_json::value::Value, String> {
get_enabled_mods(game_install)
}
+
+#[tauri::command]
+fn set_mod_enabled_status_caller(
+ game_install: GameInstall,
+ mod_name: String,
+ is_enabled: bool,
+) -> Result<(), String> {
+ set_mod_enabled_status(game_install, mod_name, is_enabled)
+}