From 2956d8b8a9afce34212c59cef5467ac58b3e905d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 16:36:58 +0000 Subject: [PATCH 01/34] Bump electron-builder from 23.2.0 to 23.1.0 Bumps [electron-builder](https://github.com/electron-userland/electron-builder/tree/HEAD/packages/electron-builder) from 23.2.0 to 23.1.0. - [Release notes](https://github.com/electron-userland/electron-builder/releases) - [Changelog](https://github.com/electron-userland/electron-builder/blob/master/packages/electron-builder/CHANGELOG.md) - [Commits](https://github.com/electron-userland/electron-builder/commits/v23.1.0/packages/electron-builder) --- updated-dependencies: - dependency-name: electron-builder dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a204df..2cd306f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@types/ws": "^8.5.3", "copyfiles": "^2.4.1", "electron": "^19.0.7", - "electron-builder": "^23.0.3", + "electron-builder": "^23.1.0", "husky": "^8.0.1", "prettier": "^2.7.0", "typescript": "^4.7.3" From 033e5b797389a95643f3e7125c9d9e3e42882b85 Mon Sep 17 00:00:00 2001 From: smartfrigde <37928912+smartfrigde@users.noreply.github.com> Date: Tue, 5 Jul 2022 19:02:49 +0200 Subject: [PATCH 02/34] Forgot to remove debug thing --- src/preload/titlebar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preload/titlebar.ts b/src/preload/titlebar.ts index 7ce8b48..a3fe1bc 100644 --- a/src/preload/titlebar.ts +++ b/src/preload/titlebar.ts @@ -26,7 +26,7 @@ export function injectTitlebar() { addStyle(fs.readFileSync(titlebarcssPath, "utf8")); addStyle(fs.readFileSync(wordmarkcssPath, "utf8")); document.body.setAttribute("customTitlebar", ""); - document.body.setAttribute("armcord-platform", "win32"); + document.body.setAttribute("armcord-platform", os.platform()); var minimize = document.getElementById("minimize"); var maximize = document.getElementById("maximize"); From 0d1e174d605aa25c70b59662299b756ce9c0d401 Mon Sep 17 00:00:00 2001 From: The_BadUser Date: Thu, 7 Jul 2022 19:25:04 +0200 Subject: [PATCH 03/34] Added translation using Weblate (Russian) --- assets/lang/ru-RU.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 assets/lang/ru-RU.json diff --git a/assets/lang/ru-RU.json b/assets/lang/ru-RU.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/assets/lang/ru-RU.json @@ -0,0 +1 @@ +{} From c4aba0bc1bf76afcc4c28f8541a687488e687193 Mon Sep 17 00:00:00 2001 From: KayoticCarnige Date: Thu, 7 Jul 2022 15:36:11 +0000 Subject: [PATCH 04/34] Translated using Weblate (English (United States)) Currently translated at 100.0% (28 of 28 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/en_US/ --- assets/lang/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/lang/en-US.json b/assets/lang/en-US.json index c1301c9..e598f49 100644 --- a/assets/lang/en-US.json +++ b/assets/lang/en-US.json @@ -25,6 +25,6 @@ "settings-prfmMode-performance": "Performance", "settings-prfmMode-battery": "Battery", "settings-none": "None", - "settings-save": "Save settings", + "settings-save": "Save Settings", "settings-updater": "Check for updates" } From 249619419fdda911d134fff666c27c41d4a628fd Mon Sep 17 00:00:00 2001 From: Azhar Pusparadhian Date: Thu, 7 Jul 2022 11:47:06 +0000 Subject: [PATCH 05/34] Translated using Weblate (Indonesian) Currently translated at 100.0% (28 of 28 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/id/ --- assets/lang/id-ID.json | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/assets/lang/id-ID.json b/assets/lang/id-ID.json index f0535d3..e09518f 100644 --- a/assets/lang/id-ID.json +++ b/assets/lang/id-ID.json @@ -1,30 +1,30 @@ { - "loading_screen_start": "Starting ArmCord…", - "loading_screen_offline": "You appear to be offline. Please connect to the Internet and try again.", - "loading_screen_update": "A new version of ArmCord is available. Please update to the latest version.", - "setup_question1": "Select what kind of setup you want to perform:", - "setup_question1_answer1": "Express setup", - "setup_question1_answer2": "Full setup", - "setup_question2": "Choose your Discord channel/instance:", - "setup_offline": "You appear to be offline. Please connect to the Internet and restart the ArmCord setup.", - "setup_question3": "Should ArmCord handle client mods installation?", - "yes": "Yes", - "no": "No", - "next": "Next", - "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-default": "Default", - "settings-theme-native": "Native", - "settings-tray": "Minimize to tray", - "settings-patches": "Automatic Patches", - "settings-channel": "Discord channel:", - "settings-invitewebsocket": "discord.gg support", - "settings-mod": "Client mod:", - "settings-save": "Save settings", - "settings-updater": "Check for updates", - "settings-prfmMode": "Performance mode:", - "settings-prfmMode-performance": "Performance", - "settings-prfmMode-battery": "Battery", - "settings-none": "None" + "loading_screen_start": "memulai ArmCord…", + "loading_screen_offline": "tampaknya anda sedang offline. Silahkan sambungkan ke internet dan coba lagi.", + "loading_screen_update": "versi terbaru ArmCord tersedia. Silahkan perbaharui ke versi terbaru.", + "setup_question1": "pilih jenis pengaturan yang ingin anda tampilkan:", + "setup_question1_answer1": "pengaturan cepat", + "setup_question1_answer2": "pengaturan penuh", + "setup_question2": "pilih saluran Discord anda/instansi:", + "setup_offline": "tampaknya anda sedang offline. silahkan sambungkan ke internet dan muat ulang ArmCord.", + "setup_question3": "bolehkah ArmCord menangani pemasangan mods klien?", + "yes": "iya", + "no": "tidak", + "next": "berikutnya", + "setup_question4": "Pilih mod klien yang ingin anda pasang:", + "setup_question4_clientmodnotice": "kenapa tidak semuanya? memiliki mod klien lebih saat bersamaan bisa menyebabkan masalah. jika anda tetap ingin melakukannya, cek di Discord kami.", + "settings-theme": "Tema ArmCord:", + "settings-theme-default": "Bawaan", + "settings-theme-native": "asli", + "settings-tray": "kecilkan ke tray", + "settings-patches": "Patch otomatis", + "settings-channel": "Saluran Discord:", + "settings-invitewebsocket": "mengajak soket web", + "settings-mod": "klien mod:", + "settings-save": "simpan pengaturan", + "settings-updater": "periksa pembaharuan", + "settings-prfmMode": "mode kinerja:", + "settings-prfmMode-performance": "kinerja", + "settings-prfmMode-battery": "Baterai", + "settings-none": "tidak ada" } From e59c074230a0024424ea5982edad0d65f93e38cc Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 7 Jul 2022 17:25:05 +0000 Subject: [PATCH 06/34] Translated using Weblate (Russian) Currently translated at 100.0% (0 of 0 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/ru/ --- assets/lang/ru-RU.json | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/assets/lang/ru-RU.json b/assets/lang/ru-RU.json index 0967ef4..e598f49 100644 --- a/assets/lang/ru-RU.json +++ b/assets/lang/ru-RU.json @@ -1 +1,30 @@ -{} +{ + "loading_screen_start": "Starting ArmCord…", + "loading_screen_offline": "You appear to be offline. Please connect to the Internet and try again.", + "loading_screen_update": "A new version of ArmCord is available. Please update to the latest version.", + "setup_question1": "Select what kind of setup you want to perform:", + "setup_question1_answer1": "Express Setup", + "setup_question1_answer2": "Full Setup", + "setup_offline": "You appear to be offline. Please connect to the internet and restart ArmCord.", + "setup_question2": "Choose your Discord channel/instance:", + "setup_question3": "Should ArmCord handle client mods installation?", + "yes": "Yes", + "no": "No", + "next": "Next", + "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 Discord.", + "settings-theme": "ArmCord theme:", + "settings-theme-default": "Default", + "settings-theme-native": "Native", + "settings-tray": "Minimize to tray", + "settings-patches": "Automatic Patches", + "settings-channel": "Discord channel:", + "settings-invitewebsocket": "Invite Websocket", + "settings-mod": "Client mod:", + "settings-prfmMode": "Performance mode:", + "settings-prfmMode-performance": "Performance", + "settings-prfmMode-battery": "Battery", + "settings-none": "None", + "settings-save": "Save Settings", + "settings-updater": "Check for updates" +} From 46a3f3e17b8ba442abdf51e99b1791c968c01987 Mon Sep 17 00:00:00 2001 From: KayoticCarnige <32397453+kckarnige@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:31:29 -0400 Subject: [PATCH 07/34] Update README.md --- README.md | 55 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 37942d8..841d3cc 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,34 @@
- -
ArmCord is a custom client designed to enhance your Discord experience while keeping everything lightweight. + +
ArmCord is a custom Discord client designed to work on any pc and enhance your Discord experience.
# Features - **Standalone client** - ArmCord is built as standalone client, it doesn't rely on original Discord client. + ArmCord is built as a standalone client and doesn't rely on the original Discord client in anyway. - **Various mods built in** - Explore Cumcord/GooseMod/Flicker plugins and their features! + Enjoy Cumcord, GooseMod, Flicker, and their many features, or have a more vanilla experience, it's your choice! -- **Made for Privacy** +- **Made for Privacy™** - ArmCord automatically blocks Discord's trackers. + ArmCord automatically blocks all of Discord's trackers; even without any client mods you can feel safe and secure! -- **Faster than normal Discord app** +- **Much more stable** - ArmCord is using newer Electron than stock Discord app. This usually means increased performance and more stable experience. + ArmCord is using a newer build of Electron than the stock Discord app. This means you can have a much more stable and secure experience, along with slightly better performance. -- **Designed to work anywhere** +- **Cross-platform support!** - ArmCord was initially created in mind to run on Arm64 Linux devices. We soon expanded our support to more platforms. We plan to support every platform that [Electron supports](https://www.electronjs.org/docs/latest/tutorial/support#supported-platforms). + ArmCord was originally created for ARM64 Linux devices, since Discord doesn't support them. We soon decided to support every platform that [Electron supports](https://github.com/electron/electron#platform-support)! # How to run/install it? ### Recommended: @@ -48,8 +48,10 @@ ArmCord is also available on the Snap store [here](https://snapcraft.io/armcord) ### Pi-Apps ArmCord is also available in [Pi-Apps](https://github.com/Botspot/pi-apps). [![badge](https://github.com/Botspot/pi-apps/blob/master/icons/badge.png?raw=true)](https://github.com/Botspot/pi-apps) -### Manual: - Alternatively you can run ArmCord from source (npm, nodejs required): + + +### Compiling: + Alternatively you can run ArmCord from source (NodeJS and npm required): 1. Clone ArmCord repo: `git clone https://github.com/ArmCord/ArmCord.git` 2. Run `npm install` to install dependencies 3. Build with `npm run build` @@ -57,24 +59,29 @@ ArmCord is also available in [Pi-Apps](https://github.com/Botspot/pi-apps). # FAQ -## 1. Will I get banned from using it? +## Will I get banned for using this? +- You are breaking [Discord ToS](https://discord.com/terms#software-in-discord%E2%80%99s-services) by using ArmCord, but no one has been banned from using it or any of the client mods included. - - You are breaking Discord ToS if you decided to use client mods. But no one ever got banned from using ArmCord or any of the client mods included. If you wish to remove mods, check our documentation. -## 2. How does this work? +## Can I use this on anything other than ARM? +- Yes! ArmCord should work normally under Windows, MacOS and Linux as long as it has Electron support. - - We are using official web app and adding some magic powder to make it all work! -## 3. Can I use this on other architectures or operating systems? +## How does this work? +- We are using the official web app and adding some magic powder to make it all work! + +## Where can I find the source code? +- The source code is on [GitHub](https://github.com/ArmCord/ArmCord/). + +## Where can I translate this? +- Translations are done using our [Weblate page](https://hosted.weblate.org/projects/armcord/armcord/). They're pushed to this [repo](https://github.com/ArmCord/i18n). - - Yes! ArmCord should work normally under Windows, Mac OS and Linux as long as it has NodeJS, npm and Electron support. -## 4. Where can I translate this? - - Translations are done using our [Weblate page](https://hosted.weblate.org/projects/armcord/armcord/). They're pushed to this [repo](https://github.com/ArmCord/i18n). # Credits -[ArmCord UI Elements and few features](https://github.com/kckarnige) +[ArmCord UI design, branding, and a few features](https://github.com/kckarnige) [Cumcord](https://github.com/Cumcord/Cumcord) -[GooseMod](https://github.com/GooseMod/GooseMod) -[GooseMod Extension](https://github.com/GooseMod/extension) +[GooseMod](https://github.com/GooseMod/GooseMod) +[GooseMod Extension](https://github.com/GooseMod/extension) +[FlickerMod](https://github.com/FlickerMod) [electron-discord-webapp](https://github.com/SpacingBat3/electron-discord-webapp) -[custom-electron-titlebar (css only)](https://github.com/AlexTorresSk/custom-electron-titlebar) +(Pre v3.0.6) [custom-electron-titlebar](https://github.com/AlexTorresSk/custom-electron-titlebar) [electron-builder](https://electron.build) [OpenAsar](https://github.com/GooseMod/OpenAsar) # Sponsors From 161b18a725fe4c99e393b8361b5c9382d3802db6 Mon Sep 17 00:00:00 2001 From: KayoticCarnige <32397453+kckarnige@users.noreply.github.com> Date: Thu, 7 Jul 2022 16:36:09 -0400 Subject: [PATCH 08/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 841d3cc..99e85d9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
- +
ArmCord is a custom Discord client designed to work on any pc and enhance your Discord experience.
From 1d916df998697bb73f33c5204dd6ac2c139a1b2e Mon Sep 17 00:00:00 2001 From: KayoticCarnige <32397453+kckarnige@users.noreply.github.com> Date: Thu, 7 Jul 2022 19:53:17 -0400 Subject: [PATCH 09/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 841d3cc..8aca84a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
-
ArmCord is a custom Discord client designed to work on any pc and enhance your Discord experience. +
ArmCord is a custom Discord client designed to run smoother and enhance your Discord experience.
# Features From 927f498872bb30ec1f5d063ad99a90ba3145176b Mon Sep 17 00:00:00 2001 From: smartfrigde <37928912+smartfrigde@users.noreply.github.com> Date: Fri, 8 Jul 2022 19:39:51 +0200 Subject: [PATCH 10/34] Move to armcord.xyz for loading files --- src/content/css/settings.css | 2 +- src/content/css/setup.css | 2 +- src/content/css/splash.css | 2 +- src/content/splash.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/css/settings.css b/src/content/css/settings.css index d4e1714..d14ec9d 100644 --- a/src/content/css/settings.css +++ b/src/content/css/settings.css @@ -38,7 +38,7 @@ SOFTWARE.*/ font-family: Whitney; font-weight: 400; font-style: normal; - src: url(https://armcord.smartfridge.space/whitney_400.woff) format("woff"); + src: url(https://armcord.xyz/whitney_400.woff) format("woff"); } html, diff --git a/src/content/css/setup.css b/src/content/css/setup.css index 9bd97fb..78f20b4 100644 --- a/src/content/css/setup.css +++ b/src/content/css/setup.css @@ -16,7 +16,7 @@ font-family: Whitney; font-weight: 400; font-style: normal; - src: url(https://armcord.smartfridge.space/whitney_400.woff) format("woff"); + src: url(https://armcord.xyz/whitney_400.woff) format("woff"); } html, diff --git a/src/content/css/splash.css b/src/content/css/splash.css index 9f84249..379948d 100644 --- a/src/content/css/splash.css +++ b/src/content/css/splash.css @@ -31,7 +31,7 @@ SOFTWARE.*/ font-family: Whitney; font-weight: 400; font-style: normal; - src: url(https://armcord.smartfridge.space/whitney_400.woff) format("woff"); + src: url(https://armcord.xyz/whitney_400.woff) format("woff"); } html, diff --git a/src/content/splash.html b/src/content/splash.html index cfaebed..90b6fcb 100644 --- a/src/content/splash.html +++ b/src/content/splash.html @@ -18,7 +18,7 @@

@@ -38,7 +38,7 @@ if (data.version !== window.armcord.version) { var elem = document.createElement("img"); elem.classList.add("logo"); - elem.src = "https://armcord.smartfridge.space/update.webp"; + elem.src = "https://armcord.xyz/update.webp"; document.body.prepend(elem); document.getElementById("splashscreen-armcord").remove(); text.innerHTML = await armcord.getLang("loading_screen_update"); From 73c9e8ecb7ca679bf2929abff6589fd485f749db Mon Sep 17 00:00:00 2001 From: The_BadUser Date: Thu, 7 Jul 2022 17:26:15 +0000 Subject: [PATCH 11/34] Translated using Weblate (Russian) Currently translated at 100.0% (28 of 28 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/ru/ --- assets/lang/ru-RU.json | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/assets/lang/ru-RU.json b/assets/lang/ru-RU.json index e598f49..af280da 100644 --- a/assets/lang/ru-RU.json +++ b/assets/lang/ru-RU.json @@ -1,30 +1,30 @@ { - "loading_screen_start": "Starting ArmCord…", - "loading_screen_offline": "You appear to be offline. Please connect to the Internet and try again.", - "loading_screen_update": "A new version of ArmCord is available. Please update to the latest version.", - "setup_question1": "Select what kind of setup you want to perform:", - "setup_question1_answer1": "Express Setup", - "setup_question1_answer2": "Full Setup", - "setup_offline": "You appear to be offline. Please connect to the internet and restart ArmCord.", - "setup_question2": "Choose your Discord channel/instance:", - "setup_question3": "Should ArmCord handle client mods installation?", - "yes": "Yes", - "no": "No", - "next": "Next", - "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 Discord.", - "settings-theme": "ArmCord theme:", - "settings-theme-default": "Default", - "settings-theme-native": "Native", - "settings-tray": "Minimize to tray", - "settings-patches": "Automatic Patches", - "settings-channel": "Discord channel:", - "settings-invitewebsocket": "Invite Websocket", - "settings-mod": "Client mod:", - "settings-prfmMode": "Performance mode:", - "settings-prfmMode-performance": "Performance", - "settings-prfmMode-battery": "Battery", - "settings-none": "None", - "settings-save": "Save Settings", - "settings-updater": "Check for updates" + "loading_screen_start": "Запуск ArmCord…", + "loading_screen_offline": "Видимо, вы не в сети. Подключитесь к Интернету и повторите попытку.", + "loading_screen_update": "Доступна новая версия ArmCord. Обновите до последней версии.", + "setup_question1": "Выберите, какую настройку хотите выполнить:", + "setup_question1_answer1": "Экспресс-настройка", + "setup_question1_answer2": "Полная настройка", + "setup_offline": "Видимо, вы не в сети. Подключитесь к Интернету и перезапустите ArmCord.", + "setup_question2": "Выберите свой канал/экземпляр Discord:", + "setup_question3": "Должен ли ArmCord заниматься установкой клиентских модов?", + "yes": "Да", + "no": "Нет", + "next": "Далее", + "setup_question4": "Выберите клиентский мод, который хотите установить:", + "setup_question4_clientmodnotice": "Почему не все? Наличие множества клиентских модов одновременно может вызвать проблемы. Если вы действительно хотите это сделать, посетите наш Discord.", + "settings-theme": "Тема ArmCord:", + "settings-theme-default": "По умолчанию", + "settings-theme-native": "Нативная", + "settings-tray": "Свернуть в область уведомлений", + "settings-patches": "Автоматические патчи", + "settings-channel": "Канал Discord:", + "settings-invitewebsocket": "Пригласить Websocket", + "settings-mod": "Клиентский мод:", + "settings-prfmMode": "Режим производительности:", + "settings-prfmMode-performance": "Производительность", + "settings-prfmMode-battery": "Батарея", + "settings-none": "Ничего", + "settings-save": "Сохранить настройки", + "settings-updater": "Проверить наличие обновлений" } From f272bb822e95b19fc667944b7236e9a62ad89f2b Mon Sep 17 00:00:00 2001 From: KayoticCarnige <32397453+kckarnige@users.noreply.github.com> Date: Sat, 9 Jul 2022 18:46:17 -0400 Subject: [PATCH 12/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 128d33e..984f4bc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
-
ArmCord is a custom Discord client designed to run smoother and enhance your Discord experience. +
ArmCord is a custom client designed to enhance your Discord experience while keeping everything lightweight.
# Features From b4f2265efb593dcd6e0baffe2acbc7b82f5f20aa Mon Sep 17 00:00:00 2001 From: Rafael V Date: Sun, 10 Jul 2022 19:45:23 +0200 Subject: [PATCH 13/34] Added translation using Weblate (Portuguese (Brazil)) --- assets/lang/pt-BR.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 assets/lang/pt-BR.json diff --git a/assets/lang/pt-BR.json b/assets/lang/pt-BR.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/assets/lang/pt-BR.json @@ -0,0 +1 @@ +{} From 1a7af5168da878caf9db5e31e0724743637b2171 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 10 Jul 2022 17:45:24 +0000 Subject: [PATCH 14/34] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (0 of 0 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/pt_BR/ --- assets/lang/pt-BR.json | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/assets/lang/pt-BR.json b/assets/lang/pt-BR.json index 0967ef4..8f79330 100644 --- a/assets/lang/pt-BR.json +++ b/assets/lang/pt-BR.json @@ -1 +1,30 @@ -{} +{ + "no": "No", + "loading_screen_start": "Starting ArmCord…", + "loading_screen_offline": "You appear to be offline. Please connect to the Internet and try again.", + "loading_screen_update": "A new version of ArmCord is available. Please update to the latest version.", + "setup_question1": "Select what kind of setup you want to perform:", + "setup_question1_answer1": "Express Setup", + "setup_question1_answer2": "Full Setup", + "setup_offline": "You appear to be offline. Please connect to the internet and restart ArmCord.", + "setup_question2": "Choose your Discord channel/instance:", + "setup_question3": "Should ArmCord handle client mods installation?", + "yes": "Yes", + "next": "Next", + "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 Discord.", + "settings-theme": "ArmCord theme:", + "settings-theme-default": "Default", + "settings-theme-native": "Native", + "settings-tray": "Minimize to tray", + "settings-patches": "Automatic Patches", + "settings-channel": "Discord channel:", + "settings-invitewebsocket": "Invite Websocket", + "settings-mod": "Client mod:", + "settings-prfmMode": "Performance mode:", + "settings-prfmMode-performance": "Performance", + "settings-prfmMode-battery": "Battery", + "settings-none": "None", + "settings-save": "Save Settings", + "settings-updater": "Check for updates" +} From d6cbbcba7da2f26f18c55145958c4641f97d556b Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Mon, 11 Jul 2022 19:13:52 +0200 Subject: [PATCH 15/34] Add mobile mode --- .idea/.gitignore | 5 +++++ .idea/ArmCord.iml | 12 ++++++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ assets/lang/en-US.json | 1 + src/content/css/mobile.css | 6 ++++++ src/content/setup.html | 6 +++--- src/content/splash.html | 3 --- src/ipc.ts | 3 +++ src/preload/mobile.ts | 19 +++++++++++++++++++ src/preload/preload.ts | 4 ++++ src/settings/settings.html | 10 +++++++++- src/tray.ts | 12 +++++++----- src/utils.ts | 15 +++++++++++++-- src/window.ts | 14 +++++++++----- 15 files changed, 105 insertions(+), 19 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/ArmCord.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 src/content/css/mobile.css create mode 100644 src/preload/mobile.ts diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/ArmCord.iml b/.idea/ArmCord.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/.idea/ArmCord.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0f0b0aa --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assets/lang/en-US.json b/assets/lang/en-US.json index e598f49..5c963b1 100644 --- a/assets/lang/en-US.json +++ b/assets/lang/en-US.json @@ -18,6 +18,7 @@ "settings-theme-native": "Native", "settings-tray": "Minimize to tray", "settings-patches": "Automatic Patches", + "settings-mobileMode": "Mobile mode", "settings-channel": "Discord channel:", "settings-invitewebsocket": "Invite Websocket", "settings-mod": "Client mod:", diff --git a/src/content/css/mobile.css b/src/content/css/mobile.css new file mode 100644 index 0000000..a71ed39 --- /dev/null +++ b/src/content/css/mobile.css @@ -0,0 +1,6 @@ +[aria-label~="Mute"] { + display: none; +} +[aria-label~="Deafen"] { + display: none; +} diff --git a/src/content/setup.html b/src/content/setup.html index dfc317e..a19c248 100644 --- a/src/content/setup.html +++ b/src/content/setup.html @@ -31,7 +31,6 @@ -

@@ -121,6 +120,7 @@ automaticPatches: false, mods: "cumcord", inviteWebsocket: true, + mobileMode: false, trayIcon: "ac_plug_colored", performanceMode: "none" }); @@ -148,8 +148,8 @@ windowStyle: "default", channel: options.channel, armcordCSP: true, - autoLaunch: true, minimizeToTray: true, + mobileMode: false, automaticPatches: false, performanceMode: "none", trayIcon: "ac_plug_colored", @@ -165,7 +165,7 @@ armcordCSP: true, minimizeToTray: true, automaticPatches: false, - autoLaunch: true, + mobileMode: false, mods: "none", performanceMode: "none", trayIcon: "ac_plug_colored", diff --git a/src/content/splash.html b/src/content/splash.html index 90b6fcb..8bca30c 100644 --- a/src/content/splash.html +++ b/src/content/splash.html @@ -58,9 +58,6 @@ case "ptb": window.location.replace("https://ptb.discord.com/app"); break; - case "foss": - window.location.replace("https://dev.fosscord.com/app"); - break; case undefined: window.location.replace("https://discord.com/app"); break; diff --git a/src/ipc.ts b/src/ipc.ts index 52e1c68..bc41125 100644 --- a/src/ipc.ts +++ b/src/ipc.ts @@ -83,6 +83,9 @@ export function registerIpc() { ipcMain.on("titlebar", (event, arg) => { event.returnValue = customTitlebar; }); + ipcMain.on("mobileMode", async (event, arg) => { + event.returnValue = await getConfig("mobileMode"); + }); ipcMain.on("shouldPatch", async (event, arg) => { event.returnValue = await getConfig("automaticPatches"); }); diff --git a/src/preload/mobile.ts b/src/preload/mobile.ts new file mode 100644 index 0000000..213deb6 --- /dev/null +++ b/src/preload/mobile.ts @@ -0,0 +1,19 @@ +import {ipcRenderer} from "electron"; +import {addStyle} from "../utils"; +import * as fs from "fs"; +import * as path from "path"; +export function injectMobileStuff() { + document.addEventListener("DOMContentLoaded", function (event) { + const mobileCSS = path.join(__dirname, "../", "/content/css/mobile.css"); + addStyle(fs.readFileSync(mobileCSS, "utf8")); + + var logo = document.getElementById("window-title"); + logo!.addEventListener("click", () => { + if (ipcRenderer.sendSync("minimizeToTray") === true) { + ipcRenderer.send("win-hide"); + } else if (ipcRenderer.sendSync("minimizeToTray") === false) { + ipcRenderer.send("win-quit"); + } + }); + }); +} diff --git a/src/preload/preload.ts b/src/preload/preload.ts index 6089430..5f91140 100644 --- a/src/preload/preload.ts +++ b/src/preload/preload.ts @@ -6,6 +6,7 @@ import * as path from "path"; import {injectTitlebar} from "./titlebar"; import {sleep, addStyle, injectJS, addScript} from "../utils"; import {ipcRenderer} from "electron"; +import {injectMobileStuff} from "./mobile"; var version = ipcRenderer.sendSync("get-app-version", "app-version"); async function updateLang() { if (window.location.href.indexOf("setup.html") > -1) { @@ -37,6 +38,9 @@ if (window.location.href.indexOf("splash.html") > -1) { if (ipcRenderer.sendSync("titlebar")) { injectTitlebar(); } + if (ipcRenderer.sendSync("mobileMode")) { + injectMobileStuff(); + } sleep(5000).then(async () => { const cssPath = path.join(__dirname, "../", "/content/css/discord.css"); addStyle(fs.readFileSync(cssPath, "utf8")); diff --git a/src/settings/settings.html b/src/settings/settings.html index 31e38ff..8b7ab13 100644 --- a/src/settings/settings.html +++ b/src/settings/settings.html @@ -40,12 +40,17 @@ +
+

+ + + +

Discord channel:

@@ -89,6 +94,7 @@ ); document.getElementById("settings-patches").innerHTML = await settings.getLang("settings-patches"); document.getElementById("settings-tray").innerHTML = await settings.getLang("settings-tray"); + document.getElementById("settings-mobileMode").innerHTML = await settings.getLang("settings-mobileMode"); document.getElementById("settings-theme").innerHTML = await settings.getLang("settings-theme"); //select stuff document.getElementById("mod").options[3].text = await settings.getLang("settings-none"); @@ -107,6 +113,7 @@ document.getElementById("csp").checked = await settings.get("armcordCSP"); document.getElementById("tray").checked = await settings.get("minimizeToTray"); document.getElementById("websocket").checked = await settings.get("inviteWebsocket"); + document.getElementById("mobile").checked = await settings.get("mobileMode"); document.getElementById("patches").value = await settings.get("automaticPatches"); document.getElementById("mod").value = await settings.get("mods"); document.getElementById("channel").value = await settings.get("channel"); @@ -123,6 +130,7 @@ minimizeToTray: document.getElementById("tray").checked, automaticPatches: document.getElementById("patches").checked, mods: document.getElementById("mod").value, + mobileMode: document.getElementById("mobile").checked, inviteWebsocket: document.getElementById("websocket").checked, performanceMode: document.getElementById("prfmMode").value, trayIcon: document.getElementById("trayIcon").value, diff --git a/src/tray.ts b/src/tray.ts index 9241e8e..3d8731a 100644 --- a/src/tray.ts +++ b/src/tray.ts @@ -1,5 +1,5 @@ import * as fs from "fs"; -import { app, Menu, Tray } from "electron"; +import { app, Menu, Tray, nativeImage} from "electron"; import { mainWindow } from "./window"; import { getConfig, getConfigLocation, setWindowState } from "./utils"; import * as path from "path"; @@ -7,10 +7,13 @@ import { createSettingsWindow } from "./settings/main"; let tray: any = null; app.whenReady().then(async () => { let finishedSetup = (await getConfig("doneSetup")); + var trayIcon = (await getConfig("trayIcon")) ?? "ac_plug_colored"; + let trayPath = nativeImage.createFromPath(path.join(__dirname, "../", `/assets/${trayIcon}.png`)); + if(process.platform === "darwin" && trayPath.getSize().height > 22) + trayPath = trayIcon.resize({height: 22}); if ((await getConfig("windowStyle")) == "basic") { var clientName = (await getConfig("clientName")) ?? "ArmCord"; - var trayIcon = (await getConfig("trayIcon")) ?? "ac_plug_colored"; - tray = new Tray(path.join(__dirname, "../", `/assets/${trayIcon}.png`)); + tray = new Tray(trayPath); const contextMenu = function () { if (finishedSetup == false) { return Menu.buildFromTemplate([ @@ -57,8 +60,7 @@ app.whenReady().then(async () => { tray.setContextMenu(contextMenu); } else { var clientName = (await getConfig("clientName")) ?? "ArmCord"; - var trayIcon = (await getConfig("trayIcon")) ?? "ac_plug_colored"; - tray = new Tray(path.join(__dirname, "../", `/assets/${trayIcon}.png`)); + tray = new Tray(trayPath); if (finishedSetup == false) { const contextMenu = Menu.buildFromTemplate([ { diff --git a/src/utils.ts b/src/utils.ts index 6c0ef26..d51256c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -4,7 +4,7 @@ import path from "path"; export var firstRun: boolean; export var isSetup: boolean; export var contentPath: string; -//utillity functions that are used all over the codebase or just too obscure to be put in the file used in +//utility functions that are used all over the codebase or just too obscure to be put in the file used in export function addStyle(styleString: string) { const style = document.createElement("style"); style.textContent = styleString; @@ -43,6 +43,7 @@ export function setup() { mods: "cumcord", performanceMode: "none", inviteWebsocket: true, + mobileMode: false, trayIcon: "ac_plug_colored", doneSetup: false }; @@ -140,7 +141,16 @@ export async function getLang(object: string) { } let rawdata = fs.readFileSync(langPath, "utf-8"); let parsed = JSON.parse(rawdata); - return parsed[object]; + if (parsed[object] == undefined) { + console.log(object + " is undefined in " + language) + langPath = path.join(__dirname, "../", "/assets/lang/en-US.json"); + rawdata = fs.readFileSync(langPath, "utf-8"); + parsed = JSON.parse(rawdata); + return parsed[object] + } else { + return parsed[object]; + } + } //ArmCord Window State manager @@ -178,6 +188,7 @@ export interface Settings { minimizeToTray: boolean; automaticPatches: boolean; mods: string; + mobileMode: boolean, performanceMode: string; inviteWebsocket: boolean; trayIcon: string; diff --git a/src/window.ts b/src/window.ts index 5a6fe4c..07a9e89 100644 --- a/src/window.ts +++ b/src/window.ts @@ -25,12 +25,16 @@ async function doAfterDefiningTheWindow() { var ignoreProtocolWarning = await getConfig("ignoreProtocolWarning"); checkIfConfigIsBroken(); registerIpc(); - - // A little sloppy but it works :p - if (osType == 'Windows_NT') { - osType = "Windows " + os.release().split('.')[0] + " (" + os.release() + ")"; + if (await getConfig("mobileMode")) { + mainWindow.webContents.userAgent = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.149 Mobile Safari/537.36" + } else { + // A little sloppy but it works :p + if (osType == 'Windows_NT') { + osType = "Windows " + os.release().split('.')[0] + " (" + os.release() + ")"; + } + mainWindow.webContents.userAgent = `Mozilla/5.0 (X11; ${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`; //fake useragent for screenshare to work } - mainWindow.webContents.userAgent = `Mozilla/5.0 (X11; ${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`; //fake useragent for screenshare to work + mainWindow.webContents.setWindowOpenHandler(({ url }) => { if (url.startsWith("https:" || url.startsWith("http:") || url.startsWith("mailto:"))) { shell.openExternal(url); From 9c2b00d56fd91fa83fe5dfd47767159d36351f07 Mon Sep 17 00:00:00 2001 From: Rafael V Date: Sun, 10 Jul 2022 17:55:04 +0000 Subject: [PATCH 16/34] Translated using Weblate (Portuguese (Brazil)) Currently translated at 71.4% (20 of 28 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/pt_BR/ --- assets/lang/pt-BR.json | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/assets/lang/pt-BR.json b/assets/lang/pt-BR.json index 8f79330..d53e8d6 100644 --- a/assets/lang/pt-BR.json +++ b/assets/lang/pt-BR.json @@ -1,24 +1,24 @@ { - "no": "No", - "loading_screen_start": "Starting ArmCord…", - "loading_screen_offline": "You appear to be offline. Please connect to the Internet and try again.", - "loading_screen_update": "A new version of ArmCord is available. Please update to the latest version.", - "setup_question1": "Select what kind of setup you want to perform:", - "setup_question1_answer1": "Express Setup", - "setup_question1_answer2": "Full Setup", - "setup_offline": "You appear to be offline. Please connect to the internet and restart ArmCord.", - "setup_question2": "Choose your Discord channel/instance:", - "setup_question3": "Should ArmCord handle client mods installation?", - "yes": "Yes", - "next": "Next", - "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 Discord.", - "settings-theme": "ArmCord theme:", - "settings-theme-default": "Default", - "settings-theme-native": "Native", - "settings-tray": "Minimize to tray", - "settings-patches": "Automatic Patches", - "settings-channel": "Discord channel:", + "no": "Não", + "loading_screen_start": "Iniciando ArmCord…", + "loading_screen_offline": "Você parece estar offline. Conecte-se à internet e tente novamente.", + "loading_screen_update": "Uma nova versão do ArmCord está disponível. Atualize para a versão mais recente.", + "setup_question1": "Selecione que tipo de instação você quer fazer:", + "setup_question1_answer1": "Instalação rápida", + "setup_question1_answer2": "Instalação completa", + "setup_offline": "Você parece estar offline. Conecte-se à internet e tente novamente.", + "setup_question2": "Escolha o canal/instância do seu Discord", + "setup_question3": "O ArmCord deve suportar a instalação dos mods de cliente?", + "yes": "Sim", + "next": "Próximo", + "setup_question4": "Selecione um mod de cliente que você quer instalar:", + "setup_question4_clientmodnotice": "Por que não todos eles? Tendo vários mods de cliente ao mesmo tempo pode causar problemas, Se você realmente quer fazer isso mesmo assim, veja o nosso Discord.", + "settings-theme": "Tema do ArmCord:", + "settings-theme-default": "Padrão", + "settings-theme-native": "Nativo", + "settings-tray": "Minimizar para a bandeja", + "settings-patches": "Patches automáticos", + "settings-channel": "Tipo de Discord:", "settings-invitewebsocket": "Invite Websocket", "settings-mod": "Client mod:", "settings-prfmMode": "Performance mode:", From 40dc67f0a853f42fd5ca0cf17ead4ab56704107c Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:56 +0000 Subject: [PATCH 17/34] Translated using Weblate (French) Currently translated at 82.7% (24 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/fr/ --- assets/lang/fr-FR.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/fr-FR.json b/assets/lang/fr-FR.json index b1891b4..2c486bf 100644 --- a/assets/lang/fr-FR.json +++ b/assets/lang/fr-FR.json @@ -26,5 +26,6 @@ "settings-prfmMode": "Mode performance :", "settings-prfmMode-performance": "Performance", "settings-prfmMode-battery": "Batterie", - "settings-none": "Aucun" + "settings-none": "Aucun", + "settings-mobileMode": "Mobile mode" } From 6e30ffa7bfd8eb2e5fff94b4692f9af3e43a687c Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:57 +0000 Subject: [PATCH 18/34] Translated using Weblate (Italian) Currently translated at 82.7% (24 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/it/ --- assets/lang/it-IT.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/it-IT.json b/assets/lang/it-IT.json index f0c9675..8895906 100644 --- a/assets/lang/it-IT.json +++ b/assets/lang/it-IT.json @@ -26,5 +26,6 @@ "settings-prfmMode": "Performance mode:", "settings-prfmMode-performance": "Performance", "settings-prfmMode-battery": "Battery", - "settings-none": "None" + "settings-none": "None", + "settings-mobileMode": "Mobile mode" } From b25ff8dec3119801fd48fad475ec1758ee134c55 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:56 +0000 Subject: [PATCH 19/34] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 82.7% (24 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/nb_NO/ --- assets/lang/nb-NO.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/nb-NO.json b/assets/lang/nb-NO.json index 00bdd19..3066c0f 100644 --- a/assets/lang/nb-NO.json +++ b/assets/lang/nb-NO.json @@ -26,5 +26,6 @@ "settings-prfmMode": "Performance mode:", "settings-prfmMode-performance": "Performance", "settings-prfmMode-battery": "Battery", - "settings-none": "None" + "settings-none": "None", + "settings-mobileMode": "Mobile mode" } From 7afb3962dc4b99b2b0a3ebf9bb6d7f4ca117f566 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:56 +0000 Subject: [PATCH 20/34] Translated using Weblate (Dutch) Currently translated at 82.7% (24 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/nl/ --- assets/lang/nl-NL.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/nl-NL.json b/assets/lang/nl-NL.json index ebac8bc..fd83845 100644 --- a/assets/lang/nl-NL.json +++ b/assets/lang/nl-NL.json @@ -26,5 +26,6 @@ "settings-none": "None", "settings-prfmMode": "Performance mode:", "settings-prfmMode-performance": "Performance", - "settings-prfmMode-battery": "Battery" + "settings-prfmMode-battery": "Battery", + "settings-mobileMode": "Mobile mode" } From 69012c95a030e5617810bceaf577aed2f526353a Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:57 +0000 Subject: [PATCH 21/34] Translated using Weblate (Polish) Currently translated at 82.7% (24 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/pl/ --- assets/lang/pl-PL.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/pl-PL.json b/assets/lang/pl-PL.json index 05f840e..4fa3eff 100644 --- a/assets/lang/pl-PL.json +++ b/assets/lang/pl-PL.json @@ -26,5 +26,6 @@ "settings-prfmMode": "Tryb wydajności:", "settings-prfmMode-performance": "Wydajny", "settings-prfmMode-battery": "Bateria", - "settings-none": "Nic/Brak" + "settings-none": "Nic/Brak", + "settings-mobileMode": "Mobile mode" } From 56c7b68c47847f0933725ef2a6193f2324456eef Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:57 +0000 Subject: [PATCH 22/34] Translated using Weblate (Indonesian) Currently translated at 96.5% (28 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/id/ --- assets/lang/id-ID.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/id-ID.json b/assets/lang/id-ID.json index e09518f..adbbcae 100644 --- a/assets/lang/id-ID.json +++ b/assets/lang/id-ID.json @@ -26,5 +26,6 @@ "settings-prfmMode": "mode kinerja:", "settings-prfmMode-performance": "kinerja", "settings-prfmMode-battery": "Baterai", - "settings-none": "tidak ada" + "settings-none": "tidak ada", + "settings-mobileMode": "Mobile mode" } From db9bfbb269776de0dcd0758b813f75f113221b19 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:56 +0000 Subject: [PATCH 23/34] Translated using Weblate (Spanish (Latin America)) Currently translated at 79.3% (23 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/es_419/ --- assets/lang/es-419.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/es-419.json b/assets/lang/es-419.json index 194282e..1eec53a 100644 --- a/assets/lang/es-419.json +++ b/assets/lang/es-419.json @@ -26,5 +26,6 @@ "settings-prfmMode-battery": "Batería", "settings-none": "Ninguna", "settings-save": "Guardar ajustes", - "settings-updater": "Buscar una actualización" + "settings-updater": "Buscar una actualización", + "settings-mobileMode": "Mobile mode" } From e946615770a944625d4665f4bfdd83e7b2fb750f Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:56 +0000 Subject: [PATCH 24/34] Translated using Weblate (Thai) Currently translated at 96.5% (28 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/th/ --- assets/lang/th-TH.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/th-TH.json b/assets/lang/th-TH.json index 698ac35..67c83b7 100644 --- a/assets/lang/th-TH.json +++ b/assets/lang/th-TH.json @@ -26,5 +26,6 @@ "settings-mod": "ไคลแอนต์มอด:", "settings-none": "ไม่มี", "settings-save": "บันทึกการตั้งค่า", - "settings-updater": "ตรวจหาการอัปเดต" + "settings-updater": "ตรวจหาการอัปเดต", + "settings-mobileMode": "Mobile mode" } From efe835be04c3b88974b7730ec0b41098f737edcc Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:56 +0000 Subject: [PATCH 25/34] Translated using Weblate (Persian) Currently translated at 82.7% (24 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/fa/ --- assets/lang/fa-IR.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/fa-IR.json b/assets/lang/fa-IR.json index 41039ef..1566cf5 100644 --- a/assets/lang/fa-IR.json +++ b/assets/lang/fa-IR.json @@ -26,5 +26,6 @@ "settings-prfmMode-battery": "ذخیره برای باتری", "settings-none": "هیچکدام", "settings-save": "ذخیره تنظیمات", - "settings-updater": "بررسی برای بروزرسانی" + "settings-updater": "بررسی برای بروزرسانی", + "settings-mobileMode": "Mobile mode" } From a3ac768f2564a9b560a38a976f4e08b39fead739 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:57 +0000 Subject: [PATCH 26/34] Translated using Weblate (Russian) Currently translated at 93.1% (27 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/ru/ --- assets/lang/ru-RU.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/ru-RU.json b/assets/lang/ru-RU.json index af280da..6cca053 100644 --- a/assets/lang/ru-RU.json +++ b/assets/lang/ru-RU.json @@ -26,5 +26,6 @@ "settings-prfmMode-battery": "Батарея", "settings-none": "Ничего", "settings-save": "Сохранить настройки", - "settings-updater": "Проверить наличие обновлений" + "settings-updater": "Проверить наличие обновлений", + "settings-mobileMode": "Mobile mode" } From 251f4d55ff1130514909fcce24e52d770ce42212 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 11 Jul 2022 17:17:57 +0000 Subject: [PATCH 27/34] Translated using Weblate (Portuguese (Brazil)) Currently translated at 68.9% (20 of 29 strings) Translation: ArmCord/ArmCord Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/pt_BR/ --- assets/lang/pt-BR.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/lang/pt-BR.json b/assets/lang/pt-BR.json index d53e8d6..e657eb5 100644 --- a/assets/lang/pt-BR.json +++ b/assets/lang/pt-BR.json @@ -26,5 +26,6 @@ "settings-prfmMode-battery": "Battery", "settings-none": "None", "settings-save": "Save Settings", - "settings-updater": "Check for updates" + "settings-updater": "Check for updates", + "settings-mobileMode": "Mobile mode" } From 0ebaa5627e2955ffd14d0efec59ca732c80da40c Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Mon, 11 Jul 2022 20:19:50 +0200 Subject: [PATCH 28/34] code cleanup --- src/ipc.ts | 4 +-- src/main.ts | 53 ++++++++++------------------ src/shortcuts.ts | 20 +---------- src/utils.ts | 92 ++++++++++++------------------------------------ src/window.ts | 36 ++++--------------- 5 files changed, 52 insertions(+), 153 deletions(-) diff --git a/src/ipc.ts b/src/ipc.ts index bc41125..ad8cc6a 100644 --- a/src/ipc.ts +++ b/src/ipc.ts @@ -50,7 +50,7 @@ export function registerIpc() { 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.") + console.log("[Window state manager] No window state file found. Fallbacking to default values.") mainWindow.setSize(800, 600); } if (isMaximized) { @@ -58,7 +58,7 @@ export function registerIpc() { mainWindow.maximize() } else { mainWindow.setSize(width, height); - console.log("Not maximized.") + console.log("[Window state manager] Not maximized.") } }); ipcMain.on("restart", (event, arg) => { diff --git a/src/main.ts b/src/main.ts index e2def19..36bb830 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,22 +26,25 @@ if (process.platform == "linux") { checkIfConfigExists(); injectElectronFlags(); app.whenReady().then(async () => { - switch (await getConfig("windowStyle")) { - case "default": - createCustomWindow(); - customTitlebar = true; - break; - case "native": - createNativeWindow(); - break; - case "basic": - createNativeWindow(); - break; - default: - createCustomWindow(); - customTitlebar = true; - break; + async function init() { + switch (await getConfig("windowStyle")) { + case "default": + createCustomWindow(); + customTitlebar = true; + break; + case "native": + createNativeWindow(); + break; + case "basic": + createNativeWindow(); + break; + default: + createCustomWindow(); + customTitlebar = true; + break; + } } + await init() session.fromPartition("some-partition").setPermissionRequestHandler((webContents, permission, callback) => { if (permission === "notifications") { // Approves the permissions request @@ -54,24 +57,6 @@ app.whenReady().then(async () => { }); app.on("activate", async function () { if (BrowserWindow.getAllWindows().length === 0) - switch (await getConfig("windowStyle")) { - case "default": - createCustomWindow(); - break; - case "native": - createNativeWindow(); - break; - case "discord": - createNativeWindow(); - break; - default: - createCustomWindow(); - break; - } - console.log("userDataPath = " + app.getPath("userData")); + await init() }); }); - -app.on("window-all-closed", function () { - if (process.platform !== "darwin") app.quit(); -}); diff --git a/src/shortcuts.ts b/src/shortcuts.ts index ba500d5..4d841b9 100644 --- a/src/shortcuts.ts +++ b/src/shortcuts.ts @@ -2,22 +2,4 @@ import {app} from "electron"; import {mainWindow} from "./window"; //https://github.com/electron/electron/issues/1334#issuecomment-716080005 // TO-DO add more -app.on("web-contents-created", (webContentsCreatedEvent, webContents) => { - webContents.on("before-input-event", (beforeInputEvent, input) => { - // console.log('Main console::', input) - const {code, alt, control, shift, meta} = input; - // Shortcut: toggle devTools - if (shift && control && !alt && !meta && code === "KeyI") { - mainWindow.webContents.toggleDevTools(); - } - // Shortcut: window reload - if (shift && control && !alt && !meta && code === "KeyR") { - mainWindow.reload(); - } - // Shortcut: app reload - if (alt && control && !shift && !meta && code === "KeyR") { - app.relaunch(); - app.exit(); - } - }); -}); + diff --git a/src/utils.ts b/src/utils.ts index d51256c..4e38cbc 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -105,9 +105,7 @@ export async function injectElectronFlags() { } } export async function setLang(language: string) { - const userDataPath = app.getPath("userData"); - const storagePath = path.join(userDataPath, "/storage/"); - const langConfigFile = storagePath + "lang.json"; + const langConfigFile = path.join(app.getPath("userData"), "/storage/") + "lang.json"; if (!fs.existsSync(langConfigFile)) { fs.writeFileSync(langConfigFile, "{}", "utf-8"); } @@ -150,7 +148,6 @@ export async function getLang(object: string) { } else { return parsed[object]; } - } //ArmCord Window State manager @@ -175,9 +172,8 @@ export async function getWindowState(object: string) { const settingsFile = storagePath + "window.json"; let rawdata = fs.readFileSync(settingsFile, "utf-8"); let returndata = JSON.parse(rawdata); - console.log(object + ": " + returndata[object]); + console.log("[Window state manager] " + object + ": " + returndata[object]); return returndata[object]; - } //ArmCord Settings/Storage manager @@ -194,60 +190,30 @@ export interface Settings { trayIcon: string; doneSetup: boolean; } -export async function getConfig(object: string) { - try { - const userDataPath = app.getPath("userData"); - const storagePath = path.join(userDataPath, "/storage/"); - const settingsFile = storagePath + "settings.json"; - let rawdata = fs.readFileSync(settingsFile, "utf-8"); - let returndata = JSON.parse(rawdata); - console.log(object + ": " + returndata[object]); - return returndata[object]; - } catch (e) { - console.log("Config probably doesn't exist yet. Returning setup value."); - firstRun = true; - return "setup"; - } +export function getConfigLocation() { + const userDataPath = app.getPath("userData"); + const storagePath = path.join(userDataPath, "/storage/"); + return storagePath + "settings.json"; } -export async function getConfigLocation() { - try { - const userDataPath = app.getPath("userData"); - const storagePath = path.join(userDataPath, "/storage/"); - return storagePath + "settings.json"; - } catch (e) { - console.log("Config probably doesn't exist yet. Returning setup value."); - firstRun = true; - return "setup"; - } +export async function getConfig(object: string) { + let rawdata = fs.readFileSync(getConfigLocation(), "utf-8"); + let returndata = JSON.parse(rawdata); + console.log("[Config manager] " + object + ": " + returndata[object]); + return returndata[object]; } export async function setConfig(object: string, toSet: any) { - try { - const userDataPath = app.getPath("userData"); - const storagePath = path.join(userDataPath, "/storage/"); - const settingsFile = storagePath + "settings.json"; - let rawdata = fs.readFileSync(settingsFile, "utf-8"); - let parsed = JSON.parse(rawdata); - parsed[object] = toSet; - let toSave = JSON.stringify(parsed); - fs.writeFileSync(settingsFile, toSave, "utf-8"); - } catch (e) { - console.log("Config probably doesn't exist yet. Returning setup value."); - firstRun = true; - return "setup"; - } + let rawdata = fs.readFileSync(getConfigLocation(), "utf-8"); + let parsed = JSON.parse(rawdata); + parsed[object] = toSet; + let toSave = JSON.stringify(parsed); + fs.writeFileSync(getConfigLocation(), toSave, "utf-8"); } export async function setConfigBulk(object: Settings) { - try { - const userDataPath = app.getPath("userData"); - const storagePath = path.join(userDataPath, "/storage/"); - const settingsFile = storagePath + "settings.json"; - let toSave = JSON.stringify(object); - fs.writeFileSync(settingsFile, toSave, "utf-8"); - } catch (e) { - console.log("Config probably doesn't exist yet. Returning setup value."); - firstRun = true; - return "setup"; - } + const userDataPath = app.getPath("userData"); + const storagePath = path.join(userDataPath, "/storage/"); + const settingsFile = storagePath + "settings.json"; + let toSave = JSON.stringify(object); + fs.writeFileSync(settingsFile, toSave, "utf-8"); } export async function checkIfConfigExists() { const userDataPath = app.getPath("userData"); @@ -261,26 +227,14 @@ export async function checkIfConfigExists() { } console.log("First run of the ArmCord. Starting setup."); setup(); - isSetup = true; - contentPath = path.join(__dirname, "/content/setup.html"); - if (!contentPath.includes("ts-out")) { - contentPath = path.join(__dirname, "/ts-out/content/setup.html"); - } + firstRun = true; } else { if ((await getConfig("doneSetup")) == false) { console.log("First run of the ArmCord. Starting setup."); setup(); - isSetup = true; - contentPath = path.join(__dirname, "/content/setup.html"); - if (!contentPath.includes("ts-out")) { - contentPath = path.join(__dirname, "/ts-out/content/setup.html"); - } + firstRun = true; } else { console.log("ArmCord has been run before. Skipping setup."); - contentPath = path.join(__dirname, "/content/splash.html"); - if (!contentPath.includes("ts-out")) { - contentPath = path.join(__dirname, "/ts-out/content/splash.html"); - } } } } diff --git a/src/window.ts b/src/window.ts index 07a9e89..9570e94 100644 --- a/src/window.ts +++ b/src/window.ts @@ -118,36 +118,14 @@ async function doAfterDefiningTheWindow() { }) console.log(contentPath); if ((await getConfig("inviteWebsocket")) == true) { - startServer(); + await startServer(); } - try { - mainWindow.loadFile(contentPath); - if (isSetup) { - await setLang(Intl.DateTimeFormat().resolvedOptions().locale) - mainWindow.setSize(390, 470); - } - } catch (e) { - console.log( - "Major error detected while starting up. User is most likely on Windows platform. Fallback to alternative startup." - ); - console.log(process.platform); - if (process.platform === "win32") { - if (firstRun) { - await setLang(Intl.DateTimeFormat().resolvedOptions().locale) - mainWindow.setSize(390, 470); - mainWindow.loadURL(`file://${__dirname}/content/setup.html`); - } else { - mainWindow.loadURL(`file://${__dirname}/content/splash.html`); - } - } else { - if (firstRun) { - await setLang(Intl.DateTimeFormat().resolvedOptions().locale) - mainWindow.setSize(390, 470); - mainWindow.loadURL(`file://${__dirname}/ts-out/content/setup.html`); - } else { - mainWindow.loadURL(`file://${__dirname}/ts-out/content/splash.html`); - } - } + if (firstRun) { + await setLang(Intl.DateTimeFormat().resolvedOptions().locale) + mainWindow.setSize(390, 470); + await mainWindow.loadFile(path.join(__dirname, "/content/setup.html")); + } else { + await mainWindow.loadFile(path.join(__dirname, "/content/splash.html")); } } export function createCustomWindow() { From 5b509d948f20d6be42e5faa16c4231c90e56d2a8 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Mon, 11 Jul 2022 21:42:35 +0200 Subject: [PATCH 29/34] code cleanup part 2 --- .idea/inspectionProfiles/Project_Default.xml | 21 ++++++ src/content/css/screenshare.css | 68 ++++++++++++++++++ src/preload/capturer.ts | 76 ++------------------ src/preload/mobile.ts | 14 ++-- src/utils.ts | 1 - src/window.ts | 2 +- 6 files changed, 100 insertions(+), 82 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 src/content/css/screenshare.css diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..f042d21 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,21 @@ + + + + \ No newline at end of file diff --git a/src/content/css/screenshare.css b/src/content/css/screenshare.css new file mode 100644 index 0000000..77fa8a4 --- /dev/null +++ b/src/content/css/screenshare.css @@ -0,0 +1,68 @@ +.desktop-capturer-selection { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100vh; + background: rgba(30, 30, 30, 0.75); + color: #ffffff; + z-index: 10000000; + display: flex; + align-items: center; + justify-content: center; +} +.desktop-capturer-selection__scroller { + width: 100%; + max-height: 100vh; + overflow-y: auto; +} +.desktop-capturer-selection__list { + max-width: calc(100% - 100px); + margin: 50px; + padding: 0; + display: flex; + flex-wrap: wrap; + list-style: none; + overflow: hidden; + justify-content: center; +} +.desktop-capturer-selection__item { + display: flex; + margin: 4px; +} +.desktop-capturer-selection__btn { + display: flex; + flex-direction: column; + align-items: stretch; + width: 145px; + margin: 0; + border: 0; + border-radius: 3px; + padding: 4px; + background: #2c2f33; + text-align: left; +} +@media (prefers-reduced-motion: no-preference) { +} +.desktop-capturer-selection__btn:hover, +.desktop-capturer-selection__btn:focus { + background: #7289da; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.45), 0 0 2px rgba(0, 0, 0, 0.25); + color: #fff; +} +.desktop-capturer-selection__thumbnail { + width: 100%; + height: 81px; + object-fit: cover; +} +.desktop-capturer-selection__name { + margin: 6px 0; + white-space: nowrap; + color: white; + text-overflow: ellipsis; + text-align: center; + overflow: hidden; +} +.desktop-capturer-selection__name--cancel { + margin: auto 0; +} diff --git a/src/preload/capturer.ts b/src/preload/capturer.ts index 2f6d8ed..32c750f 100644 --- a/src/preload/capturer.ts +++ b/src/preload/capturer.ts @@ -2,6 +2,8 @@ //original https://github.com/electron/electron/issues/16513#issuecomment-602070250 import {ipcRenderer} from "electron"; import {addStyle, addScript} from "../utils"; +import fs from "fs"; +import path from "path"; const desktopCapturer = { getSources: (opts: any) => ipcRenderer.invoke("DESKTOP_CAPTURER_GET_SOURCES", opts) }; @@ -41,76 +43,7 @@ export async function getDisplayMediaSelector() { } const screenShareCSS = ` -.desktop-capturer-selection { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100vh; - background: rgba(30,30,30,.75); - color: #FFFFFF; - z-index: 10000000; - display: flex; - align-items: center; - justify-content: center; -} -.desktop-capturer-selection__scroller { - width: 100%; - max-height: 100vh; - overflow-y: auto; -} -.desktop-capturer-selection__list { - max-width: calc(100% - 100px); - margin: 50px; - padding: 0; - display: flex; - flex-wrap: wrap; - list-style: none; - overflow: hidden; - justify-content: center; -} -.desktop-capturer-selection__item { - display: flex; - margin: 4px; -} -.desktop-capturer-selection__btn { - display: flex; - flex-direction: column; - align-items: stretch; - width: 145px; - margin: 0; - border: 0; - border-radius: 3px; - padding: 4px; - background: #2C2F33; - text-align: left; - @media (prefers-reduced-motion: no-preference) { - transition: background-color .15s, box-shadow .15s, color .15s; - } - color: #dedede; -} -.desktop-capturer-selection__btn:hover, -.desktop-capturer-selection__btn:focus { - background: #7289DA; - box-shadow: 0 0 4px rgba(0,0,0,0.45), 0 0 2px rgba(0,0,0,0.25); - color: #fff; -} -.desktop-capturer-selection__thumbnail { - width: 100%; - height: 81px; - object-fit: cover; -} -.desktop-capturer-selection__name { - margin: 6px 0; - white-space: nowrap; - color: white; - text-overflow: ellipsis; - text-align: center; - overflow: hidden; -} -.desktop-capturer-selection__name--cancel { - margin: auto 0; -} + `; const screenShareJS = ` @@ -155,6 +88,7 @@ window.navigator.mediaDevices.getDisplayMedia = () => new Promise(async (resolve document.addEventListener("DOMContentLoaded", function () { addScript(screenShareJS); - addStyle(screenShareCSS); + const screenshareCss = path.join(__dirname, "../", "/content/css/screenshare.css"); + addStyle(fs.readFileSync(screenshareCss, "utf8")); console.log("Capturer injected."); }); diff --git a/src/preload/mobile.ts b/src/preload/mobile.ts index 213deb6..d1d03f0 100644 --- a/src/preload/mobile.ts +++ b/src/preload/mobile.ts @@ -6,14 +6,10 @@ export function injectMobileStuff() { document.addEventListener("DOMContentLoaded", function (event) { const mobileCSS = path.join(__dirname, "../", "/content/css/mobile.css"); addStyle(fs.readFileSync(mobileCSS, "utf8")); - - var logo = document.getElementById("window-title"); - logo!.addEventListener("click", () => { - if (ipcRenderer.sendSync("minimizeToTray") === true) { - ipcRenderer.send("win-hide"); - } else if (ipcRenderer.sendSync("minimizeToTray") === false) { - ipcRenderer.send("win-quit"); - } - }); + // TO-DO: clicking on the logo, or additional button triggers ESC button to move around the UI quicker + // var logo = document.getElementById("window-title"); + // logo!.addEventListener("click", () => { + // + // }); }); } diff --git a/src/utils.ts b/src/utils.ts index 4e38cbc..64995c7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -2,7 +2,6 @@ import * as fs from "fs"; import { app, dialog } from "electron"; import path from "path"; export var firstRun: boolean; -export var isSetup: boolean; export var contentPath: string; //utility functions that are used all over the codebase or just too obscure to be put in the file used in export function addStyle(styleString: string) { diff --git a/src/window.ts b/src/window.ts index 9570e94..a650bf6 100644 --- a/src/window.ts +++ b/src/window.ts @@ -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, setConfig, setLang, setWindowState } from "./utils"; import { registerIpc } from "./ipc"; import * as fs from "fs"; import startServer from "./socket"; From 83b4f75e8733adeef1f98148444577fc82cbec45 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Tue, 12 Jul 2022 16:10:41 +0200 Subject: [PATCH 30/34] Add experimental Hummus support --- src/content/setup.html | 1 + src/content/splash.html | 3 +++ src/extensions/mods.ts | 3 ++- src/preload/capturer.ts | 4 ---- src/preload/preload.ts | 2 +- src/preload/titlebar.ts | 5 +++++ src/settings/settings.html | 1 + 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/content/setup.html b/src/content/setup.html index a19c248..a0f8540 100644 --- a/src/content/setup.html +++ b/src/content/setup.html @@ -31,6 +31,7 @@ +

diff --git a/src/content/splash.html b/src/content/splash.html index 8bca30c..0378dd1 100644 --- a/src/content/splash.html +++ b/src/content/splash.html @@ -58,6 +58,9 @@ case "ptb": window.location.replace("https://ptb.discord.com/app"); break; + case "hummus": + window.location.replace("https://hummus.sys42.net/"); + break; case undefined: window.location.replace("https://discord.com/app"); break; diff --git a/src/extensions/mods.ts b/src/extensions/mods.ts index edf1d9a..fb2c5c2 100644 --- a/src/extensions/mods.ts +++ b/src/extensions/mods.ts @@ -27,7 +27,8 @@ const unstrictCSP = () => { "https://api.goosemod.com/inject.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/FlickerMod/dist/main/build.js" + "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js", + "https://localhost:1234/dist.js" ]; electron.session.defaultSession.webRequest.onHeadersReceived(({responseHeaders, url}, done) => { diff --git a/src/preload/capturer.ts b/src/preload/capturer.ts index 32c750f..9075e5c 100644 --- a/src/preload/capturer.ts +++ b/src/preload/capturer.ts @@ -42,10 +42,6 @@ export async function getDisplayMediaSelector() { `; } -const screenShareCSS = ` - -`; - const screenShareJS = ` window.navigator.mediaDevices.getDisplayMedia = () => new Promise(async (resolve, reject) => { try { diff --git a/src/preload/preload.ts b/src/preload/preload.ts index 5f91140..ac6ccf7 100644 --- a/src/preload/preload.ts +++ b/src/preload/preload.ts @@ -28,7 +28,7 @@ const clientMods = { flicker: "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js" }; -console.log("ArmCord"); +console.log("ArmCord " + version); ipcRenderer.on("themeLoader", (event, message) => { addStyle(message); }); diff --git a/src/preload/titlebar.ts b/src/preload/titlebar.ts index a3fe1bc..5bbcc7e 100644 --- a/src/preload/titlebar.ts +++ b/src/preload/titlebar.ts @@ -5,6 +5,11 @@ import * as path from "path"; import os from "os"; export function injectTitlebar() { document.addEventListener("DOMContentLoaded", function (event) { + if (window.armcord.channel == "hummus") { + window.alert( + "ArmCord Titlebar doesn't currently work well in Hummus, please change ArmCord style to native for better experience." + ); + } var elem = document.createElement("div"); elem.innerHTML = `