Compare commits

...

5 commits

Author SHA1 Message Date
altinat
bace17dca6
Translated using Weblate (Thai)
Currently translated at 57.4% (31 of 54 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/th/
2022-07-18 22:40:24 +02:00
smartfridge
e71376237e Update English translation 2022-07-18 21:22:04 +02:00
KayoticCarnige
cb69a35dd6
2 new things (Read desc.) (#159)
- Cleaned up ASAR packaging, ignoring unneeded files for building
- Moved install location for Windows users ("AppData\Local\Programs" -> "AppData\Local"
2022-07-18 20:53:25 +02:00
smartfridge
408c4b5f7b Merge remote-tracking branch 'origin/dev' into dev 2022-07-18 17:14:01 +02:00
smartfridge
0fb71dfe2b Add Cordwood, better Hummus support and skip splash 2022-07-18 17:13:52 +02:00
10 changed files with 116 additions and 14 deletions

View file

@ -31,7 +31,7 @@
"settings-channel-desc2": "you're probably most familiar with this one. It's the one you see in default Discord\n client!", "settings-channel-desc2": "you're probably most familiar with this one. It's the one you see in default Discord\n client!",
"settings-channel-desc3": "this is alpha test release of Discord. By using it you gain access to the newest\n features and fixes.", "settings-channel-desc3": "this is alpha test release of Discord. By using it you gain access to the newest\n features and fixes.",
"settings-channel-desc4": "public test build. Receives features earlier than stable but is a bit older than Canary.", "settings-channel-desc4": "public test build. Receives features earlier than stable but is a bit older than Canary.",
"settings-channel-desc5": "unofficial instance of Discord that takes you back to 2016! None of the client mods\n bundled with ArmCord work with it. It's run by community, so you take all the risk by using it.", "settings-channel-desc5": "unofficial instance of Discord that takes you back to 2016! Only client mod\n available to run alongside with it is Cordwood. It's run by community, so you take all the risk by\n using it.",
"settings-invitewebsocket": "Invite Websocket", "settings-invitewebsocket": "Invite Websocket",
"settings-invitewebsocket-desc": "When enabled ArmCord will support Discord.gg links which means that if you open an invite link in your\n browser, ArmCord will automatically accept the invite. Can be unresponsive at times.", "settings-invitewebsocket-desc": "When enabled ArmCord will support Discord.gg links which means that if you open an invite link in your\n browser, ArmCord will automatically accept the invite. Can be unresponsive at times.",
"settings-altPaste": "Alternative Paste", "settings-altPaste": "Alternative Paste",

View file

@ -14,7 +14,7 @@
"setup_question4": "เลือกไคลเอนต์มอดที่ต้องการติดตั้ง:", "setup_question4": "เลือกไคลเอนต์มอดที่ต้องการติดตั้ง:",
"settings-prfmMode-battery": "ประหยัดแบตเตอรี่", "settings-prfmMode-battery": "ประหยัดแบตเตอรี่",
"setup_question4_clientmodnotice": "ทำไมไม่ใช้พร้อมกันทั้งหมดล่ะ? การมีไคลเอนต์มอดหลายตัวพร้อมกันอาจทำให้เกิดปัญหาได้ หากต้องการที่จะทำจริงๆ ให้ไปดูใน Discord ของเรา", "setup_question4_clientmodnotice": "ทำไมไม่ใช้พร้อมกันทั้งหมดล่ะ? การมีไคลเอนต์มอดหลายตัวพร้อมกันอาจทำให้เกิดปัญหาได้ หากต้องการที่จะทำจริงๆ ให้ไปดูใน Discord ของเรา",
"settings-theme": "ธีม ArmCord:", "settings-theme": "ธีม ArmCord",
"settings-theme-default": "ค่าเริ่มต้น", "settings-theme-default": "ค่าเริ่มต้น",
"settings-theme-native": "ดั้งเดิม", "settings-theme-native": "ดั้งเดิม",
"settings-tray": "ย่อขนาดหน้าต่าง", "settings-tray": "ย่อขนาดหน้าต่าง",
@ -28,17 +28,17 @@
"settings-save": "บันทึกการตั้งค่า", "settings-save": "บันทึกการตั้งค่า",
"settings-updater": "ตรวจหาการอัปเดต", "settings-updater": "ตรวจหาการอัปเดต",
"settings-mobileMode": "โหมดมือถือ", "settings-mobileMode": "โหมดมือถือ",
"settings-theme-desc1": "ArmCord \"themes\" manage apps behaviour and looks.", "settings-theme-desc1": "\"ธีม\" ของ ArmCord เป็นการจัดการลักษณะและการทำงานของแอป",
"settings-patches-desk": "Fetches automatic patches that are distributed if release turns out to have bugs after release. Usually\n you don't have to keep this enabled, unless notified in support Discord.", "settings-patches-desk": "Fetches automatic patches that are distributed if release turns out to have bugs after release. Usually\n you don't have to keep this enabled, unless notified in support Discord.",
"settings-mobileMode-desc": "If you're on a device with touch-screen this feature is for you! It activates Discord's hidden mobile\n mode meant for phones and tablets. Only major feature missing is voice chat support. This is ideal for\n users on PinePhone and similar.", "settings-mobileMode-desc": "If you're on a device with touch-screen this feature is for you! It activates Discord's hidden mobile\n mode meant for phones and tablets. Only major feature missing is voice chat support. This is ideal for\n users on PinePhone and similar.",
"settings-channel-desc1": "You can use this setting to change current instance of Discord:", "settings-channel-desc1": "You can use this setting to change current instance of Discord:",
"settings-channel-desc2": "you're probably most familiar with this one. It's the one you see in default Discord\n client!", "settings-channel-desc2": "you're probably most familiar with this one. It's the one you see in default Discord\n client!",
"settings-altPaste": "Alternative Paste", "settings-altPaste": "Alternative Paste",
"settings-trayIcon": "Tray icon", "settings-trayIcon": "Tray icon",
"settings-theme-desc2": "this is how ArmCord looks when you first launch it. It includes recreation of Discord's\n custom titlebar and ArmCord specific styles injected into Discord.", "settings-theme-desc2": "นี่คือหน้าตา ArmCord ตอนที่เปิดครั้งแรก เป็นการปรับปรุงจากหน้าตาเดิมของ Discord\n แถบชื่อหน้าต่างและหน้าตาใหม่ ๆ ที่ ArmCord เปลี่ยน Discord",
"settings-theme-desc3": "uses native titlebar of OS you're currently running (e.g Windows 7/10). Functions more\n similar to actual Discord app on Linux.", "settings-theme-desc3": "ใช้แถบชื่อหน้าต่างเริ่มต้นของระบบปฏิบัติการที่กำลังใช้อยู่ (เช่น Windows 7/10) ตัวเลือกคล้ายกันกับ\n แอป Discord ใน Linux",
"settings-csp-desc": "ArmCord CSP is our system that manages loading custom content loading into the Discord app. Stuff like\n client mods and themes depend on it. Disable if you want to get rid of mods and custom styles.", "settings-csp-desc": "ArmCord CSP คือระบบที่จัดการการโหลดเนื้อหากำหนดเองลงไปในแอป Discord สิ่งอย่างเช่น สิ่งอย่างเช่น\n ไคลแอนต์มอด ธีม ต้องใช้มัน สามารถปิดใช้งานได้หากต้องการปิดมอดและหน้าตากำหนดเอง",
"settings-tray-desc": "When disabled, ArmCord will close like any other window when closed, otherwise it'll sit back and relax\n in your system tray for later.", "settings-tray-desc": "เมื่อปิด ArmCord จะปิดเหมือนหน้าตาอื่น ๆ เมื่อปิด ไม่อย่างนั้นมันจะนั่งนิ่ง\n ในถาดระบบภายหลัง",
"settings-channel-desc3": "this is alpha test release of Discord. By using it you gain access to the newest\n features and fixes.", "settings-channel-desc3": "this is alpha test release of Discord. By using it you gain access to the newest\n features and fixes.",
"settings-channel-desc4": "public test build. Receives features earlier than stable but is a bit older than Canary.", "settings-channel-desc4": "public test build. Receives features earlier than stable but is a bit older than Canary.",
"settings-channel-desc5": "unofficial instance of Discord that takes you back to 2016! None of the client mods\n bundled with ArmCord work with it. It's run by community, so you take all the risk by using it.", "settings-channel-desc5": "unofficial instance of Discord that takes you back to 2016! None of the client mods\n bundled with ArmCord work with it. It's run by community, so you take all the risk by using it.",

8
build/installer.nsh Normal file
View file

@ -0,0 +1,8 @@
!macro preInit
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\ArmCord"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\ArmCord"
SetRegView 32
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\ArmCord"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\ArmCord"
!macroend

View file

@ -40,6 +40,17 @@
"ws": "^8.8.0" "ws": "^8.8.0"
}, },
"build": { "build": {
"nsis": {
"include": "build/installer.nsh"
},
"files": [
"!*",
"assets",
"node_modules",
"ts-out",
"package.json",
"LICENSE"
],
"appId": "com.smartfridge.armcord", "appId": "com.smartfridge.armcord",
"productName": "ArmCord", "productName": "ArmCord",
"mac": { "mac": {

View file

@ -28,7 +28,7 @@ const unstrictCSP = () => {
"https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js", "https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js",
"https://raw.githubusercontent.com/Cumcord/Cumcord/master/dist/build.js", "https://raw.githubusercontent.com/Cumcord/Cumcord/master/dist/build.js",
"https://raw.githubusercontent.com/FlickerMod/dist/main/build.js", "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js",
"https://localhost:1234/dist.js" "https://raw.githubusercontent.com/Cordwood/builds/master/index.js"
]; ];
electron.session.defaultSession.webRequest.onHeadersReceived(({responseHeaders, url}, done) => { electron.session.defaultSession.webRequest.onHeadersReceived(({responseHeaders, url}, done) => {

View file

@ -3,7 +3,7 @@ import "./capturer";
import "./patch"; 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 {injectHummusTitlebar, injectTitlebar} from "./titlebar";
import {sleep, addStyle, injectJS, addScript} from "../utils"; import {sleep, addStyle, injectJS, addScript} from "../utils";
import {ipcRenderer} from "electron"; import {ipcRenderer} from "electron";
import {injectMobileStuff} from "./mobile"; import {injectMobileStuff} from "./mobile";
@ -25,7 +25,8 @@ declare global {
const clientMods = { const clientMods = {
goosemod: "https://api.goosemod.com/inject.js", goosemod: "https://api.goosemod.com/inject.js",
cumcord: "https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js", cumcord: "https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js",
flicker: "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js" flicker: "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js",
cordwood: "https://raw.githubusercontent.com/Cordwood/builds/master/index.js"
}; };
console.log("ArmCord " + version); console.log("ArmCord " + version);
@ -36,8 +37,12 @@ if (window.location.href.indexOf("splash.html") > -1) {
console.log("Skipping titlebar injection and client mod injection."); console.log("Skipping titlebar injection and client mod injection.");
} else { } else {
if (ipcRenderer.sendSync("titlebar")) { if (ipcRenderer.sendSync("titlebar")) {
if (ipcRenderer.sendSync("channel")) {
injectHummusTitlebar();
} else {
injectTitlebar(); injectTitlebar();
} }
}
if (ipcRenderer.sendSync("mobileMode")) { if (ipcRenderer.sendSync("mobileMode")) {
injectMobileStuff(); injectMobileStuff();
} }
@ -61,6 +66,11 @@ if (window.location.href.indexOf("splash.html") > -1) {
console.log("Loading FlickerMod..."); console.log("Loading FlickerMod...");
await updateLang(); await updateLang();
break; break;
case "cordwood":
injectJS(clientMods.cordwood);
console.log("Loading Cordwood...");
await updateLang();
break;
} }
}); });
} }

View file

@ -54,3 +54,42 @@ export function injectTitlebar() {
}); });
}); });
} }
export function injectHummusTitlebar() {
document.addEventListener("DOMContentLoaded", function (event) {
var elem = document.createElement("div");
elem.innerHTML = `
<button class="win-minimize" id="minimize"></button><button class="win-maximize" id="maximize"></button><button class="win-close" id="quit"></button>
`;
elem.classList.add("win-buttons");
elem.classList.add("win-buttons-light");
document.getElementsByClassName("titlebar")[0].appendChild(elem);
document.body.setAttribute("customTitlebar", "");
document.body.setAttribute("armcord-platform", os.platform());
addStyle(".chat>.title-wrap {width: 87% !important;}");
addStyle(".friends-header {width: 91% !important;}");
var minimize = document.getElementById("minimize");
var maximize = document.getElementById("maximize");
var quit = document.getElementById("quit");
minimize!.addEventListener("click", () => {
ipcRenderer.send("win-minimize");
});
maximize!.addEventListener("click", () => {
if (ipcRenderer.sendSync("win-isMaximized") == true) {
ipcRenderer.send("win-unmaximize");
document.body.removeAttribute("isMaximized");
} else if (ipcRenderer.sendSync("win-isNormal") == true) {
ipcRenderer.send("win-maximize");
}
});
quit!.addEventListener("click", () => {
if (ipcRenderer.sendSync("minimizeToTray") === true) {
ipcRenderer.send("win-hide");
} else if (ipcRenderer.sendSync("minimizeToTray") === false) {
ipcRenderer.send("win-quit");
}
});
});
}

View file

@ -112,8 +112,9 @@
<b>PTB</b> - public test build. Receives features earlier than stable but is a bit older than <b>PTB</b> - public test build. Receives features earlier than stable but is a bit older than
Canary. Canary.
<br /> <br />
<b>Hummus</b> - unofficial instance of Discord that takes you back to 2016! None of the client mods <b>Hummus</b> - unofficial instance of Discord that takes you back to 2016! Only client mod
bundled with ArmCord work with it. It's run by community, so you take all the risk by using it. available to run alongside with it is Cordwood. It's run by community, so you take all the risk by
using it.
</p> </p>
</div> </div>
</div> </div>
@ -168,6 +169,13 @@
<br /> <br />
<br /> <br />
<h1 class="center advancedText">Advanced user zone⚠</h1> <h1 class="center advancedText">Advanced user zone⚠</h1>
<div class="switch acAltPaste">
<label class="header2" id="settings-skipSplash">Skip splash screen (experimental)</label>
<input class="tgl tgl-light left" id="skipSplash" type="checkbox" />
<label class="tgl-btn left" for="skipSplash"></label>
<p class="description2">Skips ArmCord splash screen when you start up the app.</p>
</div>
<br />
<button id="settings-pluginsFolder" class="center">Open plugins folder</button> <button id="settings-pluginsFolder" class="center">Open plugins folder</button>
<br /> <br />
<button id="settings-themesFolder" class="center">Open themes folder</button> <button id="settings-themesFolder" class="center">Open themes folder</button>
@ -206,6 +214,7 @@
document.getElementById("tray").checked = await settings.get("minimizeToTray"); document.getElementById("tray").checked = await settings.get("minimizeToTray");
document.getElementById("websocket").checked = await settings.get("inviteWebsocket"); document.getElementById("websocket").checked = await settings.get("inviteWebsocket");
document.getElementById("alternativePaste").checked = await settings.get("alternativePaste"); document.getElementById("alternativePaste").checked = await settings.get("alternativePaste");
document.getElementById("skipSplash").checked = await settings.get("skipSplash");
document.getElementById("mobile").checked = await settings.get("mobileMode"); document.getElementById("mobile").checked = await settings.get("mobileMode");
document.getElementById("patches").value = await settings.get("automaticPatches"); document.getElementById("patches").value = await settings.get("automaticPatches");
document.getElementById("mod").value = await settings.get("mods"); document.getElementById("mod").value = await settings.get("mods");
@ -222,6 +231,7 @@
armcordCSP: document.getElementById("csp").checked, armcordCSP: document.getElementById("csp").checked,
minimizeToTray: document.getElementById("tray").checked, minimizeToTray: document.getElementById("tray").checked,
alternativePaste: document.getElementById("alternativePaste").checked, alternativePaste: document.getElementById("alternativePaste").checked,
skipSplash: document.getElementById("skipSplash").checked,
automaticPatches: document.getElementById("patches").checked, automaticPatches: document.getElementById("patches").checked,
mods: document.getElementById("mod").value, mods: document.getElementById("mod").value,
mobileMode: document.getElementById("mobile").checked, mobileMode: document.getElementById("mobile").checked,

View file

@ -42,6 +42,7 @@ export function setup() {
alternativePaste: false, alternativePaste: false,
mods: "cumcord", mods: "cumcord",
performanceMode: "none", performanceMode: "none",
skipSplash: false,
inviteWebsocket: true, inviteWebsocket: true,
mobileMode: false, mobileMode: false,
trayIcon: "ac_plug_colored", trayIcon: "ac_plug_colored",
@ -191,6 +192,7 @@ export interface Settings {
alternativePaste: boolean; alternativePaste: boolean;
mods: string; mods: string;
mobileMode: boolean, mobileMode: boolean,
skipSplash: boolean,
performanceMode: string; performanceMode: string;
inviteWebsocket: boolean; inviteWebsocket: boolean;
trayIcon: string; trayIcon: string;

View file

@ -125,9 +125,31 @@ async function doAfterDefiningTheWindow() {
await setLang(Intl.DateTimeFormat().resolvedOptions().locale) await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
mainWindow.setSize(390, 470); mainWindow.setSize(390, 470);
await mainWindow.loadFile(path.join(__dirname, "/content/setup.html")); await mainWindow.loadFile(path.join(__dirname, "/content/setup.html"));
} else {
if (await getConfig("skipSplash") == true) {
switch (await getConfig("channel")) {
case "stable":
mainWindow.loadURL("https://discord.com/app");
break;
case "canary":
mainWindow.loadURL("https://canary.discord.com/app");
break;
case "ptb":
mainWindow.loadURL("https://ptb.discord.com/app");
break;
case "hummus":
mainWindow.loadURL("https://hummus.sys42.net/");
break;
case undefined:
mainWindow.loadURL("https://discord.com/app");
break;
default:
mainWindow.loadURL("https://discord.com/app");
}
} else { } else {
await mainWindow.loadFile(path.join(__dirname, "/content/splash.html")); await mainWindow.loadFile(path.join(__dirname, "/content/splash.html"));
} }
}
} }
export function createCustomWindow() { export function createCustomWindow() {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({