diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-08-29 01:10:56 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-08-29 01:10:56 +0200 |
commit | bf947d6f56a8ed0614003d0e031e6fea99e14f87 (patch) | |
tree | 7aae17d9a6c26b8cb3d4fabf816423d6c8ed9ab0 | |
parent | 9a23a8d68cfa3477b55778818d7d06b468f9b5ca (diff) | |
download | FlightCore-bf947d6f56a8ed0614003d0e031e6fea99e14f87.tar.gz FlightCore-bf947d6f56a8ed0614003d0e031e6fea99e14f87.zip |
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.
-rw-r--r-- | dist/index.html | 9 | ||||
-rw-r--r-- | src-tauri/src/main.rs | 2 | ||||
-rw-r--r-- | src-ui/src/main.ts | 10 |
3 files changed, 19 insertions, 2 deletions
diff --git a/dist/index.html b/dist/index.html index bd036bc8..9aed5681 100644 --- a/dist/index.html +++ b/dist/index.html @@ -11,5 +11,14 @@ <backend-ping class="server"></backend-ping> <install-location-holder>EMPTY</install-location-holder> <version-number-holder>UNKNOWN</version-number-holder> + <!-- + This button serves multiple purposes + - Locate install + - Install Northstar + - Update Northstar + - Run Northstar + The functionality it serves and what it displays is based on the current state of the application + --> + <button id="omni-button">Loading...</button> </body> </html> diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 79386ca6..9bc5cc29 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -66,7 +66,7 @@ fn find_game_install_location() -> String { } None => println!("Couldn't locate Steam on this computer!"), } - "NOT FOUND".to_string() + "".to_string() } #[tauri::command] 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<any>) { @@ -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"; + } }) |