From 80b8b2c318fbb04853a813c438c896a4b2f8b37d Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Sat, 10 Sep 2022 18:36:10 +0200 Subject: Return GameInstall object instead of tuple The object contains the path Titanfall2 is installed in, as well as how it was installed (Steam, Origin, EA-App) --- src-ui/src/main.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src-ui/src') diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index 61fec575..24c9f04a 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -11,6 +11,11 @@ const button_in_update_string = "Updating..."; const button_play_string = "Launch Northstar"; const button_manual_find_string = "Manually select Titanfall2 install location"; +interface GameInstall { + game_path: string; + install_type: number; + } + // Stores the overall state of the application var globalState = { gamepath: "", @@ -181,13 +186,15 @@ document.addEventListener("DOMContentLoaded", async function () { // Get install location await invoke("find_game_install_location_caller", { gamePath: globalState.gamepath }) - .then((game_path) => { + .then((game_install) => { // Found some gamepath - console.log(game_path); + console.log(game_install); + + let game_install_obj = game_install as GameInstall; // Change omni-button content based on whether game install was found - let game_path_str = game_path as string + let game_path_str = game_install_obj.game_path as string omniButtonEl.textContent = button_install_string; installLocationHolderEl.value = game_path_str; globalState.gamepath = game_path_str; -- cgit v1.2.3