diff options
author | Rémy Raes <contact@remyraes.com> | 2022-10-02 22:52:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-02 22:52:39 +0200 |
commit | a4b14e2c0edbbae1d399009ad9d691e7c30d4571 (patch) | |
tree | 7585d1bc1e54319710881e2a310f6825f622d437 /src-tauri/src/main.rs | |
parent | 96f83ec9406e330444e5f0ab135dc4c169c832ce (diff) | |
parent | 7f0ee9be80988f13f1d234136725a03db0335ec5 (diff) | |
download | FlightCore-a4b14e2c0edbbae1d399009ad9d691e7c30d4571.tar.gz FlightCore-a4b14e2c0edbbae1d399009ad9d691e7c30d4571.zip |
Merge branch 'GeckoEidechse:main' into feat/new-ui
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r-- | src-tauri/src/main.rs | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 025b6863..a2866cb4 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -12,16 +12,16 @@ use std::{ 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_host_os, get_log_list, get_northstar_version_number, install_northstar, launch_northstar, - GameInstall, + get_enabled_mods, get_host_os, get_log_list, get_northstar_version_number, install_northstar, + launch_northstar, set_mod_enabled_status, GameInstall, }; mod repair_and_verify; -use repair_and_verify::verify_game_files; +use repair_and_verify::{verify_game_files, disable_all_but_core}; use tauri::Manager; -use tokio::time::sleep; use tauri_plugin_store::PluginBuilder; +use tokio::time::sleep; #[derive(Default)] struct Counter(Arc<Mutex<i32>>); @@ -83,7 +83,10 @@ fn main() { launch_northstar_caller, check_is_flightcore_outdated_caller, get_log_list_caller, - verify_game_files_caller + verify_game_files_caller, + get_enabled_mods_caller, + set_mod_enabled_status_caller, + disable_all_but_core_caller ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); @@ -254,5 +257,24 @@ fn get_log_list_caller(game_install: GameInstall) -> Result<Vec<std::path::PathB #[tauri::command] fn verify_game_files_caller(game_install: GameInstall) -> Result<String, String> { - verify_game_files(game_install) + verify_game_files(game_install) +} + +#[tauri::command] +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) +} + +#[tauri::command] +fn disable_all_but_core_caller(game_install: GameInstall) -> Result<(), String> { + disable_all_but_core(game_install) } |