mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-17 02:17:03 -04:00
Some Fixes
This commit is contained in:
parent
7adcfaa735
commit
319a058286
9 changed files with 37 additions and 176 deletions
|
@ -58,35 +58,33 @@ export default definePlugin({
|
|||
replace: "($self.settings.store.frequentEmojis?[]:$1).concat"
|
||||
}
|
||||
},
|
||||
// Override limit of emojis to display
|
||||
{
|
||||
find: "default.Messages.ADD_REACTION_NAMED.format",
|
||||
replacement: {
|
||||
match: /(\i)\.length>4&&\((\i)\.length=4\);/,
|
||||
replace: "let [betterQuickReactScrollValue,setBetterQuickReactScrollValue]=Vencord.Webpack.Common.React.useState(0);betterQuickReactScrollValue;"
|
||||
}
|
||||
},
|
||||
// Add a custom class to identify the quick reactions have been modified and a CSS variable for the number of columns to display
|
||||
{
|
||||
find: "default.Messages.ADD_REACTION_NAMED.format",
|
||||
replacement: {
|
||||
match: /className:(\i)\.wrapper,/,
|
||||
replace: "className:\"vc-better-quick-react \"+($self.settings.store.compactMode?\"vc-better-quick-react-compact \":\"\")+$1.wrapper,style:{\"--vc-better-quick-react-columns\":$self.settings.store.columns},"
|
||||
}
|
||||
},
|
||||
{
|
||||
find: "default.Messages.ADD_REACTION_NAMED.format",
|
||||
replacement: {
|
||||
match: /children:(\i)\.map\(/,
|
||||
replace: "onWheel:$self.onWheelWrapper(betterQuickReactScrollValue,setBetterQuickReactScrollValue,$1.length),children:$self.applyScroll($1,betterQuickReactScrollValue).map("
|
||||
}
|
||||
find: ".ADD_REACTION_NAMED.format",
|
||||
group: true,
|
||||
replacement: [
|
||||
// Override limit of emojis to display with offset hook.
|
||||
{
|
||||
match: /(\i)\.length>4&&\((\i)\.length=4\);/,
|
||||
replace: "let [betterQuickReactScrollValue,setBetterQuickReactScrollValue]=Vencord.Webpack.Common.React.useState(0);betterQuickReactScrollValue;"
|
||||
},
|
||||
// Add a custom class to identify the quick reactions have been modified and a CSS variable for the number of columns to display
|
||||
{
|
||||
match: /className:(\i)\.wrapper,/,
|
||||
replace: "className:\"vc-better-quick-react \"+($self.settings.store.compactMode?\"vc-better-quick-react-compact \":\"\")+$1.wrapper,style:{\"--vc-better-quick-react-columns\":$self.settings.store.columns},"
|
||||
},
|
||||
// Scroll handler + Apply the emoji count limit from earlier with custom logic
|
||||
{
|
||||
match: /children:(\i)\.map\(/,
|
||||
replace: "onWheel:$self.onWheelWrapper(betterQuickReactScrollValue,setBetterQuickReactScrollValue,$1.length),children:$self.applyScroll($1,betterQuickReactScrollValue).map("
|
||||
}
|
||||
]
|
||||
},
|
||||
// MenuGroup doesn't accept styles or anything special by default :/
|
||||
{
|
||||
find: "{MenuGroup:function()",
|
||||
find: ".groupLabel,",
|
||||
replacement: {
|
||||
match: /role:"group",/,
|
||||
replace: "role:\"group\",style:arguments[0].style,onWheel:arguments[0].onWheel,"
|
||||
replace: "$&style:arguments[0].style,onWheel:arguments[0].onWheel,"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue