mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Compare commits
No commits in common. "410c899c84346c4c92194eaf4f9a77e14117a392" and "e518c0f04ede5f715e5da5ca23cecb8c87dbcb97" have entirely different histories.
410c899c84
...
e518c0f04e
5 changed files with 14 additions and 39 deletions
|
@ -7,7 +7,7 @@
|
||||||
"no": "Nie",
|
"no": "Nie",
|
||||||
"next": "Dalej",
|
"next": "Dalej",
|
||||||
"setup_question4": "Wybierz modyfikację klienta którą chcesz zainstalować:",
|
"setup_question4": "Wybierz modyfikację klienta którą chcesz zainstalować:",
|
||||||
"setup_question4_clientmodnotice": "Dlaczego nie wszystkie na raz? Posiadanie wielu modyfikacji może spowodować wiele błędów. Jeśli jednak nalegasz możesz sprawdzić naszego Discorda.",
|
"setup_question4_clientmodnotice": "Dlaczego nie wszystkie na raz? Posiadanie wielu modyfikacji może spowodować wiele błędów. Jeśli jednak nalegasz możesz sprawdzić naszą dokumentację.",
|
||||||
"loading_screen_start": "Ładowanie ArmCord…",
|
"loading_screen_start": "Ładowanie ArmCord…",
|
||||||
"loading_screen_offline": "Wydaje nam się, że nie jesteś połączony z Internetem. Połącz się z internetem i spróbuj ponownie.",
|
"loading_screen_offline": "Wydaje nam się, że nie jesteś połączony z Internetem. Połącz się z internetem i spróbuj ponownie.",
|
||||||
"setup_question1_answer1": "Ekspresowa konfiguracja",
|
"setup_question1_answer1": "Ekspresowa konfiguracja",
|
||||||
|
@ -24,9 +24,9 @@
|
||||||
"settings-theme-default": "Domyślny",
|
"settings-theme-default": "Domyślny",
|
||||||
"settings-theme-native": "Natywny",
|
"settings-theme-native": "Natywny",
|
||||||
"settings-patches": "Automatyczne łatki",
|
"settings-patches": "Automatyczne łatki",
|
||||||
"settings-invitewebsocket": "Websocket dla zaproszeń",
|
"settings-invitewebsocket": "Wsparcie linków discord.gg",
|
||||||
"settings-prfmMode": "Tryb wydajności:",
|
"settings-prfmMode": "Performance mode:",
|
||||||
"settings-prfmMode-performance": "Wydajny",
|
"settings-prfmMode-performance": "Performance",
|
||||||
"settings-prfmMode-battery": "Bateria",
|
"settings-prfmMode-battery": "Battery",
|
||||||
"settings-none": "Nic/Brak"
|
"settings-none": "None"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//ipc stuff
|
//ipc stuff
|
||||||
import {app, ipcMain, shell, desktopCapturer} from "electron";
|
import {app, ipcMain, shell, desktopCapturer} from "electron";
|
||||||
import {createTabsGuest, mainWindow} from "./window";
|
import {createTabsGuest, mainWindow} from "./window";
|
||||||
import {setConfigBulk, getVersion, getConfig, setLang} from "./utils";
|
import {setConfigBulk, getVersion, getConfig} from "./utils";
|
||||||
import {customTitlebar, tabs} from "./main";
|
import {customTitlebar, tabs} from "./main";
|
||||||
import {createSettingsWindow} from "./settings/main";
|
import {createSettingsWindow} from "./settings/main";
|
||||||
export function registerIpc() {
|
export function registerIpc() {
|
||||||
|
@ -11,9 +11,6 @@ export function registerIpc() {
|
||||||
ipcMain.on("openTab", (event, number: number) => {
|
ipcMain.on("openTab", (event, number: number) => {
|
||||||
createTabsGuest(number);
|
createTabsGuest(number);
|
||||||
});
|
});
|
||||||
ipcMain.on("setLang", (event, lang: string) => {
|
|
||||||
setLang(lang);
|
|
||||||
});
|
|
||||||
ipcMain.on("open-external-link", (event, href: string) => {
|
ipcMain.on("open-external-link", (event, href: string) => {
|
||||||
shell.openExternal(href);
|
shell.openExternal(href);
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,6 @@ contextBridge.exposeInMainWorld("armcord", {
|
||||||
electron: process.versions.electron,
|
electron: process.versions.electron,
|
||||||
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),
|
|
||||||
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")
|
||||||
|
|
|
@ -4,15 +4,11 @@ import "./patch";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import {injectTitlebar} from "./titlebar";
|
import {injectTitlebar} from "./titlebar";
|
||||||
import {sleep, addStyle, injectJS, addScript} from "../utils";
|
import {sleep, addStyle, injectJS} from "../utils";
|
||||||
import {ipcRenderer} from "electron";
|
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() {
|
|
||||||
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 {
|
||||||
armcord: any;
|
armcord: any;
|
||||||
|
@ -34,7 +30,7 @@ if (window.location.href.indexOf("splash.html") > -1) {
|
||||||
if (ipcRenderer.sendSync("tabs")) {
|
if (ipcRenderer.sendSync("tabs")) {
|
||||||
injectTabs();
|
injectTabs();
|
||||||
}
|
}
|
||||||
sleep(5000).then(async () => {
|
sleep(5000).then(() => {
|
||||||
const cssPath = path.join(__dirname, "../", "/content/css/discord.css");
|
const cssPath = path.join(__dirname, "../", "/content/css/discord.css");
|
||||||
addStyle(fs.readFileSync(cssPath, "utf8"));
|
addStyle(fs.readFileSync(cssPath, "utf8"));
|
||||||
|
|
||||||
|
@ -42,17 +38,14 @@ if (window.location.href.indexOf("splash.html") > -1) {
|
||||||
case "goosemod":
|
case "goosemod":
|
||||||
injectJS(clientMods.goosemod);
|
injectJS(clientMods.goosemod);
|
||||||
console.log("Loading GooseMod...");
|
console.log("Loading GooseMod...");
|
||||||
await updateLang();
|
|
||||||
break;
|
break;
|
||||||
case "cumcord":
|
case "cumcord":
|
||||||
injectJS(clientMods.cumcord);
|
injectJS(clientMods.cumcord);
|
||||||
console.log("Loading Cumcord...");
|
console.log("Loading Cumcord...");
|
||||||
await updateLang();
|
|
||||||
break;
|
break;
|
||||||
case "flicker":
|
case "flicker":
|
||||||
injectJS(clientMods.flicker);
|
injectJS(clientMods.flicker);
|
||||||
console.log("Loading FlickerMod...");
|
console.log("Loading FlickerMod...");
|
||||||
await updateLang();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
20
src/utils.ts
20
src/utils.ts
|
@ -88,8 +88,8 @@ export async function injectElectronFlags() {
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
const presets = {
|
const presets = {
|
||||||
performance: `--enable-gpu-rasterization --enable-zero-copy --ignore-gpu-blocklist --enable-hardware-overlays=single-fullscreen,single-on-top,underlay --enable-features=EnableDrDc,CanvasOopRasterization,BackForwardCache:TimeToLiveInBackForwardCacheInSeconds/300/should_ignore_blocklists/true/enable_same_site/true,ThrottleDisplayNoneAndVisibilityHiddenCrossOriginIframes,UseSkiaRenderer,WebAssemblyLazyCompilation --disable-features=Vulkan --force_high_performance_gpu`, // Performance
|
'performance': `--enable-gpu-rasterization --enable-zero-copy --ignore-gpu-blocklist --enable-hardware-overlays=single-fullscreen,single-on-top,underlay --enable-features=EnableDrDc,CanvasOopRasterization,BackForwardCache:TimeToLiveInBackForwardCacheInSeconds/300/should_ignore_blocklists/true/enable_same_site/true,ThrottleDisplayNoneAndVisibilityHiddenCrossOriginIframes,UseSkiaRenderer,WebAssemblyLazyCompilation --disable-features=Vulkan --force_high_performance_gpu`, // Performance
|
||||||
battery: "--enable-features=TurnOffStreamingMediaCachingOnBattery --force_low_power_gpu" // Known to have better battery life for Chromium?
|
'battery': '--enable-features=TurnOffStreamingMediaCachingOnBattery --force_low_power_gpu' // Known to have better battery life for Chromium?
|
||||||
};
|
};
|
||||||
switch (await getConfig("performanceMode")) {
|
switch (await getConfig("performanceMode")) {
|
||||||
case "performance":
|
case "performance":
|
||||||
|
@ -104,20 +104,6 @@ export async function injectElectronFlags() {
|
||||||
console.log("No performance modes set");
|
console.log("No performance modes set");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export async function setLang(language: string) {
|
|
||||||
const userDataPath = app.getPath("userData");
|
|
||||||
const storagePath = path.join(userDataPath, "/storage/");
|
|
||||||
const langConfigFile = storagePath + "lang.json";
|
|
||||||
if (!fs.existsSync(langConfigFile)) {
|
|
||||||
fs.writeFileSync(langConfigFile, "{}", "utf-8");
|
|
||||||
}
|
|
||||||
let rawdata = fs.readFileSync(langConfigFile, "utf-8");
|
|
||||||
let parsed = JSON.parse(rawdata);
|
|
||||||
parsed["lang"] = language;
|
|
||||||
let toSave = JSON.stringify(parsed);
|
|
||||||
fs.writeFileSync(langConfigFile, toSave, "utf-8");
|
|
||||||
}
|
|
||||||
|
|
||||||
//ArmCord Settings/Storage manager
|
//ArmCord Settings/Storage manager
|
||||||
|
|
||||||
export interface Settings {
|
export interface Settings {
|
||||||
|
@ -127,7 +113,7 @@ export interface Settings {
|
||||||
minimizeToTray: boolean;
|
minimizeToTray: boolean;
|
||||||
automaticPatches: boolean;
|
automaticPatches: boolean;
|
||||||
mods: string;
|
mods: string;
|
||||||
performanceMode: string;
|
performanceMode: string,
|
||||||
blurType: string;
|
blurType: string;
|
||||||
inviteWebsocket: boolean;
|
inviteWebsocket: boolean;
|
||||||
doneSetup: boolean;
|
doneSetup: boolean;
|
||||||
|
|
Loading…
Reference in a new issue