diff options
author | Rémy Raes <contact@remyraes.com> | 2022-09-24 19:01:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-24 19:01:33 +0200 |
commit | 5bf2254204692066fbd5774097b1e3fbc33d0157 (patch) | |
tree | 73652a5b6b0245aa81a9ce30451165207ac868f5 /src-ui/src | |
parent | bdba63fa033a9f98d63951ec0cf9109f7949f444 (diff) | |
parent | 94979acb5d62fc5a0498b8d0170308511972fbb7 (diff) | |
download | FlightCore-5bf2254204692066fbd5774097b1e3fbc33d0157.tar.gz FlightCore-5bf2254204692066fbd5774097b1e3fbc33d0157.zip |
Merge branch 'GeckoEidechse:main' into feat/new-ui
Diffstat (limited to 'src-ui/src')
-rw-r--r-- | src-ui/src/main.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index 3b47e6f4..d68a0154 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -99,6 +99,8 @@ 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; + let forceReinstallNorthstarButtonEl = document.getElementById("force-reinstall-northstar-button") as HTMLElement; useReleaseCandidateCheckboxEl.addEventListener('change', async function () { // Switch between main release and release candidates @@ -227,6 +229,41 @@ 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); + }); + }); + + // 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"); |