new plugin: notificationVolume (#1992)
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
613b2dc5f6
commit
9faa1331da
3
src/plugins/notificationVolume/README.md
Normal file
3
src/plugins/notificationVolume/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# NotificationVolume
|
||||||
|
|
||||||
|
Set a separate volume for notifications and in-app sounds (e.g. messages, call sound, mute/unmute) helping your ears stay healthy for many years to come.
|
35
src/plugins/notificationVolume/index.ts
Normal file
35
src/plugins/notificationVolume/index.ts
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2023 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";
|
||||||
|
|
||||||
|
const settings = definePluginSettings({
|
||||||
|
notificationVolume: {
|
||||||
|
type: OptionType.SLIDER,
|
||||||
|
description: "Notification volume",
|
||||||
|
markers: [0, 25, 50, 75, 100],
|
||||||
|
default: 100,
|
||||||
|
stickToMarkers: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default definePlugin({
|
||||||
|
name: "NotificationVolume",
|
||||||
|
description: "Save your ears and set a separate volume for notifications and in-app sounds",
|
||||||
|
authors: [Devs.philipbry],
|
||||||
|
settings,
|
||||||
|
patches: [
|
||||||
|
{
|
||||||
|
find: "_ensureAudio(){",
|
||||||
|
replacement: {
|
||||||
|
match: /onloadeddata=\(\)=>\{.\.volume=/,
|
||||||
|
replace: "$&$self.settings.store.notificationVolume/100*"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
|
@ -387,6 +387,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
||||||
name: "ant0n",
|
name: "ant0n",
|
||||||
id: 145224646868860928n
|
id: 145224646868860928n
|
||||||
},
|
},
|
||||||
|
philipbry: {
|
||||||
|
name: "philipbry",
|
||||||
|
id: 554994003318276106n
|
||||||
|
},
|
||||||
Korbo: {
|
Korbo: {
|
||||||
name: "Korbo",
|
name: "Korbo",
|
||||||
id: 455856406420258827n
|
id: 455856406420258827n
|
||||||
|
|
Loading…
Reference in a new issue