This commit is contained in:
smartfrigde 2023-08-26 19:21:55 +02:00
parent cda69b54e7
commit 6ffad523f0
4 changed files with 27 additions and 26 deletions

View file

@ -36,7 +36,7 @@
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"copyfiles": "^2.4.1",
"electron": "26.0.0",
"electron": "26.1.0",
"electron-builder": "^24.6.3",
"eslint": "^8.40.0",
"eslint-config-dmitmel": "github:dmitmel/eslint-config-dmitmel",

View file

@ -41,8 +41,8 @@ devDependencies:
specifier: ^2.4.1
version: 2.4.1
electron:
specifier: 26.0.0
version: 26.0.0
specifier: 26.1.0
version: 26.1.0
electron-builder:
specifier: ^24.6.3
version: 24.6.3
@ -1027,8 +1027,8 @@ packages:
- supports-color
dev: true
/electron@26.0.0:
resolution: {integrity: sha512-x57bdCaDvgnlc41VOm/UWihJCCiI3OxJKiBgB/e5F7Zd6avo+61mO6IzQS7Bu/k/a1KPjou25EUORR6UPKznBQ==}
/electron@26.1.0:
resolution: {integrity: sha512-qEh19H09Pysn3ibms5nZ0haIh5pFoOd7/5Ww7gzmAwDQOulRi8Sa2naeueOyIb1GKpf+6L4ix3iceYRAuA5r5Q==}
engines: {node: '>= 12.20.55'}
hasBin: true
requiresBuild: true

View file

@ -61,10 +61,7 @@ export async function setMenu(): Promise<void> {
},
{
label: "Fullscreen",
accelerator: "F11",
click() {
mainWindow.fullScreen = !mainWindow.fullScreen;
}
role: "togglefullscreen"
},
{
label: "Reload",

View file

@ -343,23 +343,27 @@ async function updateModBundle(): Promise<void> {
//waiting
}
let name: string = await getConfig("mods");
const clientMods = {
vencord: "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.js",
cordwood: "https://raw.githubusercontent.com/Cordwood/builds/master/index.js",
shelter: "https://raw.githubusercontent.com/uwu/shelter-builds/main/shelter.js",
custom: await getConfig("customJsBundle")
};
const clientModsCss = {
vencord: "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.css",
cordwood: "https://armcord.app/placeholder.css",
shelter: "https://armcord.app/placeholder.css",
custom: await getConfig("customCssBundle")
};
console.log(clientMods[name as keyof typeof clientMods]);
let bundle: string = await (await fetch(clientMods[name as keyof typeof clientMods])).text();
fs.writeFileSync(`${distFolder}bundle.js`, bundle, "utf-8");
let css: string = await (await fetch(clientModsCss[name as keyof typeof clientModsCss])).text();
fs.writeFileSync(`${distFolder}bundle.css`, css, "utf-8");
if (name == "custom") {
// aspy fix
let bundle: string = await (await fetch(await getConfig("customJsBundle"))).text();
fs.writeFileSync(`${distFolder}bundle.js`, bundle, "utf-8");
let css: string = await (await fetch(await getConfig("customCssBundle"))).text();
fs.writeFileSync(`${distFolder}bundle.css`, css, "utf-8");
} else {
const clientMods = {
vencord: "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.js",
shelter: "https://raw.githubusercontent.com/uwu/shelter-builds/main/shelter.js"
};
const clientModsCss = {
vencord: "https://github.com/Vendicated/Vencord/releases/download/devbuild/browser.css",
shelter: "https://armcord.app/placeholder.css"
};
console.log(clientMods[name as keyof typeof clientMods]);
let bundle: string = await (await fetch(clientMods[name as keyof typeof clientMods])).text();
fs.writeFileSync(`${distFolder}bundle.js`, bundle, "utf-8");
let css: string = await (await fetch(clientModsCss[name as keyof typeof clientModsCss])).text();
fs.writeFileSync(`${distFolder}bundle.css`, css, "utf-8");
}
} catch (e) {
console.log("[Mod loader] Failed to install mods");
console.error(e);