mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +00:00
Add an option to enable colors in the member list
This commit is contained in:
parent
1d2da7c15b
commit
9bf77cf1db
2 changed files with 28 additions and 2 deletions
9
src/plugins/fixCodeblockGap/README.md
Normal file
9
src/plugins/fixCodeblockGap/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# FixCodeblockGap
|
||||
|
||||
Removes the gap between codeblocks and text below it
|
||||
|
||||
![Message with a codeblock on vanilla Discord]()
|
||||
![Message with a codeblock with FixCodeblockGap]()
|
||||
|
||||
Fixes an annoying Discord bug causing codeblocks to always have a gap between
|
||||
them and the following text.
|
|
@ -53,6 +53,12 @@ const settings = definePluginSettings({
|
|||
type: OptionType.NUMBER,
|
||||
default: 70,
|
||||
},
|
||||
memberListColors: {
|
||||
description: "Replace role colors in the member list",
|
||||
restartNeeded: true,
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
export default definePlugin({
|
||||
|
@ -64,12 +70,23 @@ export default definePlugin({
|
|||
find: "=\"SYSTEM_TAG\"",
|
||||
replacement: {
|
||||
match: /(?<=className:\i\.username,style:.{0,50}:void 0,)/,
|
||||
replace: "style:{color:$self.calculateNameColorForContext(arguments[0])},"
|
||||
replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])},",
|
||||
},
|
||||
},
|
||||
{
|
||||
find: ".NameWithRole,{roleName:",
|
||||
replacement: {
|
||||
match: /(?<=color:)null!=.{0,50}?(?=,)/,
|
||||
replace: "$self.calculateNameColorForListContext(arguments[0])",
|
||||
},
|
||||
predicate: () => settings.store.memberListColors,
|
||||
},
|
||||
],
|
||||
settings,
|
||||
calculateNameColorForContext(context: any) {
|
||||
calculateNameColorForMessageContext(context: any) {
|
||||
return calculateNameColorForUser(BigInt(context.message.author.id));
|
||||
},
|
||||
calculateNameColorForListContext(context: any) {
|
||||
return calculateNameColorForUser(BigInt(context.user.id));
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue