cleaned up download progress
This commit is contained in:
parent
79d7869382
commit
144f098661
@ -10,8 +10,10 @@ let greetMsgEl;
|
|||||||
const download_progress = listen("download_progress", (progress) => {
|
const download_progress = listen("download_progress", (progress) => {
|
||||||
console.log("Downloading");
|
console.log("Downloading");
|
||||||
//console.log("Downloaded "+progress.payload.downloaded/(1024*1024) +"MB / " + progress.payload.total/(1024*1024) + "MB");
|
//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_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;
|
document.getElementById("launchGame").disabled = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -19,6 +21,7 @@ const download_finished = listen("download_finished", (event) => {
|
|||||||
document.getElementById("download_name").textContent = "";
|
document.getElementById("download_name").textContent = "";
|
||||||
document.getElementById("download_progress").textContent = "";
|
document.getElementById("download_progress").textContent = "";
|
||||||
document.getElementById("launchGame").disabled = false;
|
document.getElementById("launchGame").disabled = false;
|
||||||
|
document.getElementById("launchGame").textContent ="Launch Minecraft";
|
||||||
});
|
});
|
||||||
|
|
||||||
const update_dialog = listen("update_dialog", (event) => {
|
const update_dialog = listen("update_dialog", (event) => {
|
||||||
@ -67,6 +70,7 @@ function gameLaunch() {
|
|||||||
var packId = document.getElementById("Modpacks");
|
var packId = document.getElementById("Modpacks");
|
||||||
var selectedId = packId.value;
|
var selectedId = packId.value;
|
||||||
document.getElementById("launchGame").disabled = true;
|
document.getElementById("launchGame").disabled = true;
|
||||||
|
document.getElementById("launchGame").textContent ="Launching...";
|
||||||
//TODO Launch Game
|
//TODO Launch Game
|
||||||
invoke("launch_modpack", { id: selectedId}).then(window.close);
|
invoke("launch_modpack", { id: selectedId}).then(window.close);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user