Skip to content

Commit

Permalink
Update 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
1ly4s0 committed Aug 25, 2024
1 parent 29e0dea commit d1ea10c
Show file tree
Hide file tree
Showing 25 changed files with 696 additions and 642 deletions.
272 changes: 53 additions & 219 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
Binary file removed src/1002.zip
Binary file not shown.
18 changes: 16 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/launcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
html,
body {
height: 100%;
overflow: hidden;
overflow: hidden !important;
}

body {
Expand Down
28 changes: 23 additions & 5 deletions src/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -31,8 +38,6 @@ class Splash {
}

async LoadLang() {
lang = await new Lang().GetLang();
this.message.innerHTML = lang.salutate;
}

async start() {
Expand All @@ -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');
Expand Down
48 changes: 30 additions & 18 deletions src/assets/js/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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";
Expand All @@ -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() {
Expand Down Expand Up @@ -170,7 +182,7 @@ class Launcher {
)
.then((response) => response.json())
.then((data) => data)
.catch((err) => {});
.catch((err) => { });
} catch (error) {
premiums = [];
}
Expand Down
10 changes: 8 additions & 2 deletions src/assets/js/panels/friends.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,24 @@ 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 {
static id = "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();
Expand Down
Loading

0 comments on commit d1ea10c

Please sign in to comment.