mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Compare commits
3 commits
994ab5f5b0
...
7f53710d6a
Author | SHA1 | Date | |
---|---|---|---|
|
7f53710d6a | ||
|
0a7ec74b0f | ||
|
86c3636a19 |
6 changed files with 48 additions and 12 deletions
|
@ -34,6 +34,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-context-menu": "github:ArmCord/electron-context-menu",
|
"electron-context-menu": "github:ArmCord/electron-context-menu",
|
||||||
|
"os-locale": "^6.0.2",
|
||||||
"v8-compile-cache": "^2.3.0",
|
"v8-compile-cache": "^2.3.0",
|
||||||
"ws": "^8.6.0"
|
"ws": "^8.6.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,12 +12,14 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="warning" class="hidden">
|
<div id="warning" class="hidden">
|
||||||
<p>You appear to be offline. Please connect to the internet and restart ArmCord Setup.</p>
|
<p id="setup_offline">
|
||||||
|
You appear to be offline. Please connect to the internet and restart ArmCord Setup.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="setup">
|
<div id="setup">
|
||||||
<div id="logo" class="hidden"></div>
|
<div id="logo" class="hidden"></div>
|
||||||
<div id="page1" class="hidden">
|
<div id="page1" class="hidden">
|
||||||
<p>Select the type of setup you want to perform.</p>
|
<p id="setup_question1">Select the type of setup you want to perform.</p>
|
||||||
<div id="buttons">
|
<div id="buttons">
|
||||||
<button id="express" class="center">Express</button>
|
<button id="express" class="center">Express</button>
|
||||||
<button id="full" class="center">Full</button>
|
<button id="full" class="center">Full</button>
|
||||||
|
@ -25,7 +27,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="page2" class="hidden">
|
<div id="page2" class="hidden">
|
||||||
<p class="text-center setup-ask">Choose your Discord channel/instance:</p>
|
<p class="text-center setup-ask" id="setup_question2">Choose your Discord channel/instance:</p>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<select name="channel" id="channel" class="dropdown-button">
|
<select name="channel" id="channel" class="dropdown-button">
|
||||||
<option value="stable">Stable</option>
|
<option value="stable">Stable</option>
|
||||||
|
@ -34,7 +36,9 @@
|
||||||
<option value="foss">Fosscord</option>
|
<option value="foss">Fosscord</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center setup-ask">Should ArmCord handle client mods installation?</p>
|
<p class="text-center setup-ask" id="setup_question3">
|
||||||
|
Should ArmCord handle client mods installation?
|
||||||
|
</p>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<select name="csp" id="csp" class="dropdown-button">
|
<select name="csp" id="csp" class="dropdown-button">
|
||||||
<option value="true">Yes</option>
|
<option value="true">Yes</option>
|
||||||
|
@ -47,7 +51,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="page3" class="hidden">
|
<div id="page3" class="hidden">
|
||||||
<p class="text-center setup-ask">Select a client mod you want to install:</p>
|
<p class="text-center setup-ask" id="setup_question4">Select a client mod you want to install:</p>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<select name="mod" id="mod" class="dropdown-button">
|
<select name="mod" id="mod" class="dropdown-button">
|
||||||
<option value="cumcord">Cumcord</option>
|
<option value="cumcord">Cumcord</option>
|
||||||
|
@ -55,7 +59,7 @@
|
||||||
<option value="flicker">Flicker (Heavily WIP)</option>
|
<option value="flicker">Flicker (Heavily WIP)</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center">
|
<p class="text-center" id="setup_question4_clientmodnotice">
|
||||||
Why not all of them? Having many client mods at the same time can cause issues. If you really
|
Why not all of them? Having many client mods at the same time can cause issues. If you really
|
||||||
want to do it though, check our Discord ;)
|
want to do it though, check our Discord ;)
|
||||||
</p>
|
</p>
|
||||||
|
@ -65,7 +69,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
async function loadLang() {
|
||||||
|
document.getElementById("next").innerHTML = await armcord.getLang("next");
|
||||||
|
document.getElementById("setup_offline").innerHTML = await armcord.getLang("setup_offline");
|
||||||
|
document.getElementById("setup_question1").innerHTML = await armcord.getLang("setup_question1");
|
||||||
|
document.getElementById("express").innerHTML = await armcord.getLang("setup_question1_answer1");
|
||||||
|
document.getElementById("full").innerHTML = await armcord.getLang("setup_question1_answer2");
|
||||||
|
document.getElementById("setup_question2").innerHTML = await armcord.getLang("setup_question2");
|
||||||
|
document.getElementById("setup_question3").innerHTML = await armcord.getLang("setup_question3");
|
||||||
|
document.getElementById("setup_question4").innerHTML = await armcord.getLang("setup_question4");
|
||||||
|
document.getElementById("setup_question4_clientmodnotice").innerHTML = await armcord.getLang(
|
||||||
|
"setup_question4_clientmodnotice"
|
||||||
|
);
|
||||||
|
//select stuff1
|
||||||
|
document.getElementById("csp").options[1].text = await armcord.getLang("no");
|
||||||
|
document.getElementById("csp").options[0].text = await armcord.getLang("yes");
|
||||||
|
}
|
||||||
|
loadLang();
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
document.onload = function () {
|
document.onload = function () {
|
||||||
ipcRenderer.send("win-unmaximize");
|
ipcRenderer.send("win-unmaximize");
|
||||||
|
|
|
@ -60,6 +60,9 @@ export function registerIpc() {
|
||||||
ipcMain.on("channel", async (event) => {
|
ipcMain.on("channel", async (event) => {
|
||||||
event.returnValue = await getConfig("channel");
|
event.returnValue = await getConfig("channel");
|
||||||
});
|
});
|
||||||
|
ipcMain.handle("getLang", (event, toGet: string) => {
|
||||||
|
return getLang(toGet);
|
||||||
|
});
|
||||||
ipcMain.on("clientmod", async (event, arg) => {
|
ipcMain.on("clientmod", async (event, arg) => {
|
||||||
event.returnValue = await getConfig("mods");
|
event.returnValue = await getConfig("mods");
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,6 +17,10 @@ contextBridge.exposeInMainWorld("armcord", {
|
||||||
channel: ipcRenderer.sendSync("channel"),
|
channel: ipcRenderer.sendSync("channel"),
|
||||||
openTab: (number: number) => ipcRenderer.sendSync("openTab", number),
|
openTab: (number: number) => ipcRenderer.sendSync("openTab", number),
|
||||||
setLang: (lang: string) => ipcRenderer.send("setLang", lang),
|
setLang: (lang: string) => ipcRenderer.send("setLang", lang),
|
||||||
|
getLang: (toGet: string) =>
|
||||||
|
ipcRenderer.invoke("getLang", toGet).then((result) => {
|
||||||
|
return result;
|
||||||
|
}),
|
||||||
version: ipcRenderer.sendSync("get-app-version", "app-version"),
|
version: ipcRenderer.sendSync("get-app-version", "app-version"),
|
||||||
getDisplayMediaSelector: getDisplayMediaSelector,
|
getDisplayMediaSelector: getDisplayMediaSelector,
|
||||||
openSettingsWindow: () => ipcRenderer.send("openSettingsWindow")
|
openSettingsWindow: () => ipcRenderer.send("openSettingsWindow")
|
||||||
|
|
|
@ -9,9 +9,13 @@ import {ipcRenderer} from "electron";
|
||||||
import {injectTabs} from "./tabs";
|
import {injectTabs} from "./tabs";
|
||||||
var version = ipcRenderer.sendSync("get-app-version", "app-version");
|
var version = ipcRenderer.sendSync("get-app-version", "app-version");
|
||||||
async function updateLang() {
|
async function updateLang() {
|
||||||
addScript(`function getDiscordLang() {
|
if (window.location.href.indexOf("setup.html") > -1) {
|
||||||
{const _w=webpackChunkdiscord_app;let lang;_w.push([[Symbol()],{},e=>{for(const k in e.c){const m=e.c[k].exports;const mDef=m?.default&&m.__esModule?m.default:m;if(mDef?._chosenLocale&&!lang)lang=mDef}}]);_w.pop();window.armcord.setLang(lang._chosenLocale);return lang._chosenLocale;void 0}}
|
console.log("Setup, skipping lang update");
|
||||||
getDiscordLang();`);
|
} else {
|
||||||
|
addScript(`function getDiscordLang() {
|
||||||
|
{const _w=webpackChunkdiscord_app;let lang;_w.push([[Symbol()],{},e=>{for(const k in e.c){const m=e.c[k].exports;const mDef=m?.default&&m.__esModule?m.default:m;if(mDef?._chosenLocale&&!lang)lang=mDef}}]);_w.pop();window.armcord.setLang(lang._chosenLocale);return lang._chosenLocale;void 0}}
|
||||||
|
getDiscordLang();`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
// I'm sorry for this mess but I'm not sure how to fix it.
|
// I'm sorry for this mess but I'm not sure how to fix it.
|
||||||
import {BrowserWindow, shell, app, ipcMain, dialog, clipboard} from "electron";
|
import {BrowserWindow, shell, app, ipcMain, dialog, clipboard} from "electron";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import {checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig} from "./utils";
|
import {checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig, setLang} from "./utils";
|
||||||
import {registerIpc} from "./ipc";
|
import {registerIpc} from "./ipc";
|
||||||
import startServer from "./socket";
|
import startServer from "./socket";
|
||||||
import contextMenu from "electron-context-menu";
|
import contextMenu from "electron-context-menu";
|
||||||
|
@ -85,10 +85,10 @@ async function doAfterDefiningTheWindow() {
|
||||||
if ((await getConfig("inviteWebsocket")) == true) {
|
if ((await getConfig("inviteWebsocket")) == true) {
|
||||||
startServer();
|
startServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mainWindow.loadFile(contentPath);
|
mainWindow.loadFile(contentPath);
|
||||||
if (isSetup) {
|
if (isSetup) {
|
||||||
|
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
|
||||||
mainWindow.setSize(390, 470);
|
mainWindow.setSize(390, 470);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -98,6 +98,7 @@ async function doAfterDefiningTheWindow() {
|
||||||
console.log(process.platform);
|
console.log(process.platform);
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
if (firstRun) {
|
if (firstRun) {
|
||||||
|
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
|
||||||
mainWindow.setSize(390, 470);
|
mainWindow.setSize(390, 470);
|
||||||
mainWindow.loadURL(`file://${__dirname}/content/setup.html`);
|
mainWindow.loadURL(`file://${__dirname}/content/setup.html`);
|
||||||
} else {
|
} else {
|
||||||
|
@ -105,6 +106,7 @@ async function doAfterDefiningTheWindow() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (firstRun) {
|
if (firstRun) {
|
||||||
|
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
|
||||||
mainWindow.setSize(390, 470);
|
mainWindow.setSize(390, 470);
|
||||||
mainWindow.loadURL(`file://${__dirname}/ts-out/content/setup.html`);
|
mainWindow.loadURL(`file://${__dirname}/ts-out/content/setup.html`);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue