mirror of
https://github.com/RobinRMC/VencordPlus.git
synced 2025-05-10 17:35:39 +02:00
Update from upstream repository
This commit is contained in:
commit
d269d972e6
9 changed files with 157 additions and 87 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "vencord",
|
"name": "vencord",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"version": "1.11.9",
|
"version": "1.12.0",
|
||||||
"description": "Vencord+ is a fork of Vencord that adds unapproved plugins.",
|
"description": "Vencord+ is a fork of Vencord that adds unapproved plugins.",
|
||||||
"homepage": "https://github.com/RobinRMC/VencordPlus#readme",
|
"homepage": "https://github.com/RobinRMC/VencordPlus#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -50,6 +50,34 @@ function closeFolders() {
|
||||||
FolderUtils.toggleGuildFolderExpand(id);
|
FolderUtils.toggleGuildFolderExpand(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Nuckyz: Unsure if this should be a general utility or not
|
||||||
|
function filterTreeWithTargetNode(children: any, predicate: (node: any) => boolean) {
|
||||||
|
if (children == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Array.isArray(children)) {
|
||||||
|
if (predicate(children)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return filterTreeWithTargetNode(children.props?.children, predicate);
|
||||||
|
}
|
||||||
|
|
||||||
|
let childIsTargetChild = false;
|
||||||
|
for (let i = 0; i < children.length; i++) {
|
||||||
|
const shouldKeep = filterTreeWithTargetNode(children[i], predicate);
|
||||||
|
if (shouldKeep) {
|
||||||
|
childIsTargetChild = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
children.splice(i--, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return childIsTargetChild;
|
||||||
|
}
|
||||||
|
|
||||||
export const settings = definePluginSettings({
|
export const settings = definePluginSettings({
|
||||||
sidebar: {
|
sidebar: {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
|
@ -114,29 +142,35 @@ export default definePlugin({
|
||||||
predicate: () => settings.store.sidebar,
|
predicate: () => settings.store.sidebar,
|
||||||
replacement: [
|
replacement: [
|
||||||
// Create the isBetterFolders variable in the GuildsBar component
|
// Create the isBetterFolders variable in the GuildsBar component
|
||||||
|
// Needed because we access this from a non-arrow closure so we can't use arguments[0]
|
||||||
{
|
{
|
||||||
match: /let{disableAppDownload:\i=\i\.isPlatformEmbedded,isOverlay:.+?(?=}=\i,)/,
|
match: /let{disableAppDownload:\i=\i\.isPlatformEmbedded,isOverlay:.+?(?=}=\i,)/,
|
||||||
replace: "$&,isBetterFolders"
|
replace: "$&,isBetterFolders"
|
||||||
},
|
},
|
||||||
|
// Export the isBetterFolders and betterFoldersExpandedIds variable to the Guild List component
|
||||||
|
{
|
||||||
|
match: /,{guildDiscoveryButton:\i,/g,
|
||||||
|
replace: "$&isBetterFolders:arguments[0]?.isBetterFolders,betterFoldersExpandedIds:arguments[0]?.betterFoldersExpandedIds,"
|
||||||
|
},
|
||||||
|
// Export the isBetterFolders variable to the folders component
|
||||||
|
{
|
||||||
|
match: /switch\(\i\.type\){case \i\.\i\.FOLDER:.+?folderNode:\i,/,
|
||||||
|
replace: '$&isBetterFolders:typeof isBetterFolders!=="undefined"?isBetterFolders:false,'
|
||||||
|
},
|
||||||
// If we are rendering the Better Folders sidebar, we filter out guilds that are not in folders and unexpanded folders
|
// If we are rendering the Better Folders sidebar, we filter out guilds that are not in folders and unexpanded folders
|
||||||
{
|
{
|
||||||
match: /\[(\i)\]=(\(0,\i\.\i\).{0,40}getGuildsTree\(\).+?}\))(?=,)/,
|
match: /\[(\i)\]=(\(0,\i\.\i\).{0,40}getGuildsTree\(\).+?}\))(?=,)/,
|
||||||
replace: (_, originalTreeVar, rest) => `[betterFoldersOriginalTree]=${rest},${originalTreeVar}=$self.getGuildTree(!!arguments[0]?.isBetterFolders,betterFoldersOriginalTree,arguments[0]?.betterFoldersExpandedIds)`
|
replace: (_, originalTreeVar, rest) => `[betterFoldersOriginalTree]=${rest},${originalTreeVar}=$self.getGuildTree(!!arguments[0]?.isBetterFolders,betterFoldersOriginalTree,arguments[0]?.betterFoldersExpandedIds)`
|
||||||
},
|
},
|
||||||
// If we are rendering the Better Folders sidebar, we filter out everything but the servers and folders from the GuildsBar Guild List children
|
// If we are rendering the Better Folders sidebar, we filter out everything but the servers and folders from the Guild List children
|
||||||
{
|
{
|
||||||
match: /lastTargetNode:\i\[\i\.length-1\].+?}\)(?::null)?\](?=}\))/,
|
match: /lastTargetNode:\i\[\i\.length-1\].+?}\)(?::null)?\](?=}\))/,
|
||||||
replace: "$&.filter($self.makeGuildsBarGuildListFilter(!!arguments[0]?.isBetterFolders))"
|
replace: "$&.filter($self.makeGuildsBarGuildListFilter(!!arguments[0]?.isBetterFolders))"
|
||||||
},
|
},
|
||||||
// If we are rendering the Better Folders sidebar, we filter out everything but the scroller for the guild list from the GuildsBar Tree children
|
// If we are rendering the Better Folders sidebar, we filter out everything but the Guild List from the Sidebar children
|
||||||
{
|
{
|
||||||
match: /unreadMentionsIndicatorBottom,.+?}\)\]/,
|
match: /unreadMentionsFixedFooter\].+?\]/,
|
||||||
replace: "$&.filter($self.makeGuildsBarTreeFilter(!!arguments[0]?.isBetterFolders))"
|
replace: "$&.filter($self.makeGuildsBarSidebarFilter(!!arguments[0]?.isBetterFolders))"
|
||||||
},
|
|
||||||
// Export the isBetterFolders variable to the folders component
|
|
||||||
{
|
|
||||||
match: /switch\(\i\.type\){case \i\.\i\.FOLDER:.+?folderNode:\i,/,
|
|
||||||
replace: '$&isBetterFolders:typeof isBetterFolders!=="undefined"?isBetterFolders:false,'
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -161,7 +195,7 @@ export default definePlugin({
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: ".expandedFolderBackground,",
|
find: ".FOLDER_ITEM_ANIMATION_DURATION),",
|
||||||
predicate: () => settings.store.sidebar,
|
predicate: () => settings.store.sidebar,
|
||||||
replacement: [
|
replacement: [
|
||||||
// We use arguments[0] to access the isBetterFolders variable in this nested folder component (the parent exports all the props so we don't have to patch it)
|
// We use arguments[0] to access the isBetterFolders variable in this nested folder component (the parent exports all the props so we don't have to patch it)
|
||||||
|
@ -181,27 +215,20 @@ export default definePlugin({
|
||||||
// If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded
|
// If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded
|
||||||
{
|
{
|
||||||
predicate: () => !settings.store.keepIcons,
|
predicate: () => !settings.store.keepIcons,
|
||||||
match: /expandedFolderBackground,.+?,(?=\i\(\(\i,\i,\i\)=>{let{key.{0,45}ul)(?<=selected:\i,expanded:(\i),.+?)/,
|
match: /folderGroupBackground.+?,(?=\i\(\(\i,\i,\i\)=>{let{key:.{0,70}"ul")(?<=selected:\i,expanded:(\i),.+?)/,
|
||||||
replace: (m, isExpanded) => `${m}$self.shouldRenderContents(arguments[0],${isExpanded})?null:`
|
replace: (m, isExpanded) => `${m}$self.shouldRenderContents(arguments[0],${isExpanded})?null:`
|
||||||
},
|
},
|
||||||
|
// Decide if we should render the expanded folder background if we are rendering the Better Folders sidebar
|
||||||
{
|
{
|
||||||
// Decide if we should render the expanded folder background if we are rendering the Better Folders sidebar
|
|
||||||
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
|
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
|
||||||
match: /\.isExpanded\),.{0,30}children:\[/,
|
match: /\.isExpanded\].{0,110}children:\[/,
|
||||||
replace: "$&$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)&&"
|
replace: "$&$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)&&"
|
||||||
},
|
},
|
||||||
|
// Decide if we should render the expanded folder icon if we are rendering the Better Folders sidebar
|
||||||
{
|
{
|
||||||
// Decide if we should render the expanded folder icon if we are rendering the Better Folders sidebar
|
|
||||||
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
|
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
|
||||||
match: /(?<=\.expandedFolderBackground.+?}\),)(?=\i,)/,
|
match: /(?<=\.folderGroupBackground.*?}\),)(?=\i,)/,
|
||||||
replace: "!$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)?null:"
|
replace: "!$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)?null:"
|
||||||
},
|
|
||||||
{
|
|
||||||
// Discord adds a slight bottom margin of 4px when it's expanded
|
|
||||||
// Which looks off when there's nothing open in the folder
|
|
||||||
predicate: () => !settings.store.keepIcons,
|
|
||||||
match: /(?=className:.{0,50}folderIcon)/,
|
|
||||||
replace: "style:arguments[0]?.isBetterFolders?{}:{marginBottom:0},"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -278,6 +305,9 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
FolderSideBar,
|
||||||
|
closeFolders,
|
||||||
|
|
||||||
gridStyle: "vc-betterFolders-sidebar-grid",
|
gridStyle: "vc-betterFolders-sidebar-grid",
|
||||||
|
|
||||||
getGuildTree(isBetterFolders: boolean, originalTree: any, expandedFolderIds?: Set<any>) {
|
getGuildTree(isBetterFolders: boolean, originalTree: any, expandedFolderIds?: Set<any>) {
|
||||||
|
@ -299,34 +329,38 @@ export default definePlugin({
|
||||||
|
|
||||||
makeGuildsBarGuildListFilter(isBetterFolders: boolean) {
|
makeGuildsBarGuildListFilter(isBetterFolders: boolean) {
|
||||||
return child => {
|
return child => {
|
||||||
if (!isBetterFolders) return true;
|
if (!isBetterFolders) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return child?.props?.["aria-label"] === getIntlMessage("SERVERS");
|
return child?.props?.["aria-label"] === getIntlMessage("SERVERS");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
makeGuildsBarTreeFilter(isBetterFolders: boolean) {
|
makeGuildsBarSidebarFilter(isBetterFolders: boolean) {
|
||||||
return child => {
|
return child => {
|
||||||
if (!isBetterFolders) return true;
|
if (!isBetterFolders) {
|
||||||
|
|
||||||
if (child?.props?.className?.includes("itemsContainer") && child.props.children != null) {
|
|
||||||
// Filter out everything but the scroller for the guild list
|
|
||||||
child.props.children = child.props.children.filter(child => child?.props?.onScroll != null);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
try {
|
||||||
|
return filterTreeWithTargetNode(child, child => child?.props?.renderTreeNode != null);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
shouldShowFolderIconAndBackground(isBetterFolders: boolean, expandedFolderIds?: Set<any>) {
|
shouldShowFolderIconAndBackground(isBetterFolders: boolean, expandedFolderIds?: Set<any>) {
|
||||||
if (!isBetterFolders) return true;
|
if (!isBetterFolders) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
switch (settings.store.showFolderIcon) {
|
switch (settings.store.showFolderIcon) {
|
||||||
case FolderIconDisplay.Never:
|
case FolderIconDisplay.Never:
|
||||||
|
@ -352,8 +386,5 @@ export default definePlugin({
|
||||||
if (props?.folderNode?.id === 1) return false;
|
if (props?.folderNode?.id === 1) return false;
|
||||||
|
|
||||||
return !props?.isBetterFolders && isExpanded;
|
return !props?.isBetterFolders && isExpanded;
|
||||||
},
|
}
|
||||||
|
|
||||||
FolderSideBar,
|
|
||||||
closeFolders,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -31,6 +31,10 @@ import hideBugReport from "./hideBugReport.css?managed";
|
||||||
const KbdStyles = findByPropsLazy("key", "combo");
|
const KbdStyles = findByPropsLazy("key", "combo");
|
||||||
const BugReporterExperiment = findLazy(m => m?.definition?.id === "2024-09_bug_reporter");
|
const BugReporterExperiment = findLazy(m => m?.definition?.id === "2024-09_bug_reporter");
|
||||||
|
|
||||||
|
const isMacOS = navigator.platform.includes("Mac");
|
||||||
|
const modKey = isMacOS ? "cmd" : "ctrl";
|
||||||
|
const altKey = isMacOS ? "opt" : "alt";
|
||||||
|
|
||||||
const settings = definePluginSettings({
|
const settings = definePluginSettings({
|
||||||
toolbarDevMenu: {
|
toolbarDevMenu: {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
|
@ -48,7 +52,7 @@ export default definePlugin({
|
||||||
Devs.Ven,
|
Devs.Ven,
|
||||||
Devs.Nickyux,
|
Devs.Nickyux,
|
||||||
Devs.BanTheNons,
|
Devs.BanTheNons,
|
||||||
Devs.Nuckyz
|
Devs.Nuckyz,
|
||||||
],
|
],
|
||||||
|
|
||||||
settings,
|
settings,
|
||||||
|
@ -75,9 +79,9 @@ export default definePlugin({
|
||||||
replace: "$&$self.WarningCard(),"
|
replace: "$&$self.WarningCard(),"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// change top right chat toolbar button from the help one to the dev one
|
// Change top right chat toolbar button from the help one to the dev one
|
||||||
{
|
{
|
||||||
find: "toolbar:function",
|
find: ".CONTEXTLESS,isActivityPanelMode:",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /hasBugReporterAccess:(\i)/,
|
match: /hasBugReporterAccess:(\i)/,
|
||||||
replace: "_hasBugReporterAccess:$1=true"
|
replace: "_hasBugReporterAccess:$1=true"
|
||||||
|
@ -85,7 +89,7 @@ export default definePlugin({
|
||||||
predicate: () => settings.store.toolbarDevMenu
|
predicate: () => settings.store.toolbarDevMenu
|
||||||
},
|
},
|
||||||
|
|
||||||
// makes the Favourites Server experiment allow favouriting DMs and threads
|
// Make the Favourites Server experiment allow favouriting DMs and threads
|
||||||
{
|
{
|
||||||
find: "useCanFavoriteChannel",
|
find: "useCanFavoriteChannel",
|
||||||
replacement: {
|
replacement: {
|
||||||
|
@ -93,23 +97,36 @@ export default definePlugin({
|
||||||
replace: "false",
|
replace: "false",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// enable option to always record clips even if you are not streaming
|
// Enable option to always record clips even if you are not streaming
|
||||||
{
|
{
|
||||||
find: "isDecoupledGameClippingEnabled(){",
|
find: "isDecoupledGameClippingEnabled(){",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i\.isStaff\(\)/,
|
match: /\i\.isStaff\(\)/,
|
||||||
replace: "true"
|
replace: "true"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// Enable experiment embed on sent experiment links
|
||||||
|
{
|
||||||
|
find: "dev://experiment/",
|
||||||
|
replacement: [
|
||||||
|
{
|
||||||
|
match: /\i\.isStaff\(\)/,
|
||||||
|
replace: "true"
|
||||||
|
},
|
||||||
|
// Fix some tricky experiments name causing a client crash
|
||||||
|
{
|
||||||
|
match: /.getRegisteredExperiments\(\)(?<=(\i)=.+?).+?if\(null==(\i)(?=\)return null;)/,
|
||||||
|
replace: "$&||!Object.hasOwn($1,$2)"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
start: () => !BugReporterExperiment.getCurrentConfig().hasBugReporterAccess && enableStyle(hideBugReport),
|
start: () => !BugReporterExperiment.getCurrentConfig().hasBugReporterAccess && enableStyle(hideBugReport),
|
||||||
stop: () => disableStyle(hideBugReport),
|
stop: () => disableStyle(hideBugReport),
|
||||||
|
|
||||||
settingsAboutComponent: () => {
|
settingsAboutComponent: () => {
|
||||||
const isMacOS = navigator.platform.includes("Mac");
|
|
||||||
const modKey = isMacOS ? "cmd" : "ctrl";
|
|
||||||
const altKey = isMacOS ? "opt" : "alt";
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Forms.FormTitle tag="h3">More Information</Forms.FormTitle>
|
<Forms.FormTitle tag="h3">More Information</Forms.FormTitle>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { FluxDispatcher, useLayoutEffect, useRef, useState } from "@webpack/common";
|
import { FluxDispatcher, useLayoutEffect, useMemo, useRef, useState } from "@webpack/common";
|
||||||
|
|
||||||
import { ELEMENT_ID } from "../constants";
|
import { ELEMENT_ID } from "../constants";
|
||||||
import { settings } from "../index";
|
import { settings } from "../index";
|
||||||
|
@ -160,6 +160,16 @@ export const Magnifier = ErrorBoundary.wrap<MagnifierProps>(({ instance, size: i
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const imageSrc = useMemo(() => {
|
||||||
|
try {
|
||||||
|
const imageUrl = new URL(instance.props.src);
|
||||||
|
imageUrl.searchParams.set("animated", "true");
|
||||||
|
return imageUrl.toString();
|
||||||
|
} catch {
|
||||||
|
return instance.props.src;
|
||||||
|
}
|
||||||
|
}, [instance.props.src]);
|
||||||
|
|
||||||
if (!ready) return null;
|
if (!ready) return null;
|
||||||
|
|
||||||
const box = element.current?.getBoundingClientRect();
|
const box = element.current?.getBoundingClientRect();
|
||||||
|
@ -203,7 +213,7 @@ export const Magnifier = ErrorBoundary.wrap<MagnifierProps>(({ instance, size: i
|
||||||
}}
|
}}
|
||||||
width={`${box.width * zoom.current}px`}
|
width={`${box.width * zoom.current}px`}
|
||||||
height={`${box.height * zoom.current}px`}
|
height={`${box.height * zoom.current}px`}
|
||||||
src={instance.props.src}
|
src={imageSrc}
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -32,8 +32,8 @@ const SelectedChannelActionCreators = findByPropsLazy("selectPrivateChannel");
|
||||||
const UserUtils = findByPropsLazy("getGlobalName");
|
const UserUtils = findByPropsLazy("getGlobalName");
|
||||||
|
|
||||||
const ProfileListClasses = findByPropsLazy("emptyIconFriends", "emptyIconGuilds");
|
const ProfileListClasses = findByPropsLazy("emptyIconFriends", "emptyIconGuilds");
|
||||||
|
const MutualsListClasses = findByPropsLazy("row", "icon", "name", "nick");
|
||||||
const ExpandableList = findComponentByCodeLazy('"PRESS_SECTION"', ".header");
|
const ExpandableList = findComponentByCodeLazy('"PRESS_SECTION"', ".header");
|
||||||
const GuildLabelClasses = findByPropsLazy("guildNick", "guildAvatarWithoutIcon");
|
|
||||||
|
|
||||||
function getGroupDMName(channel: Channel) {
|
function getGroupDMName(channel: Channel) {
|
||||||
return channel.name ||
|
return channel.name ||
|
||||||
|
@ -59,7 +59,7 @@ function renderClickableGDMs(mutualDms: Channel[], onClose: () => void) {
|
||||||
return mutualDms.map(c => (
|
return mutualDms.map(c => (
|
||||||
<Clickable
|
<Clickable
|
||||||
key={c.id}
|
key={c.id}
|
||||||
className={ProfileListClasses.listRow}
|
className={MutualsListClasses.row}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onClose();
|
onClose();
|
||||||
SelectedChannelActionCreators.selectPrivateChannel(c.id);
|
SelectedChannelActionCreators.selectPrivateChannel(c.id);
|
||||||
|
@ -68,12 +68,12 @@ function renderClickableGDMs(mutualDms: Channel[], onClose: () => void) {
|
||||||
<Avatar
|
<Avatar
|
||||||
src={IconUtils.getChannelIconURL({ id: c.id, icon: c.icon, size: 32 })}
|
src={IconUtils.getChannelIconURL({ id: c.id, icon: c.icon, size: 32 })}
|
||||||
size="SIZE_40"
|
size="SIZE_40"
|
||||||
className={ProfileListClasses.listAvatar}
|
className={MutualsListClasses.icon}
|
||||||
>
|
>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
<div className={ProfileListClasses.listRowContent}>
|
<div className={MutualsListClasses.details}>
|
||||||
<div className={ProfileListClasses.listName}>{getGroupDMName(c)}</div>
|
<div className={MutualsListClasses.name}>{getGroupDMName(c)}</div>
|
||||||
<div className={GuildLabelClasses.guildNick}>{c.recipients.length + 1} Members</div>
|
<div className={MutualsListClasses.nick}>{c.recipients.length + 1} Members</div>
|
||||||
</div>
|
</div>
|
||||||
</Clickable>
|
</Clickable>
|
||||||
));
|
));
|
||||||
|
@ -88,7 +88,7 @@ export default definePlugin({
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".MUTUAL_FRIENDS?(",
|
find: ".BOT_DATA_ACCESS?(",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /\i\.useEffect.{0,100}(\i)\[0\]\.section/,
|
match: /\i\.useEffect.{0,100}(\i)\[0\]\.section/,
|
||||||
|
|
|
@ -16,28 +16,27 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import "./style.css";
|
||||||
|
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "PlainFolderIcon",
|
name: "PlainFolderIcon",
|
||||||
description: "Doesn't show the small guild icons in folders",
|
description: "Dont show the small guild icons in folders",
|
||||||
authors: [Devs.botato],
|
authors: [Devs.botato],
|
||||||
patches: [{
|
|
||||||
find: ".expandedFolderIconWrapper",
|
patches: [
|
||||||
replacement: [
|
{
|
||||||
// there are two elements, the first one is the plain folder icon
|
find: ".folderPreviewGuildIconError",
|
||||||
// the second is the four guild preview icons
|
replacement: [
|
||||||
// always show this one (the plain icons)
|
{
|
||||||
{
|
// Discord always renders both plain and guild icons folders and uses a css transtion to switch between them
|
||||||
match: /\(\i\|\|\i\)&&(\(.{0,40}\(\i\.animated)/,
|
match: /(?<=.folderButtonContent]:(!\i))/,
|
||||||
replace: "$1",
|
replace: (_, hasFolderButtonContentClass) => `,"vc-plainFolderIcon-plain":${hasFolderButtonContentClass}`
|
||||||
},
|
}
|
||||||
// and never show this one (the guild preview icons)
|
|
||||||
{
|
]
|
||||||
match: /\(\i\|\|!\i\)&&(\(.{0,40}\(\i\.animated)/,
|
}
|
||||||
replace: "false&&$1",
|
]
|
||||||
}
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
});
|
});
|
||||||
|
|
10
src/plugins/plainFolderIcon/style.css
Normal file
10
src/plugins/plainFolderIcon/style.css
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
.vc-plainFolderIcon-plain {
|
||||||
|
/* Without this, they are a bit laggier */
|
||||||
|
transition: none !important;
|
||||||
|
|
||||||
|
/* Don't show the mini guild icons */
|
||||||
|
transform: translateZ(0);
|
||||||
|
|
||||||
|
/* The new icons are fully transparent. Add a sane default to match the old behavior */
|
||||||
|
background-color: color-mix(in oklab, var(--custom-folder-color, var(--bg-brand)) 40%, transparent);
|
||||||
|
}
|
|
@ -77,23 +77,23 @@ export default definePlugin({
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".BITE_SIZE,user:",
|
find: ".POPOUT,user:",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /{profileType:\i\.\i\.BITE_SIZE,children:\[/,
|
match: /children:\[(?=[^[]+?shouldShowTooltip:)/,
|
||||||
replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user}),"
|
replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user}),"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: ".FULL_SIZE,user:",
|
find: ".MODAL,user:",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /{profileType:\i\.\i\.FULL_SIZE,children:\[/,
|
match: /children:\[(?=[^[]+?shouldShowTooltip:)/,
|
||||||
replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user}),"
|
replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user}),"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: 'location:"UserProfilePanel"',
|
find: ".SIDEBAR,shouldShowTooltip:",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /{profileType:\i\.\i\.PANEL,children:\[/,
|
match: /children:\[(?=[^[]+?shouldShowTooltip:)/,
|
||||||
replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user}),"
|
replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user}),"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,7 +325,7 @@ export default definePlugin({
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: '})},"overflow"))',
|
find: '="interactive-normal",overflowCountClassName:',
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
// Create a variable for the channel prop
|
// Create a variable for the channel prop
|
||||||
|
@ -334,18 +334,21 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Make Discord always render the plus button if the component is used inside the HiddenChannelLockScreen
|
// Make Discord always render the plus button if the component is used inside the HiddenChannelLockScreen
|
||||||
match: /\i>0(?=&&.{0,60}renderPopout)/,
|
match: /\i>0(?=&&.{0,30}Math.min)/,
|
||||||
replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})`
|
replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Prevent Discord from overwriting the last children with the plus button if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen
|
// Prevent Discord from overwriting the last children with the plus button
|
||||||
match: /(?<=\.value\(\),(\i)=.+?length-)1(?=\]=.{0,60}renderPopout)/,
|
// if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen
|
||||||
|
match: /(?<=\i\.length-)1(?=\]=.{0,60}renderPopout)(?<=(\i)=\i\.length-\i.+?)/,
|
||||||
replace: (_, amount) => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&${amount}<=0?0:1)`
|
replace: (_, amount) => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&${amount}<=0?0:1)`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Show only the plus text without overflowed children amount if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen
|
// Show only the plus text without overflowed children amount
|
||||||
match: /(?<="\+",)(\i)\+1/,
|
// if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen
|
||||||
replace: (m, amount) => `$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&${amount}<=0?"":${m}`
|
match: /(?<="\+"\.concat\()\i/,
|
||||||
|
replace: overflowTextAmount => "" +
|
||||||
|
`$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&(${overflowTextAmount}-1)<=0?"":${overflowTextAmount}`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue