ShowMeYourName: UserPopouts Setting

This commit is contained in:
thororen1234 2025-07-04 08:54:14 -04:00
parent 4e8eef6b6c
commit 76e65eee69
No known key found for this signature in database

View file

@ -48,6 +48,11 @@ const settings = definePluginSettings({
default: false,
description: "Use friend names in place of usernames (overrides Display Names option if applicable)"
},
showGradient: {
type: OptionType.BOOLEAN,
default: false,
description: "Whether to show gradient for suffix",
},
memberList: {
type: OptionType.BOOLEAN,
default: false,
@ -66,10 +71,11 @@ const settings = definePluginSettings({
description: "Show usernames in emoji reactions",
restartNeeded: true
},
showGradient: {
userProfilePopout: {
type: OptionType.BOOLEAN,
default: false,
description: "Whether to show gradient for suffix",
description: "Show usernames in user profile popout",
restartNeeded: true
},
});
@ -95,6 +101,16 @@ export default definePlugin({
replace: "$self.renderUsername(arguments[0])"
}
},
{
find: "#{intl::REACTION_TOOLTIP_1}",
predicate: () => settings.store.emojiReactions,
replacement: [
{
match: /\i\.\i\.getName\((\i),null==.{0,15},(\i)\)/,
replace: "$self.getUsername($2,$1)"
},
]
},
{
find: "._areActivitiesExperimentallyHidden=(",
predicate: () => settings.store.memberList,
@ -108,21 +124,27 @@ export default definePlugin({
predicate: () => settings.store.voiceChannelList,
replacement: [
{
match: /(?<=children:\[)null!=\i\?\i:\i\.\i\.getName\((\i)\)(?=.*?contextGuildId:(\i))/,
match: /null!=\i\?\i:\i\.\i\.getName\((\i)\)(?=.*?contextGuildId:(\i))/,
replace: "$self.getUsername($1,$2)"
},
]
},
{
find: "#{intl::REACTION_TOOLTIP_1}",
predicate: () => settings.store.emojiReactions,
replacement: [
{
match: /\i\.\i\.getName\((\i),null==.{0,15},(\i)\)/g,
replace: "$self.getUsername($2,$1)"
},
]
find: ".hasAvatarForGuild(null==",
predicate: () => settings.store.userProfilePopout,
replacement: {
match: /(?<=user:(\i).{0,15}\}\),nickname:)\i(?=.*?guildId:(null==\i\?void 0:\i\.id))/,
replace: "$self.getUsername($1,$2)"
}
},
{
find: "friendRequestBanner})",
predicate: () => settings.store.userProfilePopout,
replacement: {
match: /(?<=user:(\i).{0,15}guildId:(\i).*?nickname:)\i/,
replace: "$self.getUsername($1,$2)"
}
}
],
settings,
getUsername,