From 6c4a501e63eae3a20ea32d55f679a18427e39185 Mon Sep 17 00:00:00 2001 From: rylie-b Date: Mon, 23 Dec 2024 13:42:34 -0600 Subject: [PATCH] add changes for DisableAnimations DisableAnimations to remove all automatically and/or hovering animations from profile and server doodads. --- src/plugins/DisableAnimations/index.ts | 44 ++++++++++++++++++++++++++ src/utils/constants.ts | 4 +++ 2 files changed, 48 insertions(+) create mode 100644 src/plugins/DisableAnimations/index.ts diff --git a/src/plugins/DisableAnimations/index.ts b/src/plugins/DisableAnimations/index.ts new file mode 100644 index 0000000000..fc7f8893b8 --- /dev/null +++ b/src/plugins/DisableAnimations/index.ts @@ -0,0 +1,44 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2024 Vendicated and contributors* + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { Devs } from "@utils/constants"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "NeverAnimate", + description: "Freezes profile and server-centric that can be animated, but leaves embeded gifs untouched.", + authors: [Devs.Rylie], + + patches: [ + { + find: "canAnimate:", + all: true, + noWarn: true, + replacement: { + match: /canAnimate:.+?([,}].*?\))/g, + replace: (m, rest) => { + const destructuringMatch = rest.match(/}=.+/); + if (destructuringMatch == null) return `canAnimate:!1${rest}`; + return m; + } + } + }, + { + find: "#{intl::GUILD_OWNER}", + replacement: { + match: /(?<=\.activityEmoji,.+?animate:)\i/, + replace: "!1" + } + }, + { + find: ".animatedBannerHoverLayer,onMouseEnter:", + replacement: { + match: /(?<=guildBanner:\i,animate:)\i(?=}\))/, + replace: "!1" + } + } + ] +}); diff --git a/src/utils/constants.ts b/src/utils/constants.ts index e758259125..59b692725e 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -579,6 +579,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "jamesbt365", id: 158567567487795200n, }, + Rylie: { + name: "Rylie", + id: 95705726327992320n, + }, } satisfies Record); // iife so #__PURE__ works correctly