aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-24 17:30:04 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-24 17:30:04 +0200
commitc0b597f1bfaa63153a337eb7280fbbb4fa7b824a (patch)
treed736458f4f7c2d2bca6cede8cfcffbd433858715
parent468d843b2eaf0f9f3de00177a79420313c9fc3ed (diff)
downloadFlightCore-c0b597f1bfaa63153a337eb7280fbbb4fa7b824a.tar.gz
FlightCore-c0b597f1bfaa63153a337eb7280fbbb4fa7b824a.zip
Add code skeleton to verify game files
Once done, should help with some tickets.
-rw-r--r--dist/index.html3
-rw-r--r--src-tauri/src/main.rs12
-rw-r--r--src-tauri/src/repair_and_verify/mod.rs9
-rw-r--r--src-ui/src/main.ts18
4 files changed, 41 insertions, 1 deletions
diff --git a/dist/index.html b/dist/index.html
index 2d4d1acb..95403ebd 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -30,6 +30,9 @@
<!-- Should be switched to dropdown menu later -->
Use release candidate? <input type="checkbox" id="use-release-candidate-checkbox" />
+ <!-- Stuff directly below would go to a repair/verify Titanfall2/Northstar page in the app -->
+ <button id="verify-game-files-button">Verify Titanfall2 game files</button>
+
<!-- This showcases ping activity between frontend and backend. Should be hidden in non-dev/debug mode -->
<backend-ping class="server"></backend-ping>
</body>
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 264a8395..025b6863 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -15,6 +15,10 @@ use app::{
get_host_os, get_log_list, get_northstar_version_number, install_northstar, launch_northstar,
GameInstall,
};
+
+mod repair_and_verify;
+use repair_and_verify::verify_game_files;
+
use tauri::Manager;
use tokio::time::sleep;
use tauri_plugin_store::PluginBuilder;
@@ -78,7 +82,8 @@ fn main() {
update_northstar_caller,
launch_northstar_caller,
check_is_flightcore_outdated_caller,
- get_log_list_caller
+ get_log_list_caller,
+ verify_game_files_caller
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
@@ -246,3 +251,8 @@ fn launch_northstar_caller(game_install: GameInstall) -> Result<String, String>
fn get_log_list_caller(game_install: GameInstall) -> Result<Vec<std::path::PathBuf>, String> {
get_log_list(game_install)
}
+
+#[tauri::command]
+fn verify_game_files_caller(game_install: GameInstall) -> Result<String, String> {
+ verify_game_files(game_install)
+}
diff --git a/src-tauri/src/repair_and_verify/mod.rs b/src-tauri/src/repair_and_verify/mod.rs
new file mode 100644
index 00000000..e99dcbfc
--- /dev/null
+++ b/src-tauri/src/repair_and_verify/mod.rs
@@ -0,0 +1,9 @@
+/// Contains various functions to repair common issues and verifying installation
+
+use app::GameInstall;
+
+/// Verifies Titanfall2 game files
+pub fn verify_game_files(game_install: GameInstall) -> Result<String, String> {
+ dbg!(game_install);
+ Err("TODO, not yet implemented".to_string())
+}
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts
index 3b47e6f4..5648605c 100644
--- a/src-ui/src/main.ts
+++ b/src-ui/src/main.ts
@@ -99,6 +99,7 @@ document.addEventListener("DOMContentLoaded", async function () {
let originRunningHolderEl = $("origin-running-holder") as HTMLElement;
let northstarVersionHolderEl = $("northstar-version-holder") as HTMLElement;
let useReleaseCandidateCheckboxEl = document.getElementById("use-release-candidate-checkbox") as HTMLInputElement;
+ let verifyGameFilesButtonEl = document.getElementById("verify-game-files-button") as HTMLElement;
useReleaseCandidateCheckboxEl.addEventListener('change', async function () {
// Switch between main release and release candidates
@@ -227,6 +228,23 @@ document.addEventListener("DOMContentLoaded", async function () {
}
});
+ // Handles verify button click
+ verifyGameFilesButtonEl.addEventListener("click", async function () {
+ let game_install = {
+ game_path: globalState.gamepath,
+ install_type: installTypeHolderEl.textContent
+ } as GameInstall;
+ await invoke("verify_game_files_caller", { gameInstall: game_install })
+ .then((message) => {
+ // Found some gamepath
+ console.log(message);
+ })
+ .catch((error) => {
+ console.error(error);
+ alert(error);
+ });
+ });
+
// panic button click
panicButtonEl.addEventListener("pointerup", async function () {
await invoke("force_panic");