mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 13:23:28 -05:00
Fix Volume On SoundBoardLogger
This commit is contained in:
parent
d5037ffbde
commit
c7e48b1c26
7 changed files with 19 additions and 26 deletions
10
README.md
10
README.md
|
@ -54,7 +54,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
|
||||||
- DoubleCounterBypass by nyx
|
- DoubleCounterBypass by nyx
|
||||||
- EmojiDumper by Cortex, Samwich, Woosh
|
- EmojiDumper by Cortex, Samwich, Woosh
|
||||||
- Encryptcord by Inbestigator
|
- 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
|
- ExportContacts by dat_insanity
|
||||||
- FindReply by newwares
|
- FindReply by newwares
|
||||||
- FrequentQuickSwitcher by Samwich
|
- FrequentQuickSwitcher by Samwich
|
||||||
|
@ -98,7 +98,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
|
||||||
- OnePingPerDM by ProffDea
|
- OnePingPerDM by ProffDea
|
||||||
- PlatformSpoofer by Drag
|
- PlatformSpoofer by Drag
|
||||||
- PurgeMessages by bhop and nyx
|
- PurgeMessages by bhop and nyx
|
||||||
- QuestCompleter by HappyEnderman, SerStars, thororen
|
- QuestCompleter by HappyEnderman, SerStars (maintained by thororen)
|
||||||
- QuestionMarkReplacement by nyx
|
- QuestionMarkReplacement by nyx
|
||||||
- Quoter by Samwich
|
- Quoter by Samwich
|
||||||
- RepeatMessage by Tolgchu
|
- RepeatMessage by Tolgchu
|
||||||
|
@ -111,7 +111,7 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
|
||||||
- ServerSearch by camila314
|
- ServerSearch by camila314
|
||||||
- ShowBadgesInChat by Inbestigator and KrystalSkull
|
- ShowBadgesInChat by Inbestigator and KrystalSkull
|
||||||
- Slap by Korbo
|
- Slap by Korbo
|
||||||
- SoundBoardLogger by Moxxie, fres, echo, thororen
|
- SoundBoardLogger by Moxxie, fres, echo (maintained by thororen)
|
||||||
- TalkInReverse by Tolgchu
|
- TalkInReverse by Tolgchu
|
||||||
- TeX by Kyuuhachi
|
- TeX by Kyuuhachi
|
||||||
- TextToSpeech by Samwich
|
- TextToSpeech by Samwich
|
||||||
|
@ -119,8 +119,8 @@ An enhanced version of [Vencord](https://github.com/Vendicated/Vencord) by [Vend
|
||||||
- Title by Kyuuhachi
|
- Title by Kyuuhachi
|
||||||
- TosuRPC by AutumnVN
|
- TosuRPC by AutumnVN
|
||||||
- Translate+ by Prince527 (Using Translate by Ven)
|
- Translate+ by Prince527 (Using Translate by Ven)
|
||||||
- UnlimitedAccounts by Balaclava and thororen
|
- UnlimitedAccounts by thororen
|
||||||
- UserPFP by nexpid and thororen
|
- UserPFP by nexpid (maintained by thororen)
|
||||||
- UwUifier by echo
|
- UwUifier by echo
|
||||||
- VCSupport by thororen
|
- VCSupport by thororen
|
||||||
- VencordRPC by AutumnVN
|
- VencordRPC by AutumnVN
|
||||||
|
|
|
@ -74,7 +74,7 @@ migratePluginSettings("EquicordCSS", "EquicordBuiltIn");
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "EquicordCSS",
|
name: "EquicordCSS",
|
||||||
description: "CSS for Equicord users. You will need to look at the settings.",
|
description: "CSS for Equicord users. You will need to look at the settings.",
|
||||||
authors: [EquicordDevs.FoxStorm1, EquicordDevs.thororen],
|
authors: [EquicordDevs.thororen],
|
||||||
dependencies: ["ThemeAttributes"],
|
dependencies: ["ThemeAttributes"],
|
||||||
settings,
|
settings,
|
||||||
start() {
|
start() {
|
||||||
|
|
|
@ -9,9 +9,10 @@ import { Flex } from "@components/Flex";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
import { classes, copyWithToast } from "@utils/misc";
|
import { classes, copyWithToast } from "@utils/misc";
|
||||||
import { closeModal, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
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 { User } from "discord-types/general";
|
||||||
|
|
||||||
|
import settings from "../settings";
|
||||||
import { clearLoggedSounds, getLoggedSounds } from "../store";
|
import { clearLoggedSounds, getLoggedSounds } from "../store";
|
||||||
import { addListener, AvatarStyles, cl, downloadAudio, getEmojiUrl, playSound, removeListener, SoundLogEntry, UserSummaryItem } from "../utils";
|
import { addListener, AvatarStyles, cl, downloadAudio, getEmojiUrl, playSound, removeListener, SoundLogEntry, UserSummaryItem } from "../utils";
|
||||||
import { openMoreUsersModal } from "./MoreUsersModal";
|
import { openMoreUsersModal } from "./MoreUsersModal";
|
||||||
|
@ -92,17 +93,6 @@ export default function SoundBoardLog({ data, closeModal }) {
|
||||||
openUserModal(item, user, sounds);
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<ModalHeader className={cl("modal-header")}>
|
<ModalHeader className={cl("modal-header")}>
|
||||||
|
@ -116,9 +106,6 @@ export default function SoundBoardLog({ data, closeModal }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cl("sound")}
|
className={cl("sound")}
|
||||||
onContextMenu={e =>
|
|
||||||
ContextMenuApi.openContextMenu(e, () => <SoundContextMenu item={item} />)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Flex flexDirection="row" className={cl("sound-info")}>
|
<Flex flexDirection="row" className={cl("sound-info")}>
|
||||||
<img
|
<img
|
||||||
|
@ -156,7 +143,7 @@ export default function SoundBoardLog({ data, closeModal }) {
|
||||||
<Flex flexDirection="row" className={cl("sound-buttons")}>
|
<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.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>
|
<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 }) =>
|
{({ onMouseEnter, onMouseLeave }) =>
|
||||||
<Button color={Button.Colors.BRAND} size={Button.Sizes.SMALL} onClick={() => playSound(item.soundId)} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>Play Sound</Button>
|
<Button color={Button.Colors.BRAND} size={Button.Sizes.SMALL} onClick={() => playSound(item.soundId)} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>Play Sound</Button>
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,13 @@ const settings = definePluginSettings({
|
||||||
description: "show the logs",
|
description: "show the logs",
|
||||||
component: () =>
|
component: () =>
|
||||||
<Button color={Button.Colors.LINK} size={Button.Sizes.SMALL} onClick={openSoundBoardLog}>Open Logs</Button>
|
<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;
|
export default settings;
|
||||||
|
|
|
@ -41,7 +41,7 @@ export function getEmojiUrl(emoji) {
|
||||||
|
|
||||||
export const playSound = id => {
|
export const playSound = id => {
|
||||||
const audio = new Audio(`https://cdn.discordapp.com/soundboard-sounds/${id}`);
|
const audio = new Audio(`https://cdn.discordapp.com/soundboard-sounds/${id}`);
|
||||||
audio.volume = 75 / 100;
|
audio.volume = settings.store.soundVolume;
|
||||||
audio.play();
|
audio.play();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ const settings = definePluginSettings({
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "UnlimitedAccounts",
|
name: "UnlimitedAccounts",
|
||||||
description: "Increases the amount of accounts you can add.",
|
description: "Increases the amount of accounts you can add.",
|
||||||
authors: [EquicordDevs.Balaclava, EquicordDevs.thororen],
|
authors: [EquicordDevs.thororen],
|
||||||
settings,
|
settings,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { EquicordDevs } from "@utils/constants";
|
|
||||||
import { makeRange } from "@components/PluginSettings/components";
|
import { makeRange } from "@components/PluginSettings/components";
|
||||||
|
import { EquicordDevs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue