Plugins Tab: Userplugins filter
@Eazvy
This commit is contained in:
parent
3371d78e5a
commit
7d997a50b7
4 changed files with 27 additions and 11 deletions
|
|
@ -52,7 +52,6 @@
|
|||
width: 100%;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vc-addon-author {
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ export function AddonCard({ disabled, isNew, sourceBadge, name, infoButton, foot
|
|||
{name}
|
||||
</div>
|
||||
</div>
|
||||
{sourceBadge}
|
||||
{isNew && <AddonBadge text="NEW" color="#ED4245" />}
|
||||
{sourceBadge}
|
||||
</Text>
|
||||
|
||||
{!!author && (
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ export function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, on
|
|||
const settings = Settings.plugins[plugin.name];
|
||||
const pluginMeta = PluginMeta[plugin.name];
|
||||
const isEquicordPlugin = pluginMeta?.folderName?.startsWith("src/equicordplugins/") ?? false;
|
||||
const isUserplugin = pluginMeta?.userPlugin ?? false;
|
||||
|
||||
const isEnabled = () => isPluginEnabled(plugin.name);
|
||||
|
||||
|
|
@ -104,11 +105,11 @@ export function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, on
|
|||
borderRadius: "2px"
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
) : isUserplugin ?
|
||||
<img
|
||||
src="https://vencord.dev/assets/favicon-dark.png"
|
||||
alt="Vencord"
|
||||
title="Vencord Plugin"
|
||||
src="https://equicord.org/assets/icons/userplugin.png"
|
||||
alt="Userplugin"
|
||||
title="Userplugin"
|
||||
style={{
|
||||
width: "20px",
|
||||
height: "20px",
|
||||
|
|
@ -116,7 +117,19 @@ export function PluginCard({ plugin, disabled, onRestartNeeded, onMouseEnter, on
|
|||
borderRadius: "2px"
|
||||
}}
|
||||
/>
|
||||
);
|
||||
: (
|
||||
<img
|
||||
src="https://vencord.dev/assets/favicon-dark.png"
|
||||
alt="Vencord"
|
||||
title="Vencord Plugin"
|
||||
style={{
|
||||
width: "20px",
|
||||
height: "20px",
|
||||
marginLeft: "8px",
|
||||
borderRadius: "2px"
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<AddonCard
|
||||
|
|
|
|||
|
|
@ -98,9 +98,10 @@ const enum SearchStatus {
|
|||
ALL,
|
||||
ENABLED,
|
||||
DISABLED,
|
||||
NEW,
|
||||
EQUICORD,
|
||||
VENCORD
|
||||
VENCORD,
|
||||
CUSTOM,
|
||||
NEW,
|
||||
}
|
||||
|
||||
function ExcludedPluginsList({ search }: { search: string; }) {
|
||||
|
|
@ -191,12 +192,14 @@ export default function PluginSettings() {
|
|||
const enabled = Vencord.Plugins.isPluginEnabled(plugin.name);
|
||||
const pluginMeta = PluginMeta[plugin.name];
|
||||
const isEquicordPlugin = pluginMeta?.folderName?.startsWith("src/equicordplugins/") ?? false;
|
||||
const isUserplugin = pluginMeta?.userPlugin ?? false;
|
||||
|
||||
if (enabled && status === SearchStatus.DISABLED) return false;
|
||||
if (!enabled && status === SearchStatus.ENABLED) return false;
|
||||
if (status === SearchStatus.NEW && !newPlugins?.includes(plugin.name)) return false;
|
||||
if (status === SearchStatus.EQUICORD && !isEquicordPlugin) return false;
|
||||
if (status === SearchStatus.VENCORD && isEquicordPlugin) return false;
|
||||
if (status === SearchStatus.CUSTOM && !isUserplugin) return false;
|
||||
if (!search.length) return true;
|
||||
|
||||
return (
|
||||
|
|
@ -369,9 +372,10 @@ export default function PluginSettings() {
|
|||
{ label: "Show All", value: SearchStatus.ALL, default: true },
|
||||
{ label: "Show Enabled", value: SearchStatus.ENABLED },
|
||||
{ label: "Show Disabled", value: SearchStatus.DISABLED },
|
||||
{ label: "Show New", value: SearchStatus.NEW },
|
||||
{ label: "Show Equicord", value: SearchStatus.EQUICORD },
|
||||
{ label: "Show Vencord", value: SearchStatus.VENCORD }
|
||||
{ label: "Show Vencord", value: SearchStatus.VENCORD },
|
||||
...(totalUserPlugins > 0 ? [{ label: "Show Custom", value: SearchStatus.CUSTOM }] : []),
|
||||
{ label: "Show New", value: SearchStatus.NEW },
|
||||
]}
|
||||
serialize={String}
|
||||
select={onStatusChange}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue