aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-24 17:44:49 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-24 17:44:49 +0200
commit94979acb5d62fc5a0498b8d0170308511972fbb7 (patch)
treefc259ea9f0b427a78458956f91e6285f5c062a08
parentc0b597f1bfaa63153a337eb7280fbbb4fa7b824a (diff)
downloadFlightCore-94979acb5d62fc5a0498b8d0170308511972fbb7.tar.gz
FlightCore-94979acb5d62fc5a0498b8d0170308511972fbb7.zip
Add force reinstall button
-rw-r--r--dist/index.html1
-rw-r--r--src-ui/src/main.ts19
2 files changed, 20 insertions, 0 deletions
diff --git a/dist/index.html b/dist/index.html
index 95403ebd..ae87ebe7 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -31,6 +31,7 @@
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="force-reinstall-northstar-button">Force reinstall Northstar</button>
<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 -->
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts
index 5648605c..d68a0154 100644
--- a/src-ui/src/main.ts
+++ b/src-ui/src/main.ts
@@ -100,6 +100,7 @@ document.addEventListener("DOMContentLoaded", async function () {
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;
+ let forceReinstallNorthstarButtonEl = document.getElementById("force-reinstall-northstar-button") as HTMLElement;
useReleaseCandidateCheckboxEl.addEventListener('change', async function () {
// Switch between main release and release candidates
@@ -245,6 +246,24 @@ document.addEventListener("DOMContentLoaded", async function () {
});
});
+ // Handles force reinstall click
+ forceReinstallNorthstarButtonEl.addEventListener("click", async function () {
+ let install_northstar_result = invoke("install_northstar_caller", { gamePath: globalState.gamepath, northstarPackageName: globalState.northstar_package_name });
+
+ // Update button while installl process is run
+ omniButtonEl.textContent = button_in_install_string;
+
+ await install_northstar_result.then((message) => {
+ console.log(message);
+ })
+ .catch((error) => {
+ console.error(error);
+ alert(error);
+ });
+
+ get_northstar_version_number_and_set_button_accordingly(omniButtonEl);
+ });
+
// panic button click
panicButtonEl.addEventListener("pointerup", async function () {
await invoke("force_panic");