From 8d5a7eba98fc01999d54ee89d1455ed024801359 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Fri, 9 Sep 2022 23:03:39 +0200 Subject: Add initial Northstar install support still Steam version only --- src-ui/src/main.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src-ui/src') diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index 09c7f057..a9fe0301 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -83,6 +83,23 @@ document.addEventListener("DOMContentLoaded", async function () { // } switch (omniButtonEl.textContent) { + case "Install": + omniButtonEl.textContent = "Installing"; + await invoke("install_northstar_caller", { gamePath: globalState.gamepath }) as boolean; + alert("Done?"); + + // TODO: move this to function + 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})`; + let northstar_is_outdated = await invoke("check_is_northstar_outdated") as boolean; + if (northstar_is_outdated) { + omniButtonEl.textContent = "Update"; + } + } + + break; default: alert("Not implemented yet"); break; -- cgit v1.2.3