feat(declutter): obliterate profile frames (#1274)
* feat(declutter): obliterate profile frames * fix(declutter): apply murphy's patch ;)
This commit is contained in:
parent
3643d6e09b
commit
2f528a296f
1 changed files with 63 additions and 36 deletions
|
|
@ -18,7 +18,11 @@ import definePlugin, { OptionType } from "@utils/types";
|
|||
import { Alerts } from "@webpack/common";
|
||||
|
||||
migratePluginSetting("Declutter", "removeShopAboveDms", "removeShopAboveDM");
|
||||
migratePluginSetting("Declutter", "removeQuestsAboveDms", "removeQuestsAboveDM");
|
||||
migratePluginSetting(
|
||||
"Declutter",
|
||||
"removeQuestsAboveDms",
|
||||
"removeQuestsAboveDM",
|
||||
);
|
||||
|
||||
const cl = classNameFactory("vc-declutter-");
|
||||
|
||||
|
|
@ -46,6 +50,12 @@ export const settings = definePluginSettings({
|
|||
default: true,
|
||||
restartNeeded: true,
|
||||
},
|
||||
removeProfileFrame: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Remove profile frames.",
|
||||
default: true,
|
||||
restartNeeded: true,
|
||||
},
|
||||
removeClanTag: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Remove clan tags.",
|
||||
|
|
@ -56,15 +66,16 @@ export const settings = definePluginSettings({
|
|||
type: OptionType.BOOLEAN,
|
||||
description: "Always show username instead of status.",
|
||||
default: true,
|
||||
restartNeeded: true
|
||||
restartNeeded: true,
|
||||
},
|
||||
accessibilityNotice: {
|
||||
type: OptionType.COMPONENT,
|
||||
component: () => (
|
||||
<Notice.Info className={cl("accessibility-notice")}>
|
||||
Discord already has a built-in username style option in Accessibility settings.
|
||||
Discord already has a built-in username style option in
|
||||
Accessibility settings.
|
||||
</Notice.Info>
|
||||
)
|
||||
),
|
||||
},
|
||||
friendsListHeader: {
|
||||
type: OptionType.COMPONENT,
|
||||
|
|
@ -126,13 +137,13 @@ export const settings = definePluginSettings({
|
|||
type: OptionType.BOOLEAN,
|
||||
description: "Remove menus next to mute and deafen buttons.",
|
||||
default: true,
|
||||
restartNeeded: true
|
||||
restartNeeded: true,
|
||||
},
|
||||
removeButtonTooltips: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Remove button tooltips.",
|
||||
default: false,
|
||||
restartNeeded: true
|
||||
restartNeeded: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -149,7 +160,8 @@ function SectionSeparator(title: string) {
|
|||
|
||||
export default definePlugin({
|
||||
name: "Declutter",
|
||||
description: "Cleans up Discord by removing non-essential UI elements like profile effects, shop tabs, boosts, and more.",
|
||||
description:
|
||||
"Cleans up Discord by removing non-essential UI elements like profile effects, shop tabs, boosts, and more.",
|
||||
tags: ["Appearance", "Customisation"],
|
||||
authors: [EquicordDevs.Leon135, Devs.prism, Devs.Kyuuhachi, Devs.SomeAspy],
|
||||
start() {
|
||||
|
|
@ -159,29 +171,41 @@ export default definePlugin({
|
|||
title: "Declutter",
|
||||
body: "Avatar decoration removal has been disabled to prevent conflicts with Decor plugin.",
|
||||
confirmText: "OK",
|
||||
confirmVariant: "critical-primary"
|
||||
confirmVariant: "critical-primary",
|
||||
});
|
||||
}
|
||||
},
|
||||
settings,
|
||||
patches: [
|
||||
{
|
||||
// Profile frame
|
||||
find: "skuId,layers:null!=",
|
||||
replacement: {
|
||||
match: /(?=0!==\i.length&&\i\?\(0,)/,
|
||||
replace: "null&&",
|
||||
},
|
||||
},
|
||||
{
|
||||
// Avatar decoration
|
||||
find: "isAvatarDecorationAnimating:",
|
||||
replacement: {
|
||||
match: /(?<=\{avatarDecoration:.{0,40}?)(void 0!==\i\?\i:)\i(?=\)?,canAnimate:)/,
|
||||
replace: "$1null"
|
||||
replace: "$1null",
|
||||
},
|
||||
predicate: () => settings.store.removeAvatarDecoration && !isPluginEnabled(decor.name),
|
||||
predicate: () =>
|
||||
settings.store.removeAvatarDecoration &&
|
||||
!isPluginEnabled(decor.name),
|
||||
},
|
||||
{
|
||||
// Avatar decoration on dms list
|
||||
find: "showCommunicationDisabledStyles",
|
||||
replacement: {
|
||||
match: /null==\i\|\|\i\?null:\(0,\i\.jsxs?\)\("img",\{className:\i\.\i,src:\i,alt:" ","aria-hidden":!0\}\)/,
|
||||
replace: "null"
|
||||
replace: "null",
|
||||
},
|
||||
predicate: () => settings.store.removeAvatarDecoration && !isPluginEnabled(decor.name),
|
||||
predicate: () =>
|
||||
settings.store.removeAvatarDecoration &&
|
||||
!isPluginEnabled(decor.name),
|
||||
},
|
||||
// User Area
|
||||
{
|
||||
|
|
@ -190,7 +214,9 @@ export default definePlugin({
|
|||
{
|
||||
match: /((\i)=\i\?\.avatarDecoration,\i=)\(0,\i\.\i\)\(\2\)/,
|
||||
replace: "$1null",
|
||||
predicate: () => settings.store.removeAvatarDecoration && !isPluginEnabled(decor.name),
|
||||
predicate: () =>
|
||||
settings.store.removeAvatarDecoration &&
|
||||
!isPluginEnabled(decor.name),
|
||||
},
|
||||
{
|
||||
match: /(iconForeground:null!=\i\?\i\.\i:void 0,nameplate:)\i/g,
|
||||
|
|
@ -201,7 +227,7 @@ export default definePlugin({
|
|||
match: /let\{ref:\i,speaking:\i,voiceDb:/,
|
||||
replace: "arguments[0].nameplate=null;$&",
|
||||
predicate: () => settings.store.removeNameplate,
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -209,7 +235,8 @@ export default definePlugin({
|
|||
find: ".MINI_PREVIEW,[",
|
||||
replacement: {
|
||||
match: /function \i\((\i)\)\{(?=let.{1,5}\{nameplate:\i,)/,
|
||||
replace: '$&if($1.placement!=="preview"&&$1.placement!=="mini_preview")return null;'
|
||||
replace:
|
||||
'$&if($1.placement!=="preview"&&$1.placement!=="mini_preview")return null;',
|
||||
},
|
||||
predicate: () => settings.store.removeNameplate,
|
||||
},
|
||||
|
|
@ -218,7 +245,7 @@ export default definePlugin({
|
|||
find: "bannerAdjustment,isHovering",
|
||||
replacement: {
|
||||
match: /\i=function\((\i)\)\{(?=.{0,50}\.useReducedMotion\))/,
|
||||
replace: "$&if(!$1.shopPreview)return null;"
|
||||
replace: "$&if(!$1.shopPreview)return null;",
|
||||
},
|
||||
predicate: () => settings.store.removeProfileEffect,
|
||||
},
|
||||
|
|
@ -227,7 +254,7 @@ export default definePlugin({
|
|||
find: ".GuildFeatures.GUILD_TAGS)",
|
||||
replacement: {
|
||||
match: /(?<=\.profile\?\.badge.{0,50}\i\)\{)/,
|
||||
replace: "return false;"
|
||||
replace: "return false;",
|
||||
},
|
||||
predicate: () => settings.store.removeClanTag,
|
||||
},
|
||||
|
|
@ -236,9 +263,9 @@ export default definePlugin({
|
|||
find: "#{intl::USER_PROFILE_ACCOUNT_POPOUT_BUTTON_A11Y_LABEL}",
|
||||
replacement: {
|
||||
match: /hoverText:(\i),forceHover:\i,children:/g,
|
||||
replace: "hoverText:$1,forceHover:!0,children:"
|
||||
replace: "hoverText:$1,forceHover:!0,children:",
|
||||
},
|
||||
predicate: () => settings.store.alwaysShowUsername
|
||||
predicate: () => settings.store.alwaysShowUsername,
|
||||
},
|
||||
{
|
||||
// Button tooltips in user area
|
||||
|
|
@ -248,19 +275,19 @@ export default definePlugin({
|
|||
// Button tooltips
|
||||
match: /:\{tooltipText:\i\};/,
|
||||
replace: ":{tooltipText:void 0};",
|
||||
predicate: () => settings.store.removeButtonTooltips
|
||||
predicate: () => settings.store.removeButtonTooltips,
|
||||
},
|
||||
{
|
||||
// Audio menus
|
||||
match: /(?<=#{intl::MUTE}\),)className:\i\.\i,/,
|
||||
replace: "",
|
||||
predicate: () => settings.store.removeAudioMenus
|
||||
predicate: () => settings.store.removeAudioMenus,
|
||||
},
|
||||
{
|
||||
// Audio menus
|
||||
match: /,\(0,\i\.jsxs?\)\(\i\.\i,\{.{0,600}#{intl::ACCOUNT_INPUT_OPTIONS}\)\}\)(?=\])/,
|
||||
replace: "",
|
||||
predicate: () => settings.store.removeAudioMenus
|
||||
predicate: () => settings.store.removeAudioMenus,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -272,20 +299,20 @@ export default definePlugin({
|
|||
// Button tooltips
|
||||
match: /(?<=role:"switch",)tooltipText:\i\}/,
|
||||
replace: "tooltipText:void 0}",
|
||||
predicate: () => settings.store.removeButtonTooltips
|
||||
predicate: () => settings.store.removeButtonTooltips,
|
||||
},
|
||||
{
|
||||
// Audio menus
|
||||
match: /(?<=#{intl::DEAFEN}\),)className:\i\.\i,/,
|
||||
replace: "",
|
||||
predicate: () => settings.store.removeAudioMenus
|
||||
predicate: () => settings.store.removeAudioMenus,
|
||||
},
|
||||
{
|
||||
// Audio menus
|
||||
match: /,\(0,\i\.jsxs?\)\(\i\.\i,\{.{0,650}#{intl::ACCOUNT_OUTPUT_OPTIONS}\)\}\)(?=\])/,
|
||||
replace: "",
|
||||
predicate: () => settings.store.removeAudioMenus
|
||||
}
|
||||
predicate: () => settings.store.removeAudioMenus,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -293,9 +320,9 @@ export default definePlugin({
|
|||
find: "#{intl::USER_SETTINGS_WITH_BUILD_OVERRIDE}",
|
||||
replacement: {
|
||||
match: /tooltipText:\i,tooltipPositionKey/,
|
||||
replace: "tooltipText:void 0,tooltipPositionKey"
|
||||
replace: "tooltipText:void 0,tooltipPositionKey",
|
||||
},
|
||||
predicate: () => settings.store.removeButtonTooltips
|
||||
predicate: () => settings.store.removeButtonTooltips,
|
||||
},
|
||||
{
|
||||
// Above DMs section
|
||||
|
|
@ -309,22 +336,22 @@ export default definePlugin({
|
|||
{
|
||||
match: /NAVIGATION_LINK\}\}\},"discord-shop"\)/,
|
||||
replace: "$&&&undefined",
|
||||
predicate: () => settings.store.removeShopAboveDms
|
||||
predicate: () => settings.store.removeShopAboveDms,
|
||||
},
|
||||
{
|
||||
match: /\.QUEST_HOME\},"quests"\)/,
|
||||
replace: "$&&&undefined",
|
||||
predicate: () => settings.store.removeQuestsAboveDms
|
||||
predicate: () => settings.store.removeQuestsAboveDms,
|
||||
},
|
||||
{
|
||||
match: /\.APPLICATION_LIBRARY\},"library"\)/,
|
||||
replace: "$&&&undefined",
|
||||
predicate: () => settings.store.removeLibraryAboveDms
|
||||
predicate: () => settings.store.removeLibraryAboveDms,
|
||||
},
|
||||
{
|
||||
match: /\.FAMILY_CENTER\)\},"family-center"\)/,
|
||||
replace: "$&&&undefined",
|
||||
predicate: () => settings.store.removeFamilyCenterAboveDms
|
||||
predicate: () => settings.store.removeFamilyCenterAboveDms,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -348,7 +375,7 @@ export default definePlugin({
|
|||
find: "useGuildActionRow",
|
||||
replacement: {
|
||||
match: /(GUILD_NEW_MEMBER_ACTIONS_PROGRESS_BAR\)):\i(?:\.premiumProgressBarEnabled)?/,
|
||||
replace: "$1:null"
|
||||
replace: "$1:null",
|
||||
},
|
||||
predicate: () => settings.store.removeServerBoostInfo,
|
||||
},
|
||||
|
|
@ -375,7 +402,7 @@ export default definePlugin({
|
|||
find: "#{intl::EMOJI_PICKER_EXPAND_EMOJI_SECTION}),size:",
|
||||
replacement: {
|
||||
match: /(\i)=\i\|\|!\i&&\i.\i.isEmojiCategoryNitroLocked\(\{[^}]*\}\);/,
|
||||
replace: "$&$1||"
|
||||
replace: "$&$1||",
|
||||
},
|
||||
predicate: () => settings.store.removeUnavailableEmojiPicker,
|
||||
},
|
||||
|
|
@ -384,9 +411,9 @@ export default definePlugin({
|
|||
find: "#{intl::EMOJI_CATEGORY_TOP_GUILD_EMOJI},{guildName:",
|
||||
replacement: {
|
||||
match: /(?<=(\i)\.unshift\((\i)\):)(?=\1\.push\(\2\))/,
|
||||
replace: "$2.isNitroLocked||"
|
||||
replace: "$2.isNitroLocked||",
|
||||
},
|
||||
predicate: () => settings.store.removeUnavailableEmojiPicker,
|
||||
}
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue