Amigos
+ Amigos
conectados
+ id="warning-status-message">¡
- - -
- - -
-
- - -
- - +
+ + +
+ + +
+ + +
+ + +
+
+
+ +
+
diff --git a/package-lock.json b/package-lock.json
index 540b042..aff1930 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,11 +9,12 @@
"version": "2.0.3",
"license": "CC0",
"dependencies": {
- "@distube/ytdl-core": "^4.13.7",
+ "@distube/ytdl-core": "^4.14.4",
"7zip-bin": "^5.2.0",
"adm-zip": "^0.5.14",
"axios": "^1.7.2",
"electron-updater": "^6.2.1",
+ "fs-extra": "^11.2.0",
"got": "^11.8.6",
"javascript-obfuscator": "^4.1.1",
"marked": "^13.0.2",
@@ -42,9 +43,9 @@
}
},
"node_modules/@distube/ytdl-core": {
- "version": "4.14.0",
- "resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.14.0.tgz",
- "integrity": "sha512-1CH+gGewXKIjlEol0Y3JkaGoT/7yjKdC5BT5fe217Z8KoenKoPQLL2BmlcT0w3wyiH8pBCoJ465DHu9Y+jFmNg==",
+ "version": "4.14.4",
+ "resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.14.4.tgz",
+ "integrity": "sha512-dHb4GW3qATIjRsS6VIhm3Pop7FdUcDFhsnyQlsPeXW7UhTPuNS0BmraKiTpFbpp0Ky+rxBQjJBfPRFsM+dT1fg==",
"dependencies": {
"http-cookie-agent": "^6.0.5",
"m3u8stream": "^0.8.6",
@@ -120,6 +121,20 @@
"dev": true,
"optional": true
},
+ "node_modules/@electron/get/node_modules/fs-extra": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
+ "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
+ "dev": true,
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^4.0.0",
+ "universalify": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=6 <7 || >=8"
+ }
+ },
"node_modules/@electron/get/node_modules/global-agent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz",
@@ -151,6 +166,15 @@
"node": ">=10"
}
},
+ "node_modules/@electron/get/node_modules/jsonfile": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
+ "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
+ "dev": true,
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
"node_modules/@electron/get/node_modules/roarr": {
"version": "2.15.4",
"resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz",
@@ -181,6 +205,15 @@
"node": ">= 8.0"
}
},
+ "node_modules/@electron/get/node_modules/universalify": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
+ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 4.0.0"
+ }
+ },
"node_modules/@fastify/busboy": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz",
@@ -803,18 +836,6 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
- "node_modules/app-builder-lib/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
"node_modules/app-builder-lib/node_modules/plist": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",
@@ -841,15 +862,6 @@
"node": ">=10"
}
},
- "node_modules/app-builder-lib/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "dev": true,
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/app-builder-lib/node_modules/uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
@@ -1205,18 +1217,6 @@
"node": ">=12"
}
},
- "node_modules/builder-util/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
"node_modules/builder-util/node_modules/stat-mode": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz",
@@ -1226,15 +1226,6 @@
"node": ">= 6"
}
},
- "node_modules/builder-util/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "dev": true,
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/cacheable-lookup": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz",
@@ -1739,27 +1730,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/dmg-builder/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
- "node_modules/dmg-builder/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "dev": true,
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/dmg-license": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/dmg-license/-/dmg-license-1.0.11.tgz",
@@ -2121,19 +2091,6 @@
"node": ">=12"
}
},
- "node_modules/electron-builder-squirrel-windows/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
"node_modules/electron-builder-squirrel-windows/node_modules/lazystream": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
@@ -2195,16 +2152,6 @@
"dev": true,
"peer": true
},
- "node_modules/electron-builder-squirrel-windows/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "dev": true,
- "peer": true,
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/electron-builder-squirrel-windows/node_modules/zip-stream": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.1.tgz",
@@ -2256,27 +2203,6 @@
"node": ">=12"
}
},
- "node_modules/electron-builder/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
- "node_modules/electron-builder/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "dev": true,
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/electron-publish": {
"version": "24.13.1",
"resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.13.1.tgz",
@@ -2306,27 +2232,6 @@
"node": ">=12"
}
},
- "node_modules/electron-publish/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
- "node_modules/electron-publish/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "dev": true,
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/electron-updater": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-6.2.1.tgz",
@@ -2355,17 +2260,6 @@
"node": ">=12"
}
},
- "node_modules/electron-updater/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
"node_modules/electron-updater/node_modules/semver": {
"version": "7.6.3",
"license": "ISC",
@@ -2376,14 +2270,6 @@
"node": ">=10"
}
},
- "node_modules/electron-updater/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
@@ -2692,17 +2578,16 @@
"peer": true
},
"node_modules/fs-extra": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
- "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
- "dev": true,
+ "version": "11.2.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz",
+ "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==",
"dependencies": {
"graceful-fs": "^4.2.0",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
},
"engines": {
- "node": ">=6 <7 || >=8"
+ "node": ">=14.14"
}
},
"node_modules/fs.realpath": {
@@ -3590,10 +3475,12 @@
}
},
"node_modules/jsonfile": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
- "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
- "dev": true,
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
@@ -5188,27 +5075,6 @@
"node": ">=12"
}
},
- "node_modules/temp-file/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dev": true,
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
- "node_modules/temp-file/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "dev": true,
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/tiny-typed-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz",
@@ -5362,12 +5228,11 @@
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
},
"node_modules/universalify": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
- "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
- "dev": true,
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"engines": {
- "node": ">= 4.0.0"
+ "node": ">= 10.0.0"
}
},
"node_modules/unzipper": {
@@ -5382,37 +5247,6 @@
"node-int64": "^0.4.0"
}
},
- "node_modules/unzipper/node_modules/fs-extra": {
- "version": "11.2.0",
- "license": "MIT",
- "dependencies": {
- "graceful-fs": "^4.2.0",
- "jsonfile": "^6.0.1",
- "universalify": "^2.0.0"
- },
- "engines": {
- "node": ">=14.14"
- }
- },
- "node_modules/unzipper/node_modules/jsonfile": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
- "dependencies": {
- "universalify": "^2.0.0"
- },
- "optionalDependencies": {
- "graceful-fs": "^4.1.6"
- }
- },
- "node_modules/unzipper/node_modules/universalify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
- "engines": {
- "node": ">= 10.0.0"
- }
- },
"node_modules/url-parse": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
diff --git a/package.json b/package.json
index d8bee9a..619bb75 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "BattlyLauncher",
"productname": "Battly Launcher",
- "version": "2.0.3",
+ "version": "2.1.0",
"buildVersion": "1003",
"description": "El mejor Launcher Personalizado para Minecraft Premium y No premium",
"main": "src/app.js",
@@ -25,11 +25,12 @@
"ext": "js,html,css"
},
"dependencies": {
- "@distube/ytdl-core": "^4.13.7",
+ "@distube/ytdl-core": "^4.14.4",
"7zip-bin": "^5.2.0",
"adm-zip": "^0.5.14",
"axios": "^1.7.2",
"electron-updater": "^6.2.1",
+ "fs-extra": "^11.2.0",
"got": "^11.8.6",
"javascript-obfuscator": "^4.1.1",
"marked": "^13.0.2",
diff --git a/src/1002.zip b/src/1002.zip
deleted file mode 100644
index 7a85f64..0000000
Binary files a/src/1002.zip and /dev/null differ
diff --git a/src/app.js b/src/app.js
index 089664d..a2d0083 100644
--- a/src/app.js
+++ b/src/app.js
@@ -386,7 +386,21 @@ if (!gotTheLock) {
app.quit();
} else {
app.whenReady().then(() => {
- UpdateWindow.createWindow();
+ if (fs.existsSync(path.join(dataDirectory, ".battly/launchboost"))) {
+ fetch("https://api.battlylauncher.com/launcher/config-launcher/config.json").then(async res => {
+ let data = await res.json();
+ let version = data.latestVersion;
+ let actualVersion = (require("../package.json")).version;
+
+ if (actualVersion != version) {
+ const updateWindow = UpdateWindow.createWindow();
+ } else {
+ MainWindow.createWindow();
+ }
+ });
+ } else {
+ UpdateWindow.createWindow();
+ }
});
}
@@ -609,7 +623,7 @@ ipcMain.handle("update-app", () => {
const pkgVersion = async () => {
const pkg = {
- version: "2.0.3",
+ version: "2.1.0",
buildVersion: 1004
};
return pkg;
diff --git a/src/assets/css/launcher.css b/src/assets/css/launcher.css
index 81ed280..1b3acd9 100644
--- a/src/assets/css/launcher.css
+++ b/src/assets/css/launcher.css
@@ -21,7 +21,7 @@
html,
body {
height: 100%;
- overflow: hidden;
+ overflow: hidden !important;
}
body {
diff --git a/src/assets/js/index.js b/src/assets/js/index.js
index 186c313..aef2c95 100644
--- a/src/assets/js/index.js
+++ b/src/assets/js/index.js
@@ -15,8 +15,15 @@ let dev = process.env.NODE_ENV === 'dev';
const fs = require('fs');
const fetch = require('node-fetch');
const axios = require("axios");
-import { Lang } from './utils/lang.js';
-let lang;
+const { Lang } = require('./assets/js/utils/lang.js');
+let lang;;
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
+
+let message;
class Splash {
@@ -31,8 +38,6 @@ class Splash {
}
async LoadLang() {
- lang = await new Lang().GetLang();
- this.message.innerHTML = lang.salutate;
}
async start() {
@@ -41,7 +46,20 @@ class Splash {
"author": "TECNO BROS"
},]
- console.log(document.getElementById("version_id"));
+
+ let strings = {
+ "es": "¡Hola!",
+ "en": "Hello!",
+ "fr": "Bonjour!",
+ "de": "Hallo!",
+ "it": "Ciao!",
+ "pt": "Olá!",
+ "ru": "Привет!",
+ "ja": "こんにちは!",
+ "ar": "مرحبا!",
+ }
+
+ this.message.innerHTML = strings[localStorage.getItem("lang")];
let sonidoDB = localStorage.getItem("sonido-inicio") ? localStorage.getItem("sonido-inicio") : "start";
let sonido_inicio = new Audio('./assets/audios/' + sonidoDB + '.mp3');
diff --git a/src/assets/js/launcher.js b/src/assets/js/launcher.js
index afc9e09..c645f05 100644
--- a/src/assets/js/launcher.js
+++ b/src/assets/js/launcher.js
@@ -10,6 +10,9 @@ const fs = require("fs");
const { Microsoft, Mojang } = require("./assets/js/libs/mc/Index");
const { ipcRenderer } = require("electron");
+const { Lang } = require("./assets/js/utils/lang.js");
+
+
import {
config,
logger,
@@ -18,6 +21,7 @@ import {
addAccount,
accountSelect,
} from "./utils.js";
+
import Login from "./panels/login.js";
import Home from "./panels/home.js";
import Settings from "./panels/settings.js";
@@ -29,29 +33,37 @@ import Friends from "./panels/friends.js";
import Chat from "./panels/chat.js";
import Servers from "./panels/servers.js";
+
class Launcher {
async init() {
const loadingText = document.getElementById("loading-text");
loadingText.innerHTML = "Cargando Panel de Inicio";
this.initLog();
console.log("🔄 Iniciando Launcher...");
- if (process.platform == "win32") this.initFrame();
- this.config = await config.GetConfig().then((res) => res);
- this.news = await config.GetNews().then((res) => res);
- this.database = await new database().init();
- this.createPanels(
- Login,
- Home,
- Settings,
- Welcome,
- Mods,
- Music,
- NewsPanel,
- Friends,
- Chat,
- Servers
- );
- this.getaccounts();
+ new Lang().GetLang().then(async (lang) => {
+ console.log("🔄 Iniciando Lang...");
+ console.log(lang)
+ if (process.platform == "win32") this.initFrame();
+ this.config = await config.GetConfig().then((res) => res);
+ this.news = await config.GetNews().then((res) => res);
+ this.database = await new database().init();
+ this.createPanels(
+ Login,
+ Home,
+ Settings,
+ Welcome,
+ Mods,
+ Music,
+ NewsPanel,
+ Friends,
+ Chat,
+ Servers
+ );
+ this.getaccounts();
+ }).catch(error => {
+ console.error("Error:", error);
+ });
+
}
initLog() {
@@ -170,7 +182,7 @@ class Launcher {
)
.then((response) => response.json())
.then((data) => data)
- .catch((err) => {});
+ .catch((err) => { });
} catch (error) {
premiums = [];
}
diff --git a/src/assets/js/panels/friends.js b/src/assets/js/panels/friends.js
index 85a23cb..f105b14 100644
--- a/src/assets/js/panels/friends.js
+++ b/src/assets/js/panels/friends.js
@@ -25,10 +25,17 @@ const Toast = Swal.mixin({
});
let amigos;
+
+const { Lang } = require("./assets/js/utils/lang.js");
let lang;
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
+
const dataDirectory = process.env.APPDATA || (process.platform == 'darwin' ? `${process.env.HOME}/Library/Application Support` : process.env.HOME)
-import { Lang } from "../utils/lang.js";
import { Alert } from "../utils/alert.js";
class Friends {
@@ -36,7 +43,6 @@ class Friends {
async init(config, news) {
this.config = config;
this.database = await new database().init();
- lang = await new Lang().GetLang();
this.AddFriend();
this.Solicitudes();
this.ObtenerAmigos();
diff --git a/src/assets/js/panels/home.js b/src/assets/js/panels/home.js
index bf048d3..f93f3cd 100644
--- a/src/assets/js/panels/home.js
+++ b/src/assets/js/panels/home.js
@@ -31,12 +31,17 @@ let logFilePath = `${dataDirectory}/.battly/Registro.log`;
import { consoleOutput } from "../utils/logger.js";
let consoleOutput_;
-import { Lang } from "../utils/lang.js";
+const { Lang } = require("./assets/js/utils/lang.js");
+let langs;
+new Lang().GetLang().then(lang_ => {
+ langs = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
import { Alert } from "../utils/alert.js";
import * as NBT from "../../../../node_modules/nbtify/dist/index.js";
-let lang;
-let langs;
+
const ShowCrashReport = new CrashReport().ShowCrashReport;
const LaunchMinecraft = new LoadMinecraft().LaunchMinecraft;
const DownloadFiles = new LoadMinecraft().DownloadFiles;
@@ -44,8 +49,6 @@ const DownloadFiles = new LoadMinecraft().DownloadFiles;
class Home {
static id = "home";
async init(config, news) {
- lang = await new Lang().GetLang();
- langs = lang;
this.WaitData();
this.config = config;
this.news = await news;
@@ -1147,7 +1150,7 @@ class Home {
enable: true,
},
verify: false,
- ignored: ["loader"],
+ ignored: ["loader", "libraries"],
java: false,
memory: {
min: `${ram.ramMin * 1024}M`,
@@ -2484,6 +2487,11 @@ class Home {
rectangulo.style.backgroundColor = background_loading_screen_color;
});
}
+
+ if (!fs.existsSync(`${dataDirectory}\\.battly\\launchboost`)) {
+ document.getElementById("launchboost").removeAttribute("checked");
+ }
+
}
async IniciarEstadoDiscord() {
@@ -2686,259 +2694,162 @@ class Home {
fs.mkdirSync(`${dataDirectory}/.battly/versions`);
}
- document.getElementById(
- "instancias-txt"
- ).innerHTML += ` ${langs.instances}`;
- document.getElementById(
- "download-txt"
- ).innerHTML += ` ${langs.download}`;
- document.getElementById(
- "play-txt"
- ).innerHTML += ` ${langs.play}`;
- document.getElementById("news-battly").innerHTML = langs.news_battly;
- document.getElementById("status-battly").innerHTML = langs.status_battly;
- document.getElementById(
- "playing-now-text"
- ).innerHTML = ` ${langs.playing_now_text}`;
- document.getElementById("playing-now-body").innerHTML =
- langs.playing_now_body;
-
- // document
- // .getElementById("settings-btn")
- // .querySelector(".settings-button-span").innerHTML =
- // langs.tooltip_settings;
+ const updates = {
+ "news-battly": langs.news_battly,
+ "status-battly": langs.status_battly,
+ "playing-now-text": ` ${langs.playing_now_text}`,
+ "playing-now-body": langs.playing_now_body,
+ "accounts-btn-text": langs.accounts_btn,
+ "java-btn-text": langs.java_btn,
+ "ram-btn-text": langs.ram_btn,
+ "launcher-btn-text": langs.launcher_btn,
+ "theme-btn-text": langs.theme_btn,
+ "background-btn-text": langs.background_btn,
+ "save-btn-text": langs.save_btn,
+ "account-information": langs.account_information,
+ "mc-id-text": langs.mc_id_text,
+ "mostrarskin-userinfo-btn": langs.showskin_userinfo_btn,
+ "eliminarcuenta-userinfo-btn": `${langs.deleteaccount_userinfo_btn}`,
+ "establecer-skin": `${langs.set_skin}`,
+ "cerrar-userinfo-btn": `${langs.close}`,
+ "my-accounts": `${langs.my_accounts}`,
+ "add-account-text": `${langs.add_account_text}`,
+ "java-settings": `${langs.java_settings}`,
+ "java-text-info": `${langs.java_text_info}`,
+ "java-text-info2": `${langs.java_text_info2}`,
+ "ram-settings": `${langs.ram_settings}`,
+ "ram-text-info": `${langs.ram_text_info}`,
+ "of-ram": `${langs.of_ram}`,
+ "of-ram-disponible": `${langs.of_ram_disponible}`,
+ "you-have-a-total": `${langs.you_have_a_total}`,
+ "battly-settings": `${langs.battly_settings}`,
+ "battly-settings-information": `${langs.battly_settings_information}`,
+ "music_settings_information": `${langs.music_settings_information}`,
+ "minimalize-battly": `${langs.minimalize_battly}`,
+ "keep-battly-opened": `${langs.keep_battly_opened}`,
+ "obtener-socketid-text": `${langs.get_socketid}`,
+ "battly-theme": `${langs.battly_theme}`,
+ "battly-theme-text": `${langs.battly_theme_text}`,
+ "buttons-color": `${langs.buttons_color}`,
+ "bottom-bar-text": `${langs.bottom_bar_text}`,
+ "bottom-bar-opacity": `${langs.bottom_bar_opacity}`,
+ "starting-music": `${langs.starting_music}`,
+ "resize-image-text": `${langs.resize_image_text}`,
+ "establecer-fondo": `${langs.set_background_text}`,
+ "cerrar-preview-btn": `${langs.cancel}`,
+ "customize-background": `${langs.customize_background}`,
+ "resize-background": `${langs.resize_background}`,
+ "background-image-text": `${langs.background_image_text}`,
+ "restablecer-fondo": `${langs.reset_background}`,
+ "select-a-background": `${langs.select_a_background}`,
+ "button_instalar_modpack": `${langs.install_modpack}`,
+ "volver": `${langs.return}`,
+ "input_buscar_mods": `${langs.search_mods}`,
+ "add-friends": `${langs.add_friend}`,
+ "solicitudes": `${langs.show_requests}`,
+ "friends-volver-btn": `${langs.return}`,
+ "welcome_battly_social": `${langs.welcome_battly_social}`,
+ "friends_list_text": `${langs.friends_list_text}`,
+ "start_minecraft_text": `${langs.start_minecraft_text}`,
+ "textInfo": `${langs.select_the_version_that_you_want}`,
+ "select_a_version": `${langs.select_a_version}`,
+ "show-playlists-text": `${langs.playlists}`,
+ "no_song": `${langs.no_song}`,
+ "return-btn": `${langs.return}`,
+ "nombre-de-cancion": `${langs.song_name}`,
+ "reproducir-btn-text": `${langs.search_song}`,
+ "save-playlist-text": `${langs.save_playlist}`,
+ "cancel-btn-login": `${langs.cancel}`,
+ "lost_your_account": `${langs.lost_your_account}`,
+ "recover_it_here": `${langs.recover_it_here}`,
+ "username_text": `${langs.username}`,
+ "password_text": `${langs.password}`,
+ "register_open_btn": `${langs.register_open_btn}`,
+ "login-text": `${langs.login}`,
+ "you-dont-have-account": `${langs.you_dont_have_account}`,
+ "login-btn": `${langs.login}`,
+ "background-loading-screen-color-text": `${langs.background_loading_screen_color_text}`,
+ "you_are_premium_background": `${langs.you_are_premium_background}`,
+ "button_ver_mods": `${langs.mods_list_button}`,
+ "login-with-microsoft": `${langs.login_microsoft_adv_title}`,
+ "login-with-google": `${langs.login_with_google}`,
+ "select_a_type_background": `${langs.select_a_type_background}`,
+ "static-background-text": `${langs.static_background_text}`,
+ "animated-background-text": `${langs.animated_background_text}`,
+ "minimize_music": `${langs.minimize_music}`,
+ "keep_music_opened": `${langs.keep_music_opened}`,
+ "code-login-text": `${langs.code_login_text}`,
+ "code-btn": `${langs.send}`,
+ "cancel-code-btn": `${langs.cancel}`,
+ "battly-settings-what-to-do": `${langs.battly_settings_what_to_do}`,
+ "language_settings_information": `${langs.language_settings_information}`,
+ "language-selector-btn": `${langs.change}`,
+ "launchboost_settings_information_text": `${langs.launchboost_settings_information_text}`,
+ "connected-friends": `${langs.connected_friends}`,
+ "see-friends-btn": `${langs.see_friends}`
+ };
+
+ // Apply updates for elements using only getElementById
+ Object.keys(updates).forEach(id => {
+ const element = document.getElementById(id);
+ if (element) {
+ element.innerHTML = updates[id];
+ }
+ });
+
+ document.getElementById("instancias-txt").innerHTML += ` ${langs.instances}`;
+ document.getElementById("download-txt").innerHTML += ` ${langs.download}`;
+ document.getElementById("play-txt").innerHTML += ` ${langs.play}`;
+ document.getElementById("music-btn-text").innerHTML = ` ${langs.music_settings_information}`;
+
document
.getElementById("boton_abrir_mods")
.querySelector(".button-span").innerHTML = langs.tooltip_mods;
+
document
.getElementById("music-btn")
.querySelector(".button-span").innerHTML = langs.tooltip_music;
+
document
.getElementById("instancias-btn")
.querySelector(".button-span").innerHTML = langs.tooptip_instances;
+
document
.getElementById("download-btn")
.querySelector(".button-span").innerHTML = langs.tooptip_download;
+
document
.getElementById("play-btn")
.querySelector(".play-button-span").innerHTML = langs.tooltip_play;
+
document
.getElementById("accounts-btn")
.querySelector(".button-span").innerHTML = langs.tooltip_accounts;
+
document
.getElementById("java-btn")
.querySelector(".button-span").innerHTML = langs.tooltip_java;
- document.getElementById("ram-btn").querySelector(".button-span").innerHTML =
- langs.tooltip_ram;
+
+ document
+ .getElementById("ram-btn")
+ .querySelector(".button-span").innerHTML = langs.tooltip_ram;
+
document
.getElementById("launcher-btn")
.querySelector(".button-span").innerHTML = langs.tooltip_launcher;
+
document
.getElementById("theme-btn")
.querySelector(".button-span").innerHTML = langs.tooltip_theme;
+
document
.getElementById("background-btn")
.querySelector(".button-span").innerHTML = langs.tooltip_background;
+
document
.getElementById("save-btn")
.querySelector(".button-span").innerHTML = langs.tooltip_save;
- /* settings */
- document.getElementById("accounts-btn-text").innerHTML = langs.accounts_btn;
- document.getElementById("java-btn-text").innerHTML = langs.java_btn;
- document.getElementById("ram-btn-text").innerHTML = langs.ram_btn;
- document.getElementById("launcher-btn-text").innerHTML = langs.launcher_btn;
- document.getElementById("theme-btn-text").innerHTML = langs.theme_btn;
- document.getElementById("background-btn-text").innerHTML =
- langs.background_btn;
- document.getElementById("save-btn-text").innerHTML = langs.save_btn;
- document.getElementById("account-information").innerHTML =
- langs.account_information;
- document.getElementById("mc-id-text").innerHTML = langs.mc_id_text;
- document.getElementById("mostrarskin-userinfo-btn").innerHTML =
- langs.showskin_userinfo_btn;
- document.getElementById(
- "eliminarcuenta-userinfo-btn"
- ).innerHTML = `${langs.deleteaccount_userinfo_btn}`;
- document.getElementById("establecer-skin").innerHTML = `${langs.set_skin}`;
- document.getElementById("cerrar-userinfo-btn").innerHTML = `${langs.close}`;
- document.getElementById("my-accounts").innerHTML = `${langs.my_accounts}`;
- document.getElementById(
- "add-account-text"
- ).innerHTML = `${langs.add_account_text}`;
- document.getElementById(
- "java-settings"
- ).innerHTML = `${langs.java_settings}`;
- document.getElementById(
- "java-text-info"
- ).innerHTML = `${langs.java_text_info}`;
- document.getElementById(
- "java-text-info2"
- ).innerHTML = `${langs.java_text_info2}`;
- document.getElementById("ram-settings").innerHTML = `${langs.ram_settings}`;
- document.getElementById(
- "ram-text-info"
- ).innerHTML = `${langs.ram_text_info}`;
- document.getElementById("of-ram").innerHTML = `${langs.of_ram}`;
- document.getElementById(
- "of-ram-disponible"
- ).innerHTML = `${langs.of_ram_disponible}`;
- document.getElementById(
- "you-have-a-total"
- ).innerHTML = `${langs.you_have_a_total}`;
- document.getElementById(
- "ram-text-info"
- ).innerHTML = `${langs.ram_text_info}`;
- document.getElementById(
- "battly-settings"
- ).innerHTML = `${langs.battly_settings}`;
- document.getElementById(
- "battly-settings-information"
- ).innerHTML = `${langs.battly_settings_information}`;
- document.getElementById(
- "music_settings_information"
- ).innerHTML = `${langs.music_settings_information}`;
- document.getElementById(
- "minimalize-battly"
- ).innerHTML = `${langs.minimalize_battly}`;
- document.getElementById(
- "keep-battly-opened"
- ).innerHTML = `${langs.keep_battly_opened}`;
- document.getElementById(
- "obtener-socketid-text"
- ).innerHTML = `${langs.get_socketid}`;
- document.getElementById("battly-theme").innerHTML = `${langs.battly_theme}`;
- document.getElementById(
- "battly-theme-text"
- ).innerHTML = `${langs.battly_theme_text}`;
- document.getElementById(
- "buttons-color"
- ).innerHTML = `${langs.buttons_color}`;
- document.getElementById(
- "bottom-bar-text"
- ).innerHTML = `${langs.bottom_bar_text}`;
- document.getElementById(
- "bottom-bar-opacity"
- ).innerHTML = `${langs.bottom_bar_opacity}`;
- document.getElementById(
- "starting-music"
- ).innerHTML = `${langs.starting_music}`;
- document.getElementById(
- "resize-image-text"
- ).innerHTML = `${langs.resize_image_text}`;
- document.getElementById(
- "establecer-fondo"
- ).innerHTML = `${langs.set_background_text}`;
- document.getElementById("cerrar-preview-btn").innerHTML = `${langs.cancel}`;
- document.getElementById(
- "customize-background"
- ).innerHTML = `${langs.customize_background}`;
- document.getElementById(
- "resize-background"
- ).innerHTML = `${langs.resize_background}`;
- document.getElementById(
- "background-image-text"
- ).innerHTML = `${langs.background_image_text}`;
- document.getElementById(
- "restablecer-fondo"
- ).innerHTML = `${langs.reset_background}`;
- document.getElementById(
- "select-a-background"
- ).innerHTML = `${langs.select_a_background}`;
- document.getElementById(
- "button_instalar_modpack"
- ).innerHTML = `${langs.install_modpack}`;
- document.getElementById("volver").innerHTML = `${langs.return}`;
- document.getElementById(
- "input_buscar_mods"
- ).placeholder = `${langs.search_mods}`;
- document.getElementById("add-friends").innerHTML = `${langs.add_friend}`;
- document.getElementById("solicitudes").innerHTML = `${langs.show_requests}`;
- document.getElementById("friends-volver-btn").innerHTML = `${langs.return}`;
- document.getElementById(
- "welcome_battly_social"
- ).innerHTML = `${langs.welcome_battly_social}`;
- document.getElementById(
- "friends_list_text"
- ).innerHTML = `${langs.friends_list_text}`;
- document.getElementById(
- "start_minecraft_text"
- ).innerHTML = `${langs.start_minecraft_text}`;
- document.getElementById(
- "textInfo"
- ).innerHTML = `${langs.select_the_version_that_you_want}`;
- document.getElementById(
- "select_a_version"
- ).innerHTML = `${langs.select_a_version}`;
- document.getElementById(
- "show-playlists-text"
- ).innerHTML = `${langs.playlists}`;
- document.getElementById("no_song").innerHTML = `${langs.no_song}`;
- document.getElementById("return-btn").innerHTML = `${langs.return}`;
- //document.getElementById("playing-now").innerHTML = `${langs.playing_now}`;
- document.getElementById(
- "nombre-de-cancion"
- ).placeholder = `${langs.song_name}`;
- document.getElementById(
- "reproducir-btn-text"
- ).innerHTML = `${langs.search_song}`;
- document.getElementById(
- "save-playlist-text"
- ).innerHTML = `${langs.save_playlist}`;
- document.getElementById("cancel-btn-login").innerHTML = `${langs.cancel}`;
- //document.getElementById("cancel_login_two").innerHTML = `${langs.cancel}`;
- document.getElementById(
- "lost_your_account"
- ).innerHTML = `${langs.lost_your_account}`;
- document.getElementById(
- "recover_it_here"
- ).innerHTML = `${langs.recover_it_here}`;
- document.getElementById("username_text").placeholder = `${langs.username}`;
- document.getElementById("password_text").placeholder = `${langs.password}`;
- document.getElementById(
- "register_open_btn"
- ).innerHTML = `${langs.register_open_btn}`;
- document.getElementById("login-text").innerHTML = `${langs.login}`;
- document.getElementById(
- "you-dont-have-account"
- ).innerHTML = `${langs.you_dont_have_account}`;
- document.getElementById("login-btn").innerHTML = `${langs.login}`;
- document.getElementById(
- "background-loading-screen-color-text"
- ).innerHTML = `${langs.background_loading_screen_color_text}`;
- document.getElementById(
- "you_are_premium_background"
- ).innerHTML = `${langs.you_are_premium_background}`;
-
- document.getElementById(
- "button_ver_mods"
- ).innerHTML = `${langs.mods_list_button}`;
- document.getElementById(
- "login-with-microsoft"
- ).innerHTML = `${langs.login_microsoft_adv_title}`;
- document.getElementById(
- "login-with-google"
- ).innerHTML = `${langs.login_with_google}`;
- document.getElementById(
- "select_a_type_background"
- ).innerHTML = `${langs.select_a_type_background}`;
- document.getElementById(
- "static-background-text"
- ).innerHTML = `${langs.static_background_text}`;
- document.getElementById(
- "animated-background-text"
- ).innerHTML = `${langs.animated_background_text}`;
- document.getElementById(
- "minimize_music"
- ).innerHTML = `${langs.minimize_music}`;
- document.getElementById(
- "keep_music_opened"
- ).innerHTML = `${langs.keep_music_opened}`;
- document.getElementById(
- "code-login-text"
- ).innerHTML = `${langs.code_login_text}`;
- document.getElementById("code-btn").innerHTML = `${langs.send}`;
- document.getElementById("cancel-code-btn").innerHTML = `${langs.cancel}`;
}
async initNews() {
@@ -3034,6 +2945,15 @@ class Home {
}
});
+ document.getElementById("header-text-to-add").addEventListener("click", () => {
+ console.log("click");
+ if (os.platform() === "win32") {
+ shell.openExternal("https://battlylauncher.com/premium?utm_source=launcher&utm_medium=header&utm_campaign=premium");
+ } else {
+ window.open("https://battlylauncher.com/premium", "_blank");
+ }
+ });
+
async function LoadMinecraftNews() {
function compareDates(a, b) {
@@ -3541,7 +3461,7 @@ class Home {
enable: loaderEnable,
},
verify: false,
- ignored: ["loader"],
+ ignored: ["loader", "libraries"],
java: false,
memory: memory,
};
@@ -3607,21 +3527,19 @@ class Home {
console.log(error);
}
}
-
async function initializeLaunch() {
switch (true) {
case version === "1.8":
await handleLaunch(launch.launch.bind(launch), opts);
break;
case version_real.endsWith("-forge") || version_real.endsWith("-fabric") || version_real.endsWith("-quilt"):
- await handleLaunch(launch_core.Launch.bind(launch_core), opts);
+ await launch_core.Launch(opts);
break;
case version.endsWith("-extra"):
handleLaunch(launch.launch.bind(launch), opts);
break;
default:
- await handleLaunch(launch_core.Launch.bind(launch_core), { ...opts, flag: true });
- break;
+ await launch_core.Launch(opts);
}
}
@@ -3815,7 +3733,8 @@ class Home {
launch.on("close", (code) => {
consoleOutput_ += `---------- [MC] Código de salida: ${code}\n ----------`;
- if (launcherSettings.launcher.close === "close-launcher") ipcRenderer.send("main-window-show");
+ if (launcherSettings.launcher.close === "close-launcher")
+ ipcRenderer.send("main-window-show");
ipcRenderer.send("updateStatus", {
status: "online",
@@ -3860,6 +3779,7 @@ class Home {
});
launch_core.on("debug", (e) => {
+ console.log(e);
consoleOutput_ += `[MC] ${JSON.stringify(e, null, 2)}\n`;
const errorMap = {
"Failed to start due to TypeError": `${langs.error_detected_one} \nError:\n${e}`,
@@ -3887,6 +3807,7 @@ class Home {
});
launch_core.on("data", async (e) => {
+ console.log(e);
new logger("Minecraft", "#36b030");
consoleOutput_ += `[MC] ${e}\n`;
@@ -3987,6 +3908,7 @@ class Home {
});
launch_core.on("progress", (progress, size) => {
+ console.log(progress, size);
consoleOutput_ += `[DESCARGANDO] ${progress} / ${size}\n`;
if (!seMostroInstalando_core) {
seMostroInstalando_core = true;
@@ -4012,6 +3934,42 @@ class Home {
progressBar1.value = progress_actual;
progressBar1.max = 100;
});
+
+ launch_core.on("error", (err) => {
+ consoleOutput_ += `[ERROR] ${JSON.stringify(err, null, 2)}\n`;
+ console.log(JSON.stringify(err, null, 2));
+ progressBar1.style.display = "none";
+ info.style.display = "none";
+ playBtn.style.display = "";
+ return new Alert().ShowAlert({
+ title: "Error",
+ text: `Error al iniciar Minecraft. Error desconocido. Vuelve a iniciar Minecraft. [ERROR: 7] \nError: ${err.error}`,
+ icon: "error",
+ button: "Aceptar",
+ });
+ });
+
+ launch_core.on("close", (code) => {
+ consoleOutput_ += `---------- [MC] Código de salida: ${code}\n ----------`;
+
+ if (launcherSettings.launcher.close === "close-launcher")
+ ipcRenderer.send("main-window-show");
+
+ ipcRenderer.send("updateStatus", {
+ status: "online",
+ details: langs.in_the_menu,
+ username: account.name,
+ });
+ info.style.display = "none";
+ playBtn.style.display = "";
+ footermodaliniciarversion.style.display = "";
+ textInfo.innerHTML = "Selecciona la versión que quieres abrir";
+ new logger("Launcher", "#3e8ed0");
+ console.log("🔧 Minecraft cerrado");
+ document.getElementById("carga-de-versiones").style.display = "none";
+ progressBar1.style.display = "none";
+ ipcRenderer.send("delete-and-new-status-discord");
+ });
});
@@ -5636,17 +5594,19 @@ class Home {
});
launch.on("close", (e) => {
- //eliminar el modaldiv1
- modalDiv1.remove();
if (launcherSettings.launcher.close === "close-launcher")
ipcRenderer.send("main-window-show");
+
+
ipcRenderer.send("updateStatus", {
status: "online",
details: langs.in_the_menu,
username: account.name,
});
+
+ modalDiv1.remove();
});
//download status
@@ -5681,12 +5641,14 @@ class Home {
version = version.replace("-optifine", "");
// Obtén el valor de fileName desde los datos de la versión
- let fileName = "";
- let realVersion = "";
+ let fileName;
+ let realVersion;
+ let requiredJavaVersion;
for (let i = 0; i < optifineVersions.length; i++) {
if (optifineVersions[i].realVersion == version) {
fileName = optifineVersions[i].fileName;
realVersion = optifineVersions[i].realVersion;
+ requiredJavaVersion = optifineVersions[i].requiredJavaVersion;
}
}
@@ -6131,68 +6093,51 @@ class Home {
}
async function CheckAndDownloadJava() {
- if (!fs.existsSync(`${dataDirectory}/.battly/versions/1.20.1`)) {
+ // Cargar todas las carpetas de %appdata%/.battly/runtime, si existe, buscar si existe alguna carpeta que empieze por %appdata%/.battly/runtime/${requiredJavaVersion}
+ // Si existe, poner la ruta en el input
+ // Si no existe, mostrar un mensaje de error y no permitir continuar
+ let folders = fs.readdirSync(`${dataDirectory}/.battly/runtime`);
+ let found = false;
+ let realJavaVersion;
+ folders.forEach((folder) => {
+ if (folder.startsWith(requiredJavaVersion)) {
+ found = true;
+ realJavaVersion = folder;
+ }
+ });
+
+ if (!found) {
modalDiv1.remove();
new Alert().ShowAlert({
icon: "error",
- title: langs.version_java_error_title,
- text: langs.version_java_error,
+ title: langs.download_the_version_in_vanilla,
+ text: langs.download_the_version_in_vanilla_text,
});
+
return false;
} else {
const inputRutaJava =
document.getElementById("ruta-java-input");
if (process.platform === "win32") {
- if (
- fs.existsSync(
- `${dataDirectory}/.battly/runtime/jre-17.0.8-win32`
- )
- ) {
- //si existe, poner la ruta en el input
- inputRutaJava.value = `${dataDirectory}/.battly/runtime/jre-17.0.8-win32/bin/java.exe`;
- localStorage.setItem(
- "java-path",
- `${dataDirectory}/.battly/runtime/jre-17.0.8-win32/bin/java.exe`
- );
- } else if (
- fs.existsSync(
- `${dataDirectory}/.battly/runtime/jre-17.0.1.12.1-win32`
- )
- ) {
- //si existe, poner la ruta en el input
- inputRutaJava.value = `${dataDirectory}/.battly/runtime/jre-17.0.1.12.1-win32/bin/java.exe`;
- localStorage.setItem(
- "java-path",
- `${dataDirectory}/.battly/runtime/jre-17.0.1.12.1-win32/bin/java.exe`
- );
- } else if (
- fs.existsSync(
- `${dataDirectory}/.battly/runtime/jre-17.0.8-windows-x64`
- )
- ) {
- inputRutaJava.value = `${dataDirectory}/.battly/runtime/jre-17.0.8-windows-x64/bin/java.exe`;
- localStorage.setItem(
- "java-path",
- `${dataDirectory}/.battly/runtime/jre-17.0.8-windows-x64/bin/java.exe`
- );
- } else if (
- fs.existsSync(
- `${dataDirectory}/.battly/runtime/jre-17.0.1.12.1-windows-x64`
- )
- ) {
- inputRutaJava.value = `${dataDirectory}/.battly/runtime/jre-17.0.1.12.1-windows-x64/bin/java.exe`;
- localStorage.setItem(
- "java-path",
- `${dataDirectory}/.battly/runtime/jre-17.0.1.12.1-windows-x64/bin/java.exe`
- );
+ let javaPath = `${dataDirectory}/.battly/runtime/${realJavaVersion}/bin/java.exe`;
+ if (fs.existsSync(javaPath)) {
+ inputRutaJava.value = javaPath;
+ localStorage.setItem("java-path", javaPath);
+ console.log(`Java reconfigurado a ${javaPath}`);
} else {
inputRutaJava.value =
"Java no encontrado. Haz click aquí para buscarlo.";
}
} else {
- inputRutaJava.value =
- "Java no encontrado. Haz click aquí para buscarlo.";
+ let javaPath = `${dataDirectory}/.battly/runtime/${realJavaVersion}/bin/java`;
+ if (fs.existsSync(javaPath)) {
+ inputRutaJava.value = javaPath;
+ localStorage.setItem("java-path", javaPath);
+ } else {
+ inputRutaJava.value =
+ "Java no encontrado. Haz click aquí para buscarlo.";
+ }
}
}
@@ -6876,7 +6821,7 @@ class Home {
: false,
},
verify: false,
- ignored: ["loader", ...this.config.ignored],
+ ignored: ["loader", "libraries"],
java: false,
memory: {
min: `${ram.ramMin * 1024}M`,
@@ -6922,7 +6867,7 @@ class Home {
: false,
},
verify: false,
- ignored: ["loader", ...this.config.ignored],
+ ignored: ["loader", "libraries"],
java: false,
memory: {
min: `${ram.ramMin * 1024}M`,
@@ -6964,7 +6909,7 @@ class Home {
: false,
},
verify: false,
- ignored: ["loader", ...this.config.ignored],
+ ignored: ["loader", "libraries"],
java: false,
memory: {
min: `${ram.ramMin * 1024}M`,
@@ -7010,7 +6955,7 @@ class Home {
: false,
},
verify: false,
- ignored: ["loader", ...this.config.ignored],
+ ignored: ["loader", "libraries"],
java: false,
memory: {
min: `${ram.ramMin * 1024}M`,
diff --git a/src/assets/js/panels/login.js b/src/assets/js/panels/login.js
index c187a44..20da0ad 100644
--- a/src/assets/js/panels/login.js
+++ b/src/assets/js/panels/login.js
@@ -8,11 +8,17 @@
import { database, changePanel, addAccount, accountSelect } from '../utils.js';
import { Alert } from '../utils/alert.js';
const { ipcRenderer, shell } = require('electron');
-import { Lang } from "../utils/lang.js";
const Swal = require("./assets/js/libs/sweetalert/sweetalert2.all.min.js");
+const { Lang } = require("./assets/js/utils/lang.js");
let lang;
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
+
class Login {
static id = "login";
@@ -480,6 +486,14 @@ class Login {
else isPremium = premiums.includes(account.name);
addAccount(account, isPremium);
+ if (isPremium) {
+ document.getElementById("header-text-to-add").innerHTML = "Premium Edition";
+ document.getElementById("header-frame").style.background = `radial-gradient(ellipse farthest-corner at right bottom, #FEDB37 0%, #FDB931 8%, #9f7928 30%, #8A6E2F 40%, transparent 80%),
+ radial - gradient(ellipse farthest - corner at left top, #FFFFFF 0 %, #FFFFAC 8 %, #D1B464 25 %, #5d4a1f 62.5 %, #5d4a1f 100 %);`;
+ } else {
+ document.getElementById("header-frame").style.background = `#212121`;
+ }
+
infoLoginPanel.classList.remove("is-active");
await accountSelect(account.uuid)
diff --git a/src/assets/js/panels/mods.js b/src/assets/js/panels/mods.js
index a7e5be4..b2884e2 100644
--- a/src/assets/js/panels/mods.js
+++ b/src/assets/js/panels/mods.js
@@ -31,8 +31,16 @@ const Toast = Swal.mixin({
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
})
+
+const { Lang } = require("./assets/js/utils/lang.js");
let lang;
-import { Lang } from "../utils/lang.js";
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
+
+
import { Alert } from "../utils/alert.js";
class Mods {
diff --git a/src/assets/js/panels/music.js b/src/assets/js/panels/music.js
index 2c1f47c..c566938 100644
--- a/src/assets/js/panels/music.js
+++ b/src/assets/js/panels/music.js
@@ -13,9 +13,15 @@ const dataDirectory = `${process.env.APPDATA || (process.platform == 'darwin' ?
const fs = require('fs');
let musicList_ = [];
-import { Lang } from "../utils/lang.js";
-import { Alert } from "../utils/alert.js";
+const { Lang } = require("./assets/js/utils/lang.js");
let lang;
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
+
+import { Alert } from "../utils/alert.js";
class Music {
static id = "music";
@@ -320,9 +326,7 @@ class Music {
paragraph.innerText = `${lang.getting} ${song.name} (${newMusicList.length}/${playlist.songs.length})`;
await ytdl.getInfo(song.url, { quality: 'highestaudio' })
.then(info => {
- console.log(info)
- const audioFormat = info.formats.find(format => format.mimeType.includes('audio/mp4'));
- console.log(audioFormat)
+ const audioFormat = info.formats.find(format => format.mimeType && format.mimeType.includes('audio/mp4'));
if (!audioFormat) {
console.error("No se encontró un formato de audio adecuado");
@@ -427,6 +431,10 @@ class Music {
setTimeout(() => {
modal.remove();
}, 5000);
+
+ loadMusic(1);
+ playMusic();
+ playingSong();
});
const playIconSpan = document.createElement('span');
@@ -493,7 +501,7 @@ class Music {
function playAudioFromVideoId(videoId) {
ytdl.getInfo(videoId, { quality: 'highestaudio' })
.then(info => {
- const audioFormat = info.formats.find(format => format.mimeType.includes('audio/mp4'));
+ const audioFormat = info.formats.find(format => format.mimeType && format.mimeType.includes('audio/mp4'));
if (!audioFormat) {
console.error("No se encontró un formato de audio adecuado");
diff --git a/src/assets/js/panels/settings.js b/src/assets/js/panels/settings.js
index 2f4cd4e..f6db1e7 100644
--- a/src/assets/js/panels/settings.js
+++ b/src/assets/js/panels/settings.js
@@ -26,16 +26,21 @@ const Toast = Swal.mixin({
},
});
-import { Lang } from "../utils/lang.js";
import { Alert } from "../utils/alert.js";
+
+const { Lang } = require("./assets/js/utils/lang.js");
let lang;
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
class Settings {
static id = "settings";
async init(config) {
this.config = config;
this.database = await new database().init();
- lang = await new Lang().GetLang();
this.initSettingsDefault();
this.initTab();
this.initAccount();
@@ -231,6 +236,23 @@ class Settings {
});
});
+ document.getElementById("language-selector").value = localStorage.getItem("lang");
+ document.getElementById("language-selector-btn").addEventListener("click", () => {
+ let lang_ = document.getElementById("language-selector");
+
+ new Alert().ShowAlert({
+ title: lang.changing_language,
+ text: lang.changing_language_text,
+ icon: "info",
+ });
+
+ localStorage.setItem("lang", lang_.value);
+
+ setTimeout(() => {
+ ipcRenderer.send("restartLauncher");
+ }, 4000);
+ });
+
document
.getElementById("background-btn")
.addEventListener("click", async (e) => {
@@ -247,12 +269,41 @@ class Settings {
document.getElementById("animated-background-div").style.display = "";
document.getElementById("not-animated-background-div").style.display =
"none";
+ document.getElementById("launchboost-panel").style.display = "block";
+ } else {
+ isPremium = false;
+ document.getElementById("not-animated-background-div").style.display =
+ "";
+ document.getElementById("animated-background-div").style.display =
+ "none";
+ document.getElementById("launchboost-panel").style.display = "none";
+ }
+ });
+
+ document
+ .getElementById("launcher-btn")
+ .addEventListener("click", async (e) => {
+ let uuid = (await this.database.get("1234", "accounts-selected")).value;
+ let account = this.database
+ .getAccounts()
+ .find((account) => account.uuid === uuid.selected);
+ let isPremium;
+
+ const accountDiv = document.getElementById(account.uuid);
+ const accountName = accountDiv.querySelector(".account-name");
+ if (accountName.querySelector(".fa-fire")) {
+ isPremium = true;
+ document.getElementById("animated-background-div").style.display = "";
+ document.getElementById("not-animated-background-div").style.display =
+ "none";
+ document.getElementById("launchboost-panel").style.display = "block";
} else {
isPremium = false;
document.getElementById("not-animated-background-div").style.display =
"";
document.getElementById("animated-background-div").style.display =
"none";
+ document.getElementById("launchboost-panel").style.display = "none";
}
});
@@ -439,6 +490,22 @@ class Settings {
sonido_inicio.volume = 0.8;
sonido_inicio.play();
});
+
+
+ document.getElementById("launchboost").addEventListener("click", () => {
+ const fs = require("fs");
+
+ if (document.getElementById("launchboost").checked) {
+ localStorage.setItem("launchboost", "yes");
+ fs.writeFileSync(
+ `${dataDirectory}\\.battly\\launchboost`,
+ "launchboost"
+ );
+ } else {
+ localStorage.removeItem("launchboost");
+ fs.unlinkSync(`${dataDirectory}\\.battly\\launchboost`);
+ }
+ });
}
initAccount() {
diff --git a/src/assets/js/update.js b/src/assets/js/update.js
index 75d574d..11118c0 100644
--- a/src/assets/js/update.js
+++ b/src/assets/js/update.js
@@ -14,7 +14,7 @@ let lang;
const pkgVersion = async () => {
const pkg = {
- version: "2.0.3",
+ version: "2.1.0",
buildVersion: 1004
};
return pkg;
diff --git a/src/assets/js/utils.js b/src/assets/js/utils.js
index 72cc132..e235479 100644
--- a/src/assets/js/utils.js
+++ b/src/assets/js/utils.js
@@ -11,8 +11,14 @@ const axios = require('axios');
const { ipcRenderer } = require('electron');
import { Alert } from "./utils/alert.js";
+const { Lang } = require("./assets/js/utils/lang.js");
let lang;
-import { Lang } from "./utils/lang.js";
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
+
export {
config as config,
@@ -24,10 +30,6 @@ export {
accountSelect as accountSelect
}
-async function Langs() {
- lang = await new Lang().GetLang();
-}
-
let db;
async function LoadDatabase() {
db = await new database().init();
@@ -37,8 +39,6 @@ async function LoadDatabase() {
LoadDatabase();
-Langs();
-
function changePanel(id) {
const rectangulos = document.querySelectorAll('.rectangulo');
const preloadContent = document.querySelector('.preload-content');
@@ -100,7 +100,7 @@ async function addAccount(data, isPremium) {
}
function accountSelect(uuid) {
- console.log(`✅ Cuenta seleccionada: ${uuid}`)
+ console.log(`✅ Cuenta seleccionada: ${uuid}`);
let account = document.getElementById(uuid);
let activeAccount = document.querySelector('.active-account');
@@ -125,6 +125,10 @@ function accountSelect(uuid) {
document.getElementById("ads").style.display = "none";
// document.getElementById("ads-text").style.display = "none";
console.log('Es premium');
+ document.getElementById("header-text-to-add").innerHTML = "Premium Edition";
+ document.getElementById("header-frame").style.background = `linear-gradient(45deg, #C9A635, #B8860B, #A1752D, #8B6914, #70590E)`;
+
+
let WelcomePremiumShown = localStorage.getItem('WelcomePremiumShown');
if (!WelcomePremiumShown || WelcomePremiumShown === 'false' || WelcomePremiumShown === null || WelcomePremiumShown === undefined) {
const modal = document.createElement('div');
@@ -232,6 +236,9 @@ function accountSelect(uuid) {
document.body.appendChild(modal);
}
+ } else {
+ document.getElementById("header-text-to-add").innerHTML = "Free Edition";
+ document.getElementById("header-frame").style.background = `#212121`;
}
//headplayer(pseudo);
}
diff --git a/src/assets/js/utils/alert.js b/src/assets/js/utils/alert.js
index ef45ef8..e5eb3eb 100644
--- a/src/assets/js/utils/alert.js
+++ b/src/assets/js/utils/alert.js
@@ -10,7 +10,7 @@ let isAnimating = false;
let alertQueue = [];
class Alert {
- constructor() {}
+ constructor() { }
async ShowAlert(info) {
if (isAnimating) {
@@ -99,9 +99,13 @@ class Alert {
panelbig.classList.remove('big-zoom');
panel.classList.add('active-alert');
- await this.wait(3600);
+ await this.wait(200);
+
+ panelText.style.whiteSpace = 'normal';
+ await this.wait(3400);
panel.classList.remove('active-alert');
+ panelText.style.whiteSpace = 'nowrap';
await this.wait(300);
@@ -118,7 +122,7 @@ class Alert {
async wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
-
+
}
export { Alert };
diff --git a/src/assets/js/utils/crash-report.js b/src/assets/js/utils/crash-report.js
index 387a93a..1fd0f4a 100644
--- a/src/assets/js/utils/crash-report.js
+++ b/src/assets/js/utils/crash-report.js
@@ -7,12 +7,20 @@ const { ipcRenderer } = require("electron");
const fs = require("fs");
const path = require("path");
const { shell } = require("electron");
-import { Lang } from "./lang.js";
-
+const { Lang } = require("./assets/js/utils/lang.js");
let lang;
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
+
+let showed;
class CrashReport {
async ShowCrashReport(error) {
+ if (showed) return;
+ showed = true;
lang = await new Lang().GetLang();
let audioError = new Audio("./assets/audios/error.mp3");
audioError.play();
@@ -105,6 +113,7 @@ class CrashReport {
closeButton.textContent = lang["close"];
closeButton.addEventListener("click", () => {
modalDiv.remove();
+ showed = false;
});
const checkSolution = document.createElement("button");
@@ -233,7 +242,7 @@ class CrashReport {
errorTitle.style.fontSize = "27px";
errorTitle.style.fontWeight = "700";
errorTitle.innerText = solution.name;
-
+
const errorParagraph = document.createElement("p");
errorParagraph.style.color = "#fff";
errorParagraph.style.fontSize = "16px";
@@ -262,7 +271,7 @@ class CrashReport {
}
}
});
-
+
setTimeout(() => {
if (!solucionEncontrada) {
@@ -279,7 +288,7 @@ class CrashReport {
setTimeout(() => {
if (!solucionEncontrada) {
paragraph.innerHTML += `
${lang["searching_solution_taking_3"]}`;
-
+
const closeButton = document.createElement("button");
closeButton.className = "button is-danger";
closeButton.textContent = lang["close"];
@@ -291,7 +300,7 @@ class CrashReport {
modalCardBody.appendChild(closeButton);
}
}, 30000);
-
+
});
checkSolution.innerHTML = ' ' + lang["find_solution"] + '';
diff --git a/src/assets/js/utils/lang.js b/src/assets/js/utils/lang.js
index eb7d681..63e6659 100644
--- a/src/assets/js/utils/lang.js
+++ b/src/assets/js/utils/lang.js
@@ -1,22 +1,70 @@
-/**
- * @author TECNO BROS
-
- */
+const fetch = require("node-fetch");
+const fs = require("fs");
+const path = require("path");
+
+const dataDirectory = process.env.APPDATA || (process.platform == "darwin" ? `${process.env.HOME}/Library/Application Support` : process.env.HOME);
+let stringsCache;
+let isLoadingCache = false;
class Lang {
- async GetLang() {
- let langLocalStorage = localStorage.getItem("lang") ? localStorage.getItem("lang") : "en";
-
- try {
- const langModule = await import(`../../langs/${langLocalStorage}.js`);
- const langFile = langModule.default;
-
- return langFile;
-
- } catch (error) {
- console.error(error);
- }
+ GetLang() {
+ return new Promise((resolve, reject) => {
+ const langLocalStorage = localStorage.getItem("lang") ? localStorage.getItem("lang") : "en";
+
+ if (!stringsCache && !isLoadingCache) {
+ isLoadingCache = true;
+ console.log("Cache doesn't exist, fetching from API...");
+ fetch(`https://api.battlylauncher.com/launcher/langs/${langLocalStorage}`)
+ .then(res => res.json())
+ .then(data => {
+ const { strings, version } = data;
+ const localStorageLangVersion = localStorage.getItem("langVersion") ? localStorage.getItem("langVersion") : 0;
+
+
+ if (version !== localStorageLangVersion) {
+ localStorage.setItem("langVersion", version);
+
+ if (!fs.existsSync(path.join(dataDirectory, ".battly", "battly", "launcher", "langs"))) {
+ fs.mkdirSync(path.join(dataDirectory, ".battly", "battly", "launcher", "langs"), { recursive: true });
+ }
+
+ fs.writeFileSync(path.join(dataDirectory, ".battly", "battly", "launcher", "langs", `${langLocalStorage}.json`), JSON.stringify(strings), "utf8");
+ }
+
+ stringsCache = strings;
+ isLoadingCache = false;
+ resolve(stringsCache);
+ })
+ .catch(error => {
+ console.error("Error fetching from API:", error);
+ this.readLangFromFile(langLocalStorage, resolve, reject);
+ });
+ } else if (stringsCache && !isLoadingCache) {
+ console.log("Cache exists, returning it...");
+ console.log(stringsCache);
+ resolve(stringsCache);
+ } else {
+ console.log("Cache is loading, waiting...");
+ const interval = setInterval(() => {
+ if (!isLoadingCache) {
+ clearInterval(interval);
+ resolve(stringsCache);
+ }
+ }, 100);
+ }
+ });
+ }
+
+ readLangFromFile(langLocalStorage, resolve, reject) {
+ fs.readFile(path.join(dataDirectory, ".battly", "battly", "launcher", "langs", `${langLocalStorage}.json`), "utf8", (err, data) => {
+ if (err) {
+ console.error(err);
+ reject(err);
+ return;
+ }
+ resolve(JSON.parse(data));
+ });
}
}
-export { Lang };
\ No newline at end of file
+module.exports = { Lang };
diff --git a/src/assets/js/utils/load-minecraft.js b/src/assets/js/utils/load-minecraft.js
index 6447597..fc8dbf3 100644
--- a/src/assets/js/utils/load-minecraft.js
+++ b/src/assets/js/utils/load-minecraft.js
@@ -13,18 +13,17 @@ const Launcher = new Launch();
import { consoleOutput } from "./logger.js";
let consoleOutput_ = + consoleOutput;
import { logger, database, changePanel } from "../utils.js";
-import { Lang } from "./lang.js";
import { CrashReport } from "./crash-report.js";
const got = require("got");
const dataDirectory = process.env.APPDATA || (process.platform == "darwin" ? `${process.env.HOME}/Library/Application Support` : process.env.HOME);
const ShowCrashReport = new CrashReport().ShowCrashReport;
+const { Lang } = require("./assets/js/utils/lang.js");
let langs;
-
-async function LoadLang() {
- langs = await new Lang().GetLang();
-}
-
-LoadLang();
+new Lang().GetLang().then(lang_ => {
+ langs = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
class LoadMinecraft {
async LaunchMinecraft(options) {
@@ -486,6 +485,8 @@ class LoadMinecraft {
console.error(err);
consoleOutput_ += `[ERROR] ${JSON.stringify(err, null, 2)}\n`;
+ if (err.type === "request-timeout") return
+
modalDiv1.remove();
return ShowCrashReport(
diff --git a/src/assets/js/utils/loadAPI.js b/src/assets/js/utils/loadAPI.js
index e4d63be..2df9799 100644
--- a/src/assets/js/utils/loadAPI.js
+++ b/src/assets/js/utils/loadAPI.js
@@ -11,7 +11,7 @@ let news = `${url}/launcher/news-launcher/news.json`;
const axios = require("axios")
const https = require("https")
const httpsAgent = new https.Agent({
- rejectUnauthorized: false,
+ rejectUnauthorized: false,
});
const fs = require("fs");
const path = require("path");
@@ -22,13 +22,19 @@ const versionsURL = "https://api.battlylauncher.com/battlylauncher/launcher/conf
const versionsMojangURL = "https://launchermeta.mojang.com/mc/game/version_manifest_v2.json";
const loadingText = document.getElementById("loading-text");
-import { Lang } from "./lang.js";
-
const offlineMode = localStorage.getItem("offline-mode")
-let lang = await new Lang().GetLang();
+const { Lang } = require("./assets/js/utils/lang.js");
+let lang;
+new Lang().GetLang().then(lang_ => {
+ lang = lang_;
+}).catch(error => {
+ console.error("Error:", error);
+});
+
class LoadAPI {
constructor() {
+ this.lang = lang;
}
async GetConfig() {
loadingText.innerHTML = lang.loading_config;
@@ -156,7 +162,7 @@ class LoadAPI {
console.log(err);
return Promise.reject(err);
}
- }
+ }
}
}
}
diff --git a/src/assets/js/windows/mainWindow.js b/src/assets/js/windows/mainWindow.js
index d6b8b09..e7c317c 100644
--- a/src/assets/js/windows/mainWindow.js
+++ b/src/assets/js/windows/mainWindow.js
@@ -126,7 +126,7 @@ async function createWindow() {
});
} else {
if (mainWindow) {
- mainWindow.openDevTools();
+ //mainWindow.openDevTools();
mainWindow.show();
}
}
diff --git a/src/assets/langs/es.js b/src/assets/langs/es.js
index c858a62..9d5d2a6 100644
--- a/src/assets/langs/es.js
+++ b/src/assets/langs/es.js
@@ -249,6 +249,9 @@ const strings = {
version_java_error_title: "No puedes jugar versiones externas",
version_java_error:
"Para jugarlas, descarga la 1.20.1 de vanilla para que se configure Java.",
+ download_the_version_in_vanilla: "Descarga la versión en Vanilla",
+ download_the_version_in_vanilla_text:
+ "Para poder jugar esta versión, necesitas descargarla en Vanilla para que se configure Java automáticamente.",
installing_minecraft_files: "Instalando archivos de Minecraft",
client_files_downloaded_successfully: "Archivos del cliente completados",
you_dont_have_friends_1: "No tienes amigos...😔 ¡Añade a alguien!",
diff --git a/src/launcher.html b/src/launcher.html
index 3d54042..127a3c8 100644
--- a/src/launcher.html
+++ b/src/launcher.html
@@ -116,6 +116,7 @@
top: 30px;
left: 50%;
width: auto;
+ max-width: 70%;
z-index: 99999;
display: flex;
justify-content: center;
@@ -125,7 +126,8 @@
.panelalert {
width: 55px;
- height: 60px;
+ height: auto;
+ min-height: 60px;
overflow: hidden;
position: relative;
border-radius: 10px;
@@ -134,6 +136,8 @@
align-items: center;
margin: 0 auto;
z-index: 99999;
+ padding-top: 5px;
+ padding-bottom: 5px;
}
.panelalert img {
@@ -147,15 +151,16 @@
.panelalert-text {
flex: 1;
overflow: hidden;
+ white-space: nowrap;
opacity: 0;
font-size: 15px;
transition: opacity 0.5s ease;
- font-family: Poppins;
- white-space: nowrap;
+ font-family: 'Poppins', sans-serif;
text-align: left;
color: #fff;
margin-top: 5px;
margin-right: 10px;
+ border-radius: 0px !important;
}
.panelalert-text strong {
@@ -178,22 +183,32 @@
#panelbig {
transform: scale(0);
transition: transform 0.5s ease;
+ max-width: 80%;
}
.panelalert.active-alert {
width: 100%;
- height: 60px;
+ min-height: 60px;
}
.panelalert.active-alert .panelalert-text {
opacity: 1;
}
+
+ .header-text-to-add {
+ margin-left: 5px;
+ }
+
+ .header-text-to-add:hover {
+ cursor: pointer;
+ color: #3498db;
+ }