From 144f09866194d2ac4afc6a049d9abcd94bf61e45 Mon Sep 17 00:00:00 2001 From: Cuptain Date: Mon, 24 Jun 2024 09:49:20 +1000 Subject: [PATCH] cleaned up download progress --- FCLauncher/src/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/FCLauncher/src/main.js b/FCLauncher/src/main.js index 5abe690..de7f409 100644 --- a/FCLauncher/src/main.js +++ b/FCLauncher/src/main.js @@ -10,8 +10,10 @@ let greetMsgEl; const download_progress = listen("download_progress", (progress) => { console.log("Downloading"); //console.log("Downloaded "+progress.payload.downloaded/(1024*1024) +"MB / " + progress.payload.total/(1024*1024) + "MB"); + let downProgress = (progress.payload.downloaded/(1024*1024)).toFixed(2); + let downTotal = (progress.payload.total/(1024*1024)).toFixed(2); document.getElementById("download_name").textContent = "Downloading "+progress.payload.download_name; - document.getElementById("download_progress").textContent = progress.payload.downloaded/(1024*1024) + "MB / "+progress.payload.total/(1024*1024)+"MB"; + document.getElementById("download_progress").textContent = downProgress + "MB / "+downTotal+"MB"; document.getElementById("launchGame").disabled = true; }); @@ -19,6 +21,7 @@ const download_finished = listen("download_finished", (event) => { document.getElementById("download_name").textContent = ""; document.getElementById("download_progress").textContent = ""; document.getElementById("launchGame").disabled = false; + document.getElementById("launchGame").textContent ="Launch Minecraft"; }); const update_dialog = listen("update_dialog", (event) => { @@ -67,6 +70,7 @@ function gameLaunch() { var packId = document.getElementById("Modpacks"); var selectedId = packId.value; document.getElementById("launchGame").disabled = true; + document.getElementById("launchGame").textContent ="Launching..."; //TODO Launch Game invoke("launch_modpack", { id: selectedId}).then(window.close);