Fix Volume On SoundBoardLogger

This commit is contained in:
thororen1234 2024-07-20 01:41:32 -04:00
parent d5037ffbde
commit c7e48b1c26
7 changed files with 19 additions and 26 deletions

View file

@ -54,7 +54,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- DoubleCounterBypass by nyx
- EmojiDumper by Cortex, Samwich, Woosh
- Encryptcord by Inbestigator
- EquicordCSS by FoxStorm1 and thororen (and all respective css developers)
- EquicordCSS by thororen (and all respective css developers)
- ExportContacts by dat_insanity
- FindReply by newwares
- FrequentQuickSwitcher by Samwich
@ -98,7 +98,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- OnePingPerDM by ProffDea
- PlatformSpoofer by Drag
- PurgeMessages by bhop and nyx
- QuestCompleter by HappyEnderman, SerStars, thororen
- QuestCompleter by HappyEnderman, SerStars (maintained by thororen)
- QuestionMarkReplacement by nyx
- Quoter by Samwich
- RepeatMessage by Tolgchu
@ -111,7 +111,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- ServerSearch by camila314
- ShowBadgesInChat by Inbestigator and KrystalSkull
- Slap by Korbo
- SoundBoardLogger by Moxxie, fres, echo, thororen
- SoundBoardLogger by Moxxie, fres, echo (maintained by thororen)
- TalkInReverse by Tolgchu
- TeX by Kyuuhachi
- TextToSpeech by Samwich
@ -119,8 +119,8 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
- Title by Kyuuhachi
- TosuRPC by AutumnVN
- Translate+ by Prince527 (Using Translate by Ven)
- UnlimitedAccounts by Balaclava and thororen
- UserPFP by nexpid and thororen
- UnlimitedAccounts by thororen
- UserPFP by nexpid (maintained by thororen)
- UwUifier by echo
- VCSupport by thororen
- VencordRPC by AutumnVN

View file

@ -74,7 +74,7 @@ migratePluginSettings("EquicordCSS", "EquicordBuiltIn");
export default definePlugin({
name: "EquicordCSS",
description: "CSS for Equicord users. You will need to look at the settings.",
authors: [EquicordDevs.FoxStorm1, EquicordDevs.thororen],
authors: [EquicordDevs.thororen],
dependencies: ["ThemeAttributes"],
settings,
start() {

View file

@ -9,9 +9,10 @@ import { Flex } from "@components/Flex";
import { Margins } from "@utils/margins";
import { classes, copyWithToast } from "@utils/misc";
import { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
import { Button, Clickable, ContextMenuApi, FluxDispatcher, Forms, Menu, Text, Tooltip, useEffect, UserUtils, useState } from "@webpack/common";
import { Button, Clickable, Forms, Text, Tooltip, useEffect, UserUtils, useState } from "@webpack/common";
import { User } from "discord-types/general";
import settings from "../settings";
import { clearLoggedSounds, getLoggedSounds } from "../store";
import { addListener, AvatarStyles, cl, downloadAudio, getEmojiUrl, playSound, removeListener, SoundLogEntry, UserSummaryItem } from "../utils";
import { openMoreUsersModal } from "./MoreUsersModal";
@ -92,17 +93,6 @@ export default function SoundBoardLog({ data, closeModal }) {
openUserModal(item, user, sounds);
}
function SoundContextMenu({ item }) {
const label = id => `soundboardlogger-${id}`;
return (
<Menu.Menu
navId="soundboardlogger-sound-menu"
onClose={() => FluxDispatcher.dispatch({ type: "CONTEXT_MENU_CLOSE" })}
>
</Menu.Menu>
);
}
return (
<>
<ModalHeader className={cl("modal-header")}>
@ -116,9 +106,6 @@ export default function SoundBoardLog({ data, closeModal }) {
return (
<div
className={cl("sound")}
onContextMenu={e =>
ContextMenuApi.openContextMenu(e, () => <SoundContextMenu item={item} />)
}
>
<Flex flexDirection="row" className={cl("sound-info")}>
<img
@ -156,7 +143,7 @@ export default function SoundBoardLog({ data, closeModal }) {
<Flex flexDirection="row" className={cl("sound-buttons")}>
<Button color={Button.Colors.PRIMARY} size={Button.Sizes.SMALL} onClick={() => downloadAudio(item.soundId)}>Download</Button>
<Button color={Button.Colors.GREEN} size={Button.Sizes.SMALL} onClick={() => copyWithToast(item.soundId, "ID copied to clipboard!")}>Copy ID</Button>
<Tooltip text={"Soundboard volume: currently broken"}>
<Tooltip text={`Soundboard volume: ${Math.floor(settings.store.soundVolume * 100)}%`}>
{({ onMouseEnter, onMouseLeave }) =>
<Button color={Button.Colors.BRAND} size={Button.Sizes.SMALL} onClick={() => playSound(item.soundId)} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>Play Sound</Button>
}

View file

@ -87,7 +87,13 @@ const settings = definePluginSettings({
description: "show the logs",
component: () =>
<Button color={Button.Colors.LINK} size={Button.Sizes.SMALL} onClick={openSoundBoardLog}>Open Logs</Button>
}
},
soundVolume: {
description: "How loud the toggle sound is (0 to disable)",
type: OptionType.SLIDER,
default: 0.5,
markers: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
},
});
export default settings;

View file

@ -41,7 +41,7 @@ export function getEmojiUrl(emoji) {
export const playSound = id => {
const audio = new Audio(`https://cdn.discordapp.com/soundboard-sounds/${id}`);
audio.volume = 75 / 100;
audio.volume = settings.store.soundVolume;
audio.play();
};

View file

@ -32,7 +32,7 @@ const settings = definePluginSettings({
export default definePlugin({
name: "UnlimitedAccounts",
description: "Increases the amount of accounts you can add.",
authors: [EquicordDevs.Balaclava, EquicordDevs.thororen],
authors: [EquicordDevs.thororen],
settings,
patches: [
{

View file

@ -5,8 +5,8 @@
*/
import { definePluginSettings } from "@api/Settings";
import { EquicordDevs } from "@utils/constants";
import { makeRange } from "@components/PluginSettings/components";
import { EquicordDevs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { ReactNode } from "react";