mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Compare commits
No commits in common. "b7a0d1face086183b5af151421db4b60abf4591d" and "3957bb1c57935077c4a751ee40ff0f4ef37474ba" have entirely different histories.
b7a0d1face
...
3957bb1c57
11 changed files with 20 additions and 73 deletions
|
@ -14,6 +14,7 @@
|
|||
"setup_question4": "Select a client mod you want to install:",
|
||||
"setup_question4_clientmodnotice": "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 documentation.",
|
||||
"settings-theme": "ArmCord Theme:",
|
||||
"settings-theme-tabs": "Tabs (experimental)",
|
||||
"settings-theme-default": "Default",
|
||||
"settings-theme-native": "Native",
|
||||
"settings-tray": "Minimize to tray",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"settings-updater": "Controlla gli aggiornamenti",
|
||||
"settings-mod": "Client mod:",
|
||||
"settings-theme": "ArmCord Theme:",
|
||||
"settings-theme-tabs": "Tabs (experimental)",
|
||||
"settings-theme-default": "Default",
|
||||
"settings-theme-native": "Native",
|
||||
"settings-patches": "Automatic Patches",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"settings-save": "Save settings",
|
||||
"settings-updater": "Check for updates",
|
||||
"settings-theme": "ArmCord Theme:",
|
||||
"settings-theme-tabs": "Tabs (experimental)",
|
||||
"settings-theme-default": "Default",
|
||||
"settings-theme-native": "Native",
|
||||
"settings-patches": "Automatic Patches",
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
"settings-updater": "Check voor updates",
|
||||
"settings-patches": "Automatische Patches",
|
||||
"settings-theme": "ArmCord Thema:",
|
||||
"settings-theme-tabs": "Tabs (experimenteel)",
|
||||
"settings-theme-default": "Standaard",
|
||||
"settings-theme-native": "Native",
|
||||
"settings-invitewebsocket": "discord.gg support",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"settings-save": "Zapisz ustawienia",
|
||||
"settings-mod": "Modyfikacja klienta:",
|
||||
"settings-theme": "Motyw ArmCord:",
|
||||
"settings-theme-tabs": "Karty (eksperymentalne)",
|
||||
"settings-theme-default": "Domyślny",
|
||||
"settings-theme-native": "Natywny",
|
||||
"settings-patches": "Automatyczne łatki",
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"loading_screen_start": "เริ่มต้น ArmCord…",
|
||||
"loading_screen_start": "กำลังเริ่ม ArmCord…",
|
||||
"loading_screen_offline": "ดูเหมือนว่าคุณออฟไลน์อยู่ โปรดเชื่อมต่ออินเทอร์เน็ตและลองใหม่อีกครั้ง",
|
||||
"loading_screen_update": "ArmCord เวอร์ชันใหม่พร้อมใช้งานแล้ว โปรดอัปเดตเป็นเวอร์ชันล่าสุด",
|
||||
"setup_question1": "เลือกประเภทการติดตั้งที่คุณต้องการ:",
|
||||
"setup_question1_answer1": "ติดตั้งแบบรวดเร็ว",
|
||||
"setup_question1_answer2": "การตั้งค่าเต็มรูปแบบ",
|
||||
"setup_question1_answer1": "ติดตั้งแบบน้ำหนักเบา",
|
||||
"setup_question1_answer2": "ติดตั้งแบบเต็ม",
|
||||
"setup_offline": "ดูเหมือนว่าคุณออฟไลน์อยู่ โปรดเชื่อมต่ออินเทอร์เน็ตและลองใหม่อีกครั้ง",
|
||||
"setup_question2": "เลือกช่อง/อินสแตนส์ Discord:",
|
||||
"setup_question3": "ต้องการให้ ArmCord จัดการการติดตั้งมอดของไคลเอนต์หรือไม่?",
|
||||
|
|
18
src/ipc.ts
18
src/ipc.ts
|
@ -1,7 +1,7 @@
|
|||
//ipc stuff
|
||||
import {app, ipcMain, shell, desktopCapturer} from "electron";
|
||||
import {mainWindow} from "./window";
|
||||
import {setConfigBulk, getVersion, getConfig, setLang, getLang, getWindowState} from "./utils";
|
||||
import {setConfigBulk, getVersion, getConfig, setLang, getLang} from "./utils";
|
||||
import {customTitlebar} from "./main";
|
||||
import {createSettingsWindow} from "./settings/main";
|
||||
export function registerIpc() {
|
||||
|
@ -41,22 +41,8 @@ export function registerIpc() {
|
|||
ipcMain.on("get-app-version", (event) => {
|
||||
event.returnValue = getVersion();
|
||||
});
|
||||
ipcMain.on("splashEnd", async (event, arg) => {
|
||||
try {
|
||||
var width = await getWindowState("width") ?? 800;
|
||||
var height= await getWindowState("height") ?? 600;
|
||||
var isMaximized = await getWindowState("isMaximized") ?? false;
|
||||
} catch (e) {
|
||||
console.log("No window state file found. Fallbacking to default values.")
|
||||
ipcMain.on("splashEnd", (event, arg) => {
|
||||
mainWindow.setSize(800, 600);
|
||||
}
|
||||
if (isMaximized) {
|
||||
mainWindow.setSize(800, 600); //just so the whole thing doesn't cover whole screen
|
||||
mainWindow.maximize()
|
||||
} else {
|
||||
mainWindow.setSize(width, height);
|
||||
console.log("Not maximized.")
|
||||
}
|
||||
});
|
||||
ipcMain.on("restart", (event, arg) => {
|
||||
app.relaunch();
|
||||
|
|
|
@ -15,6 +15,7 @@ contextBridge.exposeInMainWorld("armcord", {
|
|||
},
|
||||
electron: process.versions.electron,
|
||||
channel: ipcRenderer.sendSync("channel"),
|
||||
openTab: (number: number) => ipcRenderer.sendSync("openTab", number),
|
||||
setLang: (lang: string) => ipcRenderer.send("setLang", lang),
|
||||
getLang: (toGet: string) =>
|
||||
ipcRenderer.invoke("getLang", toGet).then((result) => {
|
||||
|
|
14
src/tray.ts
14
src/tray.ts
|
@ -1,6 +1,6 @@
|
|||
import {app, Menu, Tray} from "electron";
|
||||
import {mainWindow} from "./window";
|
||||
import { getConfig, setWindowState } from "./utils";
|
||||
import {getConfig} from "./utils";
|
||||
import * as path from "path";
|
||||
import {createSettingsWindow} from "./settings/main";
|
||||
import {platform} from "process";
|
||||
|
@ -22,12 +22,6 @@ app.whenReady().then(async () => {
|
|||
{
|
||||
label: "Quit ArmCord",
|
||||
click: function () {
|
||||
let [width, height] = mainWindow.getSize()
|
||||
setWindowState({
|
||||
width: width,
|
||||
height: height,
|
||||
isMaximized: mainWindow.isMaximized()
|
||||
})
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
|
@ -70,12 +64,6 @@ app.whenReady().then(async () => {
|
|||
{
|
||||
label: "Quit ArmCord",
|
||||
click: function () {
|
||||
let [width, height] = mainWindow.getSize()
|
||||
setWindowState({
|
||||
width: width,
|
||||
height: height,
|
||||
isMaximized: mainWindow.isMaximized()
|
||||
})
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
|
|
27
src/utils.ts
27
src/utils.ts
|
@ -137,33 +137,6 @@ export async function getLang(object: string) {
|
|||
let parsed = JSON.parse(rawdata);
|
||||
return parsed[object];
|
||||
}
|
||||
|
||||
//ArmCord Window State manager
|
||||
export interface WindowState {
|
||||
width: number;
|
||||
height: number;
|
||||
isMaximized: boolean;
|
||||
}
|
||||
export async function setWindowState(object: WindowState) {
|
||||
const userDataPath = app.getPath("userData");
|
||||
const storagePath = path.join(userDataPath, "/storage/");
|
||||
const saveFile = storagePath + "window.json";
|
||||
if (!fs.existsSync(saveFile)) {
|
||||
fs.writeFileSync(saveFile, "{}", "utf-8");
|
||||
}
|
||||
let toSave = JSON.stringify(object);
|
||||
fs.writeFileSync(saveFile, toSave, "utf-8");
|
||||
}
|
||||
export async function getWindowState(object: string) {
|
||||
const userDataPath = app.getPath("userData");
|
||||
const storagePath = path.join(userDataPath, "/storage/");
|
||||
const settingsFile = storagePath + "window.json";
|
||||
let rawdata = fs.readFileSync(settingsFile, "utf-8");
|
||||
let returndata = JSON.parse(rawdata);
|
||||
console.log(object + ": " + returndata[object]);
|
||||
return returndata[object];
|
||||
|
||||
}
|
||||
//ArmCord Settings/Storage manager
|
||||
|
||||
export interface Settings {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// I'm sorry for this mess but I'm not sure how to fix it.
|
||||
import {BrowserWindow, shell, app, dialog} from "electron";
|
||||
import path from "path";
|
||||
import {checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig, setLang, setWindowState} from "./utils";
|
||||
import {checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig, setLang} from "./utils";
|
||||
import {registerIpc} from "./ipc";
|
||||
import startServer from "./socket";
|
||||
import contextMenu from "electron-context-menu";
|
||||
|
@ -72,12 +72,6 @@ async function doAfterDefiningTheWindow() {
|
|||
return callback({});
|
||||
});
|
||||
mainWindow.on("close", async (e) => {
|
||||
let [width, height] = mainWindow.getSize()
|
||||
setWindowState({
|
||||
width: width,
|
||||
height: height,
|
||||
isMaximized: mainWindow.isMaximized()
|
||||
})
|
||||
if (await getConfig("minimizeToTray")) {
|
||||
e.preventDefault();
|
||||
mainWindow.hide();
|
||||
|
|
Loading…
Reference in a new issue