From 34c74b43bd73259ea0d8458515544b3bd7c189dd Mon Sep 17 00:00:00 2001 From: Haruka <96925398+nakoyasha@users.noreply.github.com> Date: Tue, 9 Apr 2024 04:56:28 +0300 Subject: [PATCH] new plugin UnlockedAvatarZoom: allows crop zooming in further (#2287) Co-authored-by: V --- src/plugins/unlockedAvatarZoom/README.md | 5 ++++ src/plugins/unlockedAvatarZoom/index.ts | 35 ++++++++++++++++++++++++ src/utils/constants.ts | 4 +++ 3 files changed, 44 insertions(+) create mode 100644 src/plugins/unlockedAvatarZoom/README.md create mode 100644 src/plugins/unlockedAvatarZoom/index.ts diff --git a/src/plugins/unlockedAvatarZoom/README.md b/src/plugins/unlockedAvatarZoom/README.md new file mode 100644 index 000000000..9ecd0b1a4 --- /dev/null +++ b/src/plugins/unlockedAvatarZoom/README.md @@ -0,0 +1,5 @@ +# UnlockedAvatarZoom + +Allows you to zoom in further in the image crop tool when changing your avatar + +![](https://raw.githubusercontent.com/Vencord/plugin-assets/main/UnlockedAvatarZoom/demo.avif) diff --git a/src/plugins/unlockedAvatarZoom/index.ts b/src/plugins/unlockedAvatarZoom/index.ts new file mode 100644 index 000000000..08503eb8b --- /dev/null +++ b/src/plugins/unlockedAvatarZoom/index.ts @@ -0,0 +1,35 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2024 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { definePluginSettings } from "@api/Settings"; +import { makeRange } from "@components/PluginSettings/components"; +import { Devs } from "@utils/constants"; +import definePlugin, { OptionType } from "@utils/types"; + +const settings = definePluginSettings({ + zoomMultiplier: { + type: OptionType.SLIDER, + description: "Zoom multiplier", + markers: makeRange(2, 16), + default: 4, + }, +}); + +export default definePlugin({ + name: "UnlockedAvatarZoom", + description: "Allows you to zoom in further in the image crop tool when changing your avatar", + authors: [Devs.nakoyasha], + settings, + patches: [ + { + find: ".Messages.AVATAR_UPLOAD_EDIT_MEDIA", + replacement: { + match: /maxValue:\d/, + replace: "maxValue:$self.settings.store.zoomMultiplier", + } + } + ] +}); diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 04a4f6778..3098e29d0 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -426,6 +426,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "newwares", id: 421405303951851520n }, + nakoyasha: { + name: "nakoyasha", + id: 222069018507345921n + }, Sqaaakoi: { name: "Sqaaakoi", id: 259558259491340288n