diff --git a/src/equicordplugins/soundBoardLogger/index.tsx b/src/equicordplugins/soundBoardLogger/index.tsx index e1cccedf..65836ccf 100644 --- a/src/equicordplugins/soundBoardLogger/index.tsx +++ b/src/equicordplugins/soundBoardLogger/index.tsx @@ -6,14 +6,12 @@ import { addChatBarButton, removeChatBarButton } from "@api/ChatButtons"; import { disableStyle, enableStyle } from "@api/Styles"; -import ErrorBoundary from "@components/ErrorBoundary"; import { Devs, EquicordDevs } from "@utils/constants"; import definePlugin from "@utils/types"; import { findExportedComponentLazy } from "@webpack"; import { FluxDispatcher } from "@webpack/common"; -import { ChatBarIcon, LogIcon } from "./components/Icons"; -import { openSoundBoardLog } from "./components/SoundBoardLog"; +import { ChatBarIcon } from "./components/Icons"; import settings from "./settings"; import { updateLoggedSounds } from "./store"; import styles from "./styles.css?managed"; @@ -21,31 +19,11 @@ import { getListeners } from "./utils"; const HeaderBarIcon = findExportedComponentLazy("Icon", "Divider"); -function OpenSBLogsButton() { - return ( - openSoundBoardLog()} - tooltip={"Open SoundBoard Log"} - icon={LogIcon} - /> - ); -} - export default definePlugin({ name: "SoundBoardLogger", authors: [Devs.Moxxie, EquicordDevs.Fres, Devs.echo, EquicordDevs.thororen], + dependencies: ["ChatInputButtonAPI"], settings, - patches: [ - { - predicate: () => settings.store.IconLocation === "toolbar", - find: "toolbar:function", - replacement: { - match: /(function \i\(\i\){)(.{1,200}toolbar.{1,100}mobileToolbar)/, - replace: "$1$self.addSBIconToToolBar(arguments[0]);$2" - } - } - ], description: "Logs all soundboards that are played in a voice chat and allows you to download them", start() { enableStyle(styles); @@ -54,25 +32,10 @@ export default definePlugin({ await updateLoggedSounds(sound); getListeners().forEach(cb => cb()); }); - if (settings.store.IconLocation === "chat") addChatBarButton("vc-soundlog-button", ChatBarIcon); + addChatBarButton("vc-soundlog-button", ChatBarIcon); }, stop() { disableStyle(styles); - if (settings.store.IconLocation === "chat") removeChatBarButton("vc-soundlog-button"); - }, - addSBIconToToolBar(e: { toolbar: React.ReactNode[] | React.ReactNode; }) { - if (Array.isArray(e.toolbar)) - return e.toolbar.push( - - - - ); - - e.toolbar = [ - - - , - e.toolbar, - ]; + removeChatBarButton("vc-soundlog-button"); } }); diff --git a/src/equicordplugins/soundBoardLogger/settings.tsx b/src/equicordplugins/soundBoardLogger/settings.tsx index 2053f07a..4c300344 100644 --- a/src/equicordplugins/soundBoardLogger/settings.tsx +++ b/src/equicordplugins/soundBoardLogger/settings.tsx @@ -73,15 +73,6 @@ const settings = definePluginSettings({ { label: ".wav", value: ".wav" }, ], }, - IconLocation: { - description: "choose where to show the SoundBoard Log icon (requires restart)", - type: OptionType.SELECT, - options: [ - { label: "Toolbar", value: "toolbar", default: true }, - { label: "Chat input", value: "chat" } - ], - restartNeeded: true - }, OpenLogs: { type: OptionType.COMPONENT, description: "show the logs",