aboutsummaryrefslogtreecommitdiff
path: root/src-ui/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src-ui/src/main.ts')
-rw-r--r--src-ui/src/main.ts28
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;
}