diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index ba7dc696..b8ebff50 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -36,7 +36,7 @@ import { Plugin } from "@utils/types"; import { findByPropsLazy } from "@webpack"; import { Alerts, Button, Card, Forms, lodash, Parser, React, Select, Text, TextInput, Toasts, Tooltip, useMemo } from "@webpack/common"; -import Plugins, { ExcludedPlugins } from "~plugins"; +import Plugins, { ExcludedPlugins, PluginMeta } from "~plugins"; // Avoid circular dependency const { startDependenciesRecursive, startPlugin, stopPlugin } = proxyLazy(() => require("../../plugins")); @@ -327,10 +327,28 @@ export default function PluginSettings() { } } + // Code directly taken from supportHelper.tsx + const isApiPlugin = (plugin: string) => plugin.endsWith("API") || Plugins[plugin].required; + + const totalPlugins = Object.keys(Plugins).filter(p => !isApiPlugin(p)); + const enabledPlugins = Object.keys(Plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && !isApiPlugin(p)); + + const totalStockPlugins = totalPlugins.filter(p => !PluginMeta[p].userPlugin).length; + const totalUserPlugins = totalPlugins.filter(p => PluginMeta[p].userPlugin).length; + const enabledStockPlugins = enabledPlugins.filter(p => !PluginMeta[p].userPlugin).length; + const enabledUserPlugins = enabledPlugins.filter(p => PluginMeta[p].userPlugin).length; + return ( + + + Plugins Information + Total Plugins: {totalStockPlugins}, Total User Plugins: {totalUserPlugins} + Enabled Plugins: {enabledStockPlugins}, Enabled User Plugins: {enabledUserPlugins} + + Filters