ShowMeYourName: ShowGradient Setting

This commit is contained in:
thororen1234 2025-06-17 15:52:19 -04:00
parent 9e588eeb77
commit 24787d33ce
No known key found for this signature in database
2 changed files with 15 additions and 3 deletions

View file

@ -66,6 +66,11 @@ const settings = definePluginSettings({
description: "Show usernames in emoji reactions", description: "Show usernames in emoji reactions",
restartNeeded: true restartNeeded: true
}, },
showGradient: {
type: OptionType.BOOLEAN,
default: true,
description: "Whether to show gradient for suffix",
},
}); });
function getUsername(user: any, guildId: string): string { function getUsername(user: any, guildId: string): string {
@ -81,7 +86,7 @@ function getUsername(user: any, guildId: string): string {
export default definePlugin({ export default definePlugin({
name: "ShowMeYourName", name: "ShowMeYourName",
description: "Display usernames next to nicks, or no nicks at all", description: "Display usernames next to nicks, or no nicks at all",
authors: [Devs.Rini, Devs.TheKodeToad], authors: [Devs.Rini, Devs.TheKodeToad, Devs.nyx],
patches: [ patches: [
{ {
find: '"BaseUsername"', find: '"BaseUsername"',
@ -130,14 +135,16 @@ export default definePlugin({
const { nick } = author; const { nick } = author;
const prefix = withMentionPrefix ? "@" : ""; const prefix = withMentionPrefix ? "@" : "";
const classes = settings.store.showGradient ? "vc-smyn-suffix" : "vc-smyn-suffix vc-smyn-hide-gradient";
if (isRepliedMessage && !settings.store.inReplies || username.toLowerCase() === nick.toLowerCase()) if (isRepliedMessage && !settings.store.inReplies || username.toLowerCase() === nick.toLowerCase())
return <>{prefix}{nick}</>; return <>{prefix}{nick}</>;
if (settings.store.mode === "user-nick") if (settings.store.mode === "user-nick")
return <>{prefix}{username} <span className="vc-smyn-suffix">{nick}</span></>; return <>{prefix}{username} <span className={classes}>{nick}</span></>;
if (settings.store.mode === "nick-user") if (settings.store.mode === "nick-user")
return <>{prefix}{nick} <span className="vc-smyn-suffix">{username}</span></>; return <>{prefix}{nick} <span className={classes}>{username}</span></>;
return <>{prefix}{username}</>; return <>{prefix}{username}</>;
} catch { } catch {

View file

@ -9,3 +9,8 @@
.vc-smyn-suffix::after { .vc-smyn-suffix::after {
content: ")"; content: ")";
} }
.vc-smyn-hide-gradient {
-webkit-text-fill-color: initial;
isolation: isolate;
}