From 60f69e450347485ff3291f2878027c41e6bf392c Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:28:27 -0500 Subject: [PATCH] Merge branch 'dev' --- README.md | 3 +- src/components/VencordSettings/VencordTab.tsx | 4 +- .../index.ts | 2 +- src/equicordplugins/glide/index.tsx | 49 +++++++++++-------- src/equicordplugins/hideScreenShare/index.ts | 35 +++++++++++++ .../neverPausePreviews/index.tsx | 2 +- src/main/utils/extensions.ts | 7 ++- src/plugins/showHiddenThings/index.ts | 45 ++--------------- 8 files changed, 79 insertions(+), 68 deletions(-) rename src/equicordplugins/{disableAnimations => disableAnimations.desktop}/index.ts (97%) create mode 100644 src/equicordplugins/hideScreenShare/index.ts diff --git a/README.md b/README.md index 792f9434..38347364 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch ### Extra included plugins
-151 additional plugins +152 additional plugins ### All Platforms - AllCallTimers by MaxHerbold & D3SOX @@ -70,6 +70,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch - GrammarFix by S€th - HideChatButtons by iamme - HideMessage by Hanzy +- HideScreenShare by thororen - HideServers by bepvte - HolyNotes by Wolfie - HomeTyping by Samwich diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx index deabef4a..55ff94ab 100644 --- a/src/components/VencordSettings/VencordTab.tsx +++ b/src/components/VencordSettings/VencordTab.tsx @@ -109,8 +109,8 @@ function EquicordSettings() { title: "Enable window transparency.", note: "You need a theme that supports transparency or this will do nothing. Requires a full restart!", warning: { - enabled: true, - message: "This will stop the window from being resizable.", + enabled: isWindows, + message: "Enabling this will prevent you from snapping this window.", }, }, !IS_WEB && diff --git a/src/equicordplugins/disableAnimations/index.ts b/src/equicordplugins/disableAnimations.desktop/index.ts similarity index 97% rename from src/equicordplugins/disableAnimations/index.ts rename to src/equicordplugins/disableAnimations.desktop/index.ts index 865e9cf0..65a754b6 100644 --- a/src/equicordplugins/disableAnimations/index.ts +++ b/src/equicordplugins/disableAnimations.desktop/index.ts @@ -25,7 +25,7 @@ export default definePlugin({ description: "Disables most of Discord's animations.", authors: [EquicordDevs.seth], start() { - this.springs = findAll((mod) => { + this.springs = findAll(mod => { if (!mod.Globals) return false; return true; }); diff --git a/src/equicordplugins/glide/index.tsx b/src/equicordplugins/glide/index.tsx index 6b31fee8..0201e091 100644 --- a/src/equicordplugins/glide/index.tsx +++ b/src/equicordplugins/glide/index.tsx @@ -142,6 +142,11 @@ const settings = definePluginSettings({ default: "0.2", onChange: injectCSS }, + colorsEnabled: { + type: OptionType.BOOLEAN, + description: "Whether or not to enable theming", + onChange: () => injectCSS() + }, ColorPreset: { type: OptionType.SELECT, description: "Some pre-made color presets (more soon hopefully)", @@ -238,18 +243,20 @@ function parseFontContent() { return fontName; } function injectCSS() { + if (Settings.plugins.Glide.enabled) { - const fontName = parseFontContent(); - const theCSS = getCSS(fontName); + const fontName = parseFontContent(); + const theCSS = getCSS(fontName); - var elementToRemove = document.getElementById("GlideStyleInjection"); - if (elementToRemove) { - elementToRemove.remove(); + const elementToRemove = document.getElementById("GlideStyleInjection"); + if (elementToRemove) { + elementToRemove.remove(); + } + const styleElement = document.createElement("style"); + styleElement.id = "GlideStyleInjection"; + styleElement.textContent = theCSS; + document.documentElement.appendChild(styleElement); } - const styleElement = document.createElement("style"); - styleElement.id = "GlideStyleInjection"; - styleElement.textContent = theCSS; - document.documentElement.appendChild(styleElement); } function getCSS(fontName) { @@ -318,13 +325,15 @@ function getCSS(fontName) { { --animspeed: ${Settings.plugins.Glide.animationSpeed + "s"}; --font-primary: ${(fontName.length > 0 ? fontName : "Nunito")}; - --accent: #${Settings.plugins.Glide.Accent}; - --bgcol: #${Settings.plugins.Glide.Primary}; - --text: #${Settings.plugins.Glide.Text}; - --brand: #${Settings.plugins.Glide.Brand}; - --mutedtext: ${mute(Settings.plugins.Glide.Text, 20)}; - --mutedbrand: ${mute(Settings.plugins.Glide.Brand, 10)}; - --mutedaccent: ${mute(Settings.plugins.Glide.Accent, 10)}; + ${Settings.plugins.Glide.colorsEnabled ? ` + --accent: #${Settings.plugins.Glide.Accent}; + --bgcol: #${Settings.plugins.Glide.Primary}; + --text: #${Settings.plugins.Glide.Text}; + --brand: #${Settings.plugins.Glide.Brand}; + --mutedtext: ${mute(Settings.plugins.Glide.Text, 20)}; + --mutedbrand: ${mute(Settings.plugins.Glide.Brand, 10)}; + --mutedaccent: ${mute(Settings.plugins.Glide.Accent, 10)}; + ` : ""} } :root { @@ -341,7 +350,7 @@ function getCSS(fontName) { /*COLOR ASSIGNING (most of these probably effect more than whats commented)*/ - + ${Settings.plugins.Glide.colorsEnabled ? ` /*accent based*/ /*buttons*/ @@ -521,7 +530,7 @@ function getCSS(fontName) { background-color: var(--primary); } ${settings.store.pastelStatuses ? - ` + ` /*Pastel statuses*/ rect[fill='#23a55a'], svg[fill='#23a55a'] { fill: #80c968 !important; @@ -546,7 +555,7 @@ function getCSS(fontName) { .unread_d8bfb3 { background-color: var(--text) !important; - } + }` : ""} /*ROUNDING (rounding)*/ @@ -642,7 +651,7 @@ function getCSS(fontName) { } /*Hide icon on file uploading status*/ - .icon_b52bef + .icon_f46c86 { display: none; } diff --git a/src/equicordplugins/hideScreenShare/index.ts b/src/equicordplugins/hideScreenShare/index.ts new file mode 100644 index 00000000..51c63790 --- /dev/null +++ b/src/equicordplugins/hideScreenShare/index.ts @@ -0,0 +1,35 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2022 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +import { EquicordDevs } from "@utils/constants"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "HideScreenShare", + description: "Hide your screen share by default", + authors: [EquicordDevs.thororen], + patches: [ + { + find: '"self-stream-hide"', + replacement: { + match: /return (\i)?(.*?onConfirm:\(\)=>((\i)\(!\i\)))/, + replace: "let $4 = null; if ($4 !== null) return $3; return $1$2" + } + } + ], +}); diff --git a/src/equicordplugins/neverPausePreviews/index.tsx b/src/equicordplugins/neverPausePreviews/index.tsx index bd9481ea..160bbf57 100644 --- a/src/equicordplugins/neverPausePreviews/index.tsx +++ b/src/equicordplugins/neverPausePreviews/index.tsx @@ -28,7 +28,7 @@ export default definePlugin({ authors: [EquicordDevs.vappstar], settingsAboutComponent: () => <> - This plugin will cause discord to use more resources than normal. + This plugin will cause discord to use more resources than normal , patches: [ diff --git a/src/main/utils/extensions.ts b/src/main/utils/extensions.ts index 4a354657..4d74a873 100644 --- a/src/main/utils/extensions.ts +++ b/src/main/utils/extensions.ts @@ -71,13 +71,16 @@ export async function installExt(id: string) { // React Devtools v4.25 // v4.27 is broken in Electron, see https://github.com/facebook/react/issues/25843 // Unfortunately, Google does not serve old versions, so this is the only way + // This zip file is pinned to long commit hash so it cannot be changed remotely ? "https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip" - : `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=32`; + : `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=${process.versions.chrome}`; + const buf = await get(url, { headers: { - "User-Agent": "Equicord (https://github.com/Equicord/Equicord)" + "User-Agent": `Electron ${process.versions.electron} ~ Equicord (https://github.com/Equicord/Equicord)` } }); + await extract(crxToZip(buf), extDir).catch(console.error); } diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index a5cf8129..6ee131a8 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -30,9 +30,7 @@ const opt = (description: string) => ({ const settings = definePluginSettings({ showTimeouts: opt("Show member timeout icons in chat."), showInvitesPaused: opt("Show the invites paused tooltip in the server list."), - showModView: opt("Show the member mod view context menu item in all servers."), - disableDiscoveryFilters: opt("Disable filters in Server Discovery search that hide servers that don't meet discovery criteria."), - disableDisallowedDiscoveryFilters: opt("Disable filters in Server Discovery search that hide NSFW & disallowed servers."), + showModView: opt("Show the member mod view context menu item in all servers.") }); export default definePlugin({ @@ -40,6 +38,8 @@ export default definePlugin({ tags: ["ShowTimeouts", "ShowInvitesPaused", "ShowModView", "DisableDiscoveryFilters"], description: "Displays various hidden & moderator-only things regardless of permissions.", authors: [Devs.Dolfies], + settings, + patches: [ { find: "showCommunicationDisabledStyles", @@ -82,43 +82,6 @@ export default definePlugin({ match: /\i(?=\?null)/, replace: "false" } - }, - { - find: "prod_discoverable_guilds", - predicate: () => settings.store.disableDiscoveryFilters, - replacement: { - match: /\{"auto_removed:.*?\}/, - replace: "{}" - } - }, - // remove the 200 server minimum - { - find: '">200"', - predicate: () => settings.store.disableDiscoveryFilters, - replacement: { - match: '">200"', - replace: '">0"' - } - }, - // empty word filter - { - find: '"pepe","nude"', - predicate: () => settings.store.disableDisallowedDiscoveryFilters, - replacement: { - match: /(?<=[?=])\["pepe",.+?\]/, - replace: "[]", - }, - }, - // patch request that queries if term is allowed - { - find: ".GUILD_DISCOVERY_VALID_TERM,query:", - predicate: () => settings.store.disableDisallowedDiscoveryFilters, - all: true, - replacement: { - match: /\i\.\i\.get\(\{url:\i\.\i\.GUILD_DISCOVERY_VALID_TERM,query:\{term:\i\},oldFormErrors:!0,rejectWithError:!1\}\)/g, - replace: "Promise.resolve({ body: { valid: true } })" - } } - ], - settings, + ] });