TypingTweaks: Fix plugin
This commit is contained in:
parent
8d65bcf743
commit
9d3c91e9df
1 changed files with 21 additions and 24 deletions
|
@ -91,34 +91,31 @@ export default definePlugin({
|
||||||
name: "TypingTweaks",
|
name: "TypingTweaks",
|
||||||
description: "Show avatars and role colours in the typing indicator",
|
description: "Show avatars and role colours in the typing indicator",
|
||||||
authors: [Devs.zt],
|
authors: [Devs.zt],
|
||||||
|
settings,
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
// Style the indicator and add function call to modify the children before rendering
|
|
||||||
{
|
{
|
||||||
find: "getCooldownTextStyle",
|
find: "#{intl::THREE_USERS_TYPING}",
|
||||||
replacement: {
|
replacement: [
|
||||||
match: /(?<=children:\[(\i)\.length>0.{0,200}?"aria-atomic":!0,children:)\i/,
|
{
|
||||||
replace: "$self.mutateChildren(this.props, $1, $&), style: $self.TYPING_TEXT_STYLE"
|
// Style the indicator and add function call to modify the children before rendering
|
||||||
}
|
match: /(?<=children:\[(\i)\.length>0.{0,200}?"aria-atomic":!0,children:)\i(?<=guildId:(\i).+?)/,
|
||||||
},
|
replace: "$self.mutateChildren($2,$1,$&),style:$self.TYPING_TEXT_STYLE"
|
||||||
// Changes the indicator to keep the user object when creating the list of typing users
|
},
|
||||||
{
|
{
|
||||||
find: "getCooldownTextStyle",
|
// Changes the indicator to keep the user object when creating the list of typing users
|
||||||
replacement: {
|
match: /\.map\((\i)=>\i\.\i\.getName\(\i,\i\.id,\1\)\)/,
|
||||||
match: /(?<=map\(\i=>)\i\.\i\.getName\(\i,this\.props\.channel\.id,(\i)\)/,
|
replace: ""
|
||||||
replace: "$1"
|
},
|
||||||
}
|
{
|
||||||
},
|
// Adds the alternative formatting for several users typing
|
||||||
// Adds the alternative formatting for several users typing
|
match: /(,{a:(\i),b:(\i),c:\i}\):\i\.length>3&&\(\i=)\i\.\i\.string\(\i\.\i#{intl::SEVERAL_USERS_TYPING}\)(?<=(\i)\.length.+?)/,
|
||||||
{
|
replace: (_, rest, a, b, users) => `${rest}$self.buildSeveralUsers({ a: ${a}, b: ${b}, count: ${users}.length - 2 })`,
|
||||||
find: "getCooldownTextStyle",
|
predicate: () => settings.store.alternativeFormatting
|
||||||
replacement: {
|
}
|
||||||
match: /(,{a:(\i),b:(\i),c:\i}\):)\i\.\i\.string\(\i\.\i#{intl::SEVERAL_USERS_TYPING}\)(?<=(\i)\.length.+?)/,
|
]
|
||||||
replace: (_, rest, a, b, users) => `${rest}$self.buildSeveralUsers({ a: ${a}, b: ${b}, count: ${users}.length - 2 })`
|
|
||||||
},
|
|
||||||
predicate: () => settings.store.alternativeFormatting
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settings,
|
|
||||||
|
|
||||||
TYPING_TEXT_STYLE: {
|
TYPING_TEXT_STYLE: {
|
||||||
display: "grid",
|
display: "grid",
|
||||||
|
|
Loading…
Reference in a new issue