diff --git a/src/plugins/rpcEditor/index.tsx b/src/plugins/rpcEditor/index.tsx new file mode 100644 index 000000000..098ebecf1 --- /dev/null +++ b/src/plugins/rpcEditor/index.tsx @@ -0,0 +1,72 @@ +/* + * 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 { Devs } from "@utils/constants"; +import definePlugin, { OptionType } from "@utils/types"; +import { Forms, React, TextInput, useState } from "@webpack/common"; +import { DataStore } from "@api/index"; + +const DATASTORE_IDS_KEY = "RPCEditor_ActivityIds"; + +function Input({ initialValue, onChange, placeholder }: { + placeholder: string; + initialValue: string; + onChange(value: string): void; +}) { + const [value, setValue] = useState(initialValue); + return ( + + ); +} + +export const settings = definePluginSettings({ + idsToEdit: { + type: OptionType.COMPONENT, + description: "", + component: async () => { + return ( + <> + Comma separated list of activity IDs/names to + edit + explode()}/> + + ); + } + } +}); + +function explode() { + +} + +export default definePlugin({ + name: "RPCEditor", + description: "Allows editing the type or content of any Rich Presence. (Configure in settings)", + authors: [Devs.nin0dev], + patches: [ + { + find: "LocalActivityStore", + replacement: { + match: /LOCAL_ACTIVITY_UPDATE:function\((\i)\)\{/, + replace: "$&$self.patchActivity($1.activity);", + } + } + ], + settings, + patchActivity(activity: any) { + // not finished, this'll change all activities to listening :husk: + console.log(activity); + activity.type = 2; + activity.assets.large_text = null; // bomb premid image text + }, +}); diff --git a/src/plugins/rpcTypeEditor/index.tsx b/src/plugins/rpcTypeEditor/index.tsx deleted file mode 100644 index 1a1ba43af..000000000 --- a/src/plugins/rpcTypeEditor/index.tsx +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 { Devs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; - -export const settings = definePluginSettings({ - listeningActivities: { - type: OptionType.STRING, - description: "Comma separated list of activity IDs/names to change to Listening", - placeholder: "235839274917592729, YouTube Music" - }, - watchingActivities: { - type: OptionType.STRING, - description: "Comma separated list of activity IDs/names to change to Watching", - placeholder: "706754902072267788, YouTube" - }, - competingActivities: { - type: OptionType.STRING, - description: "Comma separated list of activity IDs/names to change to Competing", - placeholder: "373833473001936546, Overwatch" - }, - noLargeImageTextListening: { - type: OptionType.STRING, - description: "Comma separated list of activity IDs/names to remove the large image text for", - placeholder: "589556910426816513, Minecraft" - } -}); - -export default definePlugin({ - name: "RPCTypeEditor", - description: "Allows editing the type of any Rich Presence. (Configure in settings)", - authors: [Devs.nin0dev], - patches: [ - { - find: "LocalActivityStore", - replacement: { - match: /LOCAL_ACTIVITY_UPDATE:function\((\i)\)\{/, - replace: "$&$self.patchActivity($1.activity);", - } - } - ], - settings, - patchActivity(activity: any) { - // not finished, this'll change all activities to listening :husk: - activity.type = 2; - }, -});