From bf947d6f56a8ed0614003d0e031e6fea99e14f87 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 29 Aug 2022 01:10:56 +0200 Subject: Add omni-button Changes behaviour and content based on application state, e.g. if game install location was found or Northstar was detect as installed. --- src-ui/src/main.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src-ui/src') diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index e5149bdd..f9677938 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -12,6 +12,7 @@ document.addEventListener("DOMContentLoaded", async function () { let panicButtonEl = $("panic-button") as HTMLElement; let installLocationHolderEl = $("install-location-holder") as HTMLElement; let versionNumberHolderEl = $("version-number-holder") as HTMLElement; + let omniButtonEl = document.getElementById("omni-button") as HTMLElement; // listen backend-ping event (from Tauri Rust App) listen("backend-ping", function (evt: TauriEvent) { @@ -49,5 +50,12 @@ document.addEventListener("DOMContentLoaded", async function () { // Get install location let install_location = await invoke("find_game_install_location") as string; - installLocationHolderEl.textContent = install_location; + // Change omni-button content based on whether game install was found + if (install_location && install_location.length > 0) { + omniButtonEl.textContent = "Install"; + installLocationHolderEl.textContent = install_location; + } + else { + omniButtonEl.textContent = "Find Titanfall2 install location"; + } }) -- cgit v1.2.3