From 96dc2e12d030ac6d725bdfc58f1c47d35aae67a8 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Tue, 4 Apr 2023 10:26:53 -0300 Subject: Fix Web & Game Activity Toggle (#777) --- src/plugins/consoleShortcuts.ts | 1 + src/plugins/devCompanion.dev.tsx | 6 ++++- src/plugins/gameActivityToggle/index.tsx | 45 +++++++++++++++++--------------- src/plugins/gameActivityToggle/style.css | 16 ------------ 4 files changed, 30 insertions(+), 38 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/consoleShortcuts.ts b/src/plugins/consoleShortcuts.ts index 056d246..0489c2c 100644 --- a/src/plugins/consoleShortcuts.ts +++ b/src/plugins/consoleShortcuts.ts @@ -72,6 +72,7 @@ export default definePlugin({ findAllByProps: (...props: string[]) => findAll(filters.byProps(...props)), findByCode: newFindWrapper(filters.byCode), findAllByCode: (code: string) => findAll(filters.byCode(code)), + findStore: newFindWrapper(filters.byStoreName), PluginsApi: Vencord.Plugins, plugins: Vencord.Plugins.plugins, React, diff --git a/src/plugins/devCompanion.dev.tsx b/src/plugins/devCompanion.dev.tsx index c675fc2..b84dd75 100644 --- a/src/plugins/devCompanion.dev.tsx +++ b/src/plugins/devCompanion.dev.tsx @@ -161,7 +161,11 @@ function initWs(isManual = false) { return reply("Expected exactly one 'find' matches, found " + keys.length); const mod = candidates[keys[0]]; - let src = String(mod.original ?? mod); + let src = String(mod.original ?? mod).replaceAll("\n", ""); + + if (src.startsWith("function(")) { + src = "0," + src; + } let i = 0; diff --git a/src/plugins/gameActivityToggle/index.tsx b/src/plugins/gameActivityToggle/index.tsx index 6926505..c656f3c 100644 --- a/src/plugins/gameActivityToggle/index.tsx +++ b/src/plugins/gameActivityToggle/index.tsx @@ -21,36 +21,39 @@ import { disableStyle, enableStyle } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; -import { Tooltip } from "@webpack/common"; +import { findByCodeLazy } from "@webpack"; import style from "./style.css?managed"; const ShowCurrentGame = getSettingStoreLazy("status", "showCurrentGame"); +const Button = findByCodeLazy("Button.Sizes.NONE,disabled:"); + +function makeIcon(showCurrentGame?: boolean) { + return function () { + return ( + + + {!showCurrentGame && } + + ); + }; +} function GameActivityToggleButton() { const showCurrentGame = ShowCurrentGame?.useSetting(); return ( - - {tooltipProps => ( - - )} - +