RoleColorEverywhere: show role colors in the reactor list (#2490)

Co-authored-by: vee <vendicated@riseup.net>
This commit is contained in:
programminglaboratorys 2024-06-08 21:56:23 +03:00 committed by GitHub
parent caf1779be3
commit fe390bf063
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,9 +40,16 @@ const settings = definePluginSettings({
default: true, default: true,
description: "Show role colors in the voice chat user list", description: "Show role colors in the voice chat user list",
restartNeeded: true restartNeeded: true
},
reactorsList: {
type: OptionType.BOOLEAN,
default: true,
description: "Show role colors in the reactors list",
restartNeeded: true
} }
}); });
export default definePlugin({ export default definePlugin({
name: "RoleColorEverywhere", name: "RoleColorEverywhere",
authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN], authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN],
@ -99,6 +106,14 @@ export default definePlugin({
} }
], ],
predicate: () => settings.store.voiceUsers, predicate: () => settings.store.voiceUsers,
},
{
find: ".reactorDefault",
replacement: {
match: /\.openUserContextMenu\)\((\i),(\i),\i\).{0,250}tag:"strong"/,
replace: "$&,style:{color:$self.getColor($2?.id,$1)}"
},
predicate: () => settings.store.reactorsList,
} }
], ],
settings, settings,