From 61739fe7362f731c8a3283559cff53629e7e926a Mon Sep 17 00:00:00 2001 From: 1ly4s0 <67460389+1ly4s0@users.noreply.github.com> Date: Tue, 30 Jul 2024 23:18:37 +0200 Subject: [PATCH] Update 2.0.1 build 1001 --- package.json | 2 +- src/app.js | 8 ++++++-- src/assets/js/panels/home.js | 1 + src/assets/js/update.js | 8 ++++++-- src/assets/js/utils.js | 20 ++++++++++---------- src/launcher.html | 2 +- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 28437d3..a17a836 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "BattlyLauncher", "productname": "Battly Launcher", - "version": "2.0.0", + "version": "2.0.1", "buildVersion": "1000", "description": "El mejor Launcher Personalizado para Minecraft Premium y No premium", "main": "src/app.js", diff --git a/src/app.js b/src/app.js index 70c230e..c5c8863 100644 --- a/src/app.js +++ b/src/app.js @@ -608,9 +608,13 @@ ipcMain.handle("update-app", () => { }); const pkgVersion = async () => { - let data = await fs.readFileSync("package.json"); - return JSON.parse(data); + const pkg = { + version: "2.0.1", + buildVersion: 1001 + }; + return JSON.parse(pkg); }; + ipcMain.handle("update-new-app", async () => { console.log(await pkgVersion()); diff --git a/src/assets/js/panels/home.js b/src/assets/js/panels/home.js index 4032319..8647202 100644 --- a/src/assets/js/panels/home.js +++ b/src/assets/js/panels/home.js @@ -3836,6 +3836,7 @@ class Home { let seMostroExtrayendo_core = false; let seMostroInstalando_core = false; + let seMostroInstalando = false; launch_core.on("extract", (extract) => { consoleOutput_ += `[EXTRACT] ${extract}\n`; diff --git a/src/assets/js/update.js b/src/assets/js/update.js index 5934b6b..5a7e7ce 100644 --- a/src/assets/js/update.js +++ b/src/assets/js/update.js @@ -13,8 +13,11 @@ const pipeline = util.promisify(stream.pipeline); let lang; const pkgVersion = async () => { - const pkg = await fs.promises.readFile("package.json"); - return JSON.parse(pkg); + const pkg = { + version: "2.0.1", + buildVersion: 1001 + }; + return pkg; }; class Splash { @@ -118,6 +121,7 @@ class Splash { this.updateProgress(progress); if (extractedFiles === totalFiles) { + await fs.unlinkSync(zipPath); this.log('¡Actualización completada! Reiniciando...'); setTimeout(() => { ipcRenderer.send("restartLauncher"); diff --git a/src/assets/js/utils.js b/src/assets/js/utils.js index c476935..72cc132 100644 --- a/src/assets/js/utils.js +++ b/src/assets/js/utils.js @@ -44,7 +44,7 @@ function changePanel(id) { const preloadContent = document.querySelector('.preload-content'); document.getElementById("loading-text").innerHTML = "Cargando"; - preloadContent.style.display = "block"; // Muestra el contenido de carga + preloadContent.style.display = "block"; setTimeout(() => { rectangulos.forEach((rectangulo, index) => { @@ -55,15 +55,15 @@ function changePanel(id) { document.getElementById("loading-text").innerHTML = ""; }, 10); - - + + setTimeout(() => { let active = document.querySelector('.active'); if (active) active.classList.toggle('active'); let panel = document.querySelector(`.${id}`); panel.classList.add('active'); }, 500); - + setTimeout(() => { document.getElementById("loading-text").innerHTML = "Listo"; rectangulos.forEach((rectangulo, index) => { @@ -73,7 +73,7 @@ function changePanel(id) { }); document.getElementById("loading-text").innerHTML = ""; - + setTimeout(() => { preloadContent.style.display = "none"; }, 500); @@ -112,7 +112,7 @@ function accountSelect(uuid) { if (activeAccount) activeAccount.classList.toggle('active-account'); account.classList.add('active-account'); - + new Alert().ShowAlert({ icon: 'success', @@ -120,10 +120,10 @@ function accountSelect(uuid) { text: `${lang.account_selected_text} ${account.querySelector('.account-name').innerHTML} ${lang.account_selected_text_two}` }); - + if (account.querySelector('.account-name').innerHTML.includes('fa-solid fa-fire')) { document.getElementById("ads").style.display = "none"; - document.getElementById("ads-text").style.display = "none"; + // document.getElementById("ads-text").style.display = "none"; console.log('Es premium'); let WelcomePremiumShown = localStorage.getItem('WelcomePremiumShown'); if (!WelcomePremiumShown || WelcomePremiumShown === 'false' || WelcomePremiumShown === null || WelcomePremiumShown === undefined) { @@ -152,7 +152,7 @@ function accountSelect(uuid) { const closeButton = document.createElement('button'); closeButton.classList.add('delete'); closeButton.setAttribute('aria-label', 'close'); - + closeButton.addEventListener('click', () => { modal.classList.remove('is-active'); localStorage.setItem('WelcomePremiumShown', true); @@ -209,7 +209,7 @@ function accountSelect(uuid) { const acceptButton = document.createElement('button'); acceptButton.classList.add('button', 'is-info'); acceptButton.textContent = 'Aceptar'; - + acceptButton.addEventListener('click', () => { modal.classList.remove('is-active'); localStorage.setItem('WelcomePremiumShown', true); diff --git a/src/launcher.html b/src/launcher.html index fbe638f..a0c60a6 100644 --- a/src/launcher.html +++ b/src/launcher.html @@ -191,7 +191,7 @@
-
Battly Launcher 2.0.0Battly Launcher 2.0.1build 1000