diff --git a/src/plugins/secretRingTone/index.ts b/src/plugins/secretRingTone/index.ts index be804efc..f2913afd 100644 --- a/src/plugins/secretRingTone/index.ts +++ b/src/plugins/secretRingTone/index.ts @@ -4,21 +4,38 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; -import definePlugin from "@utils/types"; +import definePlugin, { OptionType } from "@utils/types"; + +const settings = definePluginSettings({ + onlySnow: { + type: OptionType.BOOLEAN, + description: "Only play the Snow Halation Theme", + default: false, + restartNeeded: true + } +}); -// NOTE - Ultimately should probably be turned into a ringtone picker plugin export default definePlugin({ name: "SecretRingToneEnabler", description: "Always play the secret version of the discord ringtone (except during special ringtone events)", - authors: [Devs.AndrewDLO, Devs.FieryFlames], + authors: [Devs.AndrewDLO, Devs.FieryFlames, Devs.RamziAH], + settings, patches: [ { find: '"call_ringing_beat"', - replacement: { - match: /500!==\i\(\)\.random\(1,1e3\)/, - replace: "false", - } - }, - ], + replacement: [ + { + match: /500!==\i\(\)\.random\(1,1e3\)/, + replace: "false" + }, + { + predicate: () => settings.store.onlySnow, + match: /"call_ringing_beat",/, + replace: "" + } + ] + } + ] }); diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 7fb2b6bf..b0ad77fb 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -566,6 +566,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "niko", id: 341377368075796483n, }, + RamziAH: { + name: "RamziAH", + id: 1279957227612147747n, + }, } satisfies Record); // iife so #__PURE__ works correctly