diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-01 19:26:39 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-01 19:26:39 +0200 |
commit | 312cddf2c2b6fd715e3133095c4562c78807b236 (patch) | |
tree | fb84f89970051ce13149e3aa9dc2ec08d5d49f3c /src-ui/src | |
parent | 340b96e5878b892d81dbc7e5cdbc0215ce78b4d9 (diff) | |
download | FlightCore-312cddf2c2b6fd715e3133095c4562c78807b236.tar.gz FlightCore-312cddf2c2b6fd715e3133095c4562c78807b236.zip |
Handle gamepath check if manually selected
as well as Northstar existence and up-to-date check
Diffstat (limited to 'src-ui/src')
-rw-r--r-- | src-ui/src/main.ts | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index aedcceb5..6eaee030 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -51,16 +51,32 @@ document.addEventListener("DOMContentLoaded", async function () { } else { // user selected a single directory alert(selected); - - globalState.gamepath = selected; + // TODO Verify if valid Titanfall2 install location + let is_valid_titanfall2_install = await invoke("verify_install_location", { game_path: selected }) as boolean; + if (is_valid_titanfall2_install) { + globalState.gamepath = selected; - // Update omni-button - omniButtonEl.textContent = "Install"; + // Update omni-button + omniButtonEl.textContent = "Install"; - // TODO Check for Northstar install - // TODO Check for updated Northstar + // Check for Northstar install + let northstar_version_number = await invoke("get_northstar_version_number_caller") as string; + if (northstar_version_number && northstar_version_number.length > 0) { + globalState.installed_northstar_version = northstar_version_number; + omniButtonEl.textContent = `Play (${northstar_version_number})`; + // Check for updated Northstar + let northstar_is_outdated = await invoke("check_is_northstar_outdated") as boolean; + if (northstar_is_outdated) { + omniButtonEl.textContent = "Update"; + } + } + } + else { + // Not valid Titanfall2 install + alert("Not a valid Titanfall2 install"); + } } return; } |