diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-14 23:56:09 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-14 23:56:09 +0200 |
commit | 17a1e8a5edfd2dfb4bc89e619c5e27721473ee1e (patch) | |
tree | ad16d13f2143836be7fc6cf0ec9df77548524b44 /src-ui | |
parent | 7899a99d89bfd5f9fea52e9cdb01f367e2ccef3b (diff) | |
download | FlightCore-17a1e8a5edfd2dfb4bc89e619c5e27721473ee1e.tar.gz FlightCore-17a1e8a5edfd2dfb4bc89e619c5e27721473ee1e.zip |
Support switching between main release and RCs
State is not saved between launches currently.
Diffstat (limited to 'src-ui')
-rw-r--r-- | src-ui/src/main.ts | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index 8d08560c..ba45b20c 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -21,6 +21,7 @@ interface GameInstall { var globalState = { gamepath: "", installed_northstar_version: "", + northstar_package_name: "Northstar", current_view: "" // Note sure if this is the right way to do it } @@ -34,7 +35,7 @@ async function get_northstar_version_number_and_set_button_accordingly(omniButto northstarVersionHolderEl.textContent = `Installed Northstar version: v${globalState.installed_northstar_version}`; omniButtonEl.textContent = button_play_string; - await invoke("check_is_northstar_outdated", { gamePath: globalState.gamepath }) + await invoke("check_is_northstar_outdated", { gamePath: globalState.gamepath, northstarPackageName: globalState.northstar_package_name }) .then((message) => { console.log(message); if (message) { @@ -97,6 +98,18 @@ document.addEventListener("DOMContentLoaded", async function () { let omniButtonEl = document.getElementById("omni-button") as HTMLElement; let originRunningHolderEl = $("origin-running-holder") as HTMLElement; let northstarVersionHolderEl = $("northstar-version-holder") as HTMLElement; + let useReleaseCandidateCheckboxEl = document.getElementById("use-release-candidate-checkbox") as HTMLInputElement; + + useReleaseCandidateCheckboxEl.addEventListener('change', function () { + // Switch between main release and release candidates + if (this.checked) { + globalState.northstar_package_name = "NorthstarReleaseCandidate" + } else { + globalState.northstar_package_name = "Northstar"; + } + // Update the button + get_northstar_version_number_and_set_button_accordingly(omniButtonEl); + }); // listen backend-ping event (from Tauri Rust App) listen("backend-ping", function (evt: TauriEvent<any>) { @@ -130,7 +143,7 @@ document.addEventListener("DOMContentLoaded", async function () { // Install Northstar case button_install_string: - let install_northstar_result = invoke("install_northstar_caller", { gamePath: globalState.gamepath }); + let install_northstar_result = invoke("install_northstar_caller", { gamePath: globalState.gamepath, northstarPackageName: globalState.northstar_package_name }); // Update button while installl process is run omniButtonEl.textContent = button_in_install_string; @@ -148,7 +161,7 @@ document.addEventListener("DOMContentLoaded", async function () { // Update Northstar case button_update_string: - let update_northstar_result = invoke("update_northstar_caller", { gamePath: globalState.gamepath }); + let update_northstar_result = invoke("update_northstar_caller", { gamePath: globalState.gamepath, northstarPackageName: globalState.northstar_package_name }); // Update button while update process is run omniButtonEl.textContent = button_in_update_string; |