BetterQuickReact: update settings and descriptions for them + comment stuff

This commit is contained in:
Sqaaakoi 2024-03-15 00:16:38 +13:00
parent 9dcae6b09a
commit 10d9bc9e56
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View file

@ -24,6 +24,7 @@
height: 25px; height: 25px;
} }
/* 8 or more columns exceeds the default max width */
[class*="menu_"]:has(>div>.vc-better-quick-react) { [class*="menu_"]:has(>div>.vc-better-quick-react) {
max-width: fit-content; max-width: fit-content;
} }

View file

@ -13,7 +13,7 @@ import definePlugin, { OptionType } from "@utils/types";
export const settings = definePluginSettings({ export const settings = definePluginSettings({
frequentEmojis: { frequentEmojis: {
description: "Use top frecency emojis instead of favourite emojis", description: "Use frequently used emojis instead of favourite emojis",
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
default: true default: true
}, },
@ -28,11 +28,11 @@ export const settings = definePluginSettings({
description: "Columns of quick reactions to display", description: "Columns of quick reactions to display",
type: OptionType.SLIDER, type: OptionType.SLIDER,
default: 4, default: 4,
markers: makeRange(4, 10, 1), markers: makeRange(1, 12, 1),
stickToMarkers: true stickToMarkers: true
}, },
compactMode: { compactMode: {
description: "Scales the buttons to 75% of their original scale, while increasing the emoji to 125% scale to stay visible. Recommended to have a minimum of 5 columns", description: "Scales the buttons to 75% of their original scale, whilst increasing the inner emoji to 125% scale. Emojis will be 93.75% of the original size. Recommended to have a minimum of 5 columns",
type: OptionType.BOOLEAN, type: OptionType.BOOLEAN,
default: false default: false
} }
@ -45,6 +45,7 @@ export default definePlugin({
settings, settings,
patches: [ patches: [
// Remove favourite emojis from being inserted at the start of the reaction list
{ {
find: "this.favoriteEmojisWithoutFetchingLatest.concat", find: "this.favoriteEmojisWithoutFetchingLatest.concat",
replacement: { replacement: {
@ -52,6 +53,7 @@ export default definePlugin({
replace: "($self.settings.store.frequentEmojis?[]:$1).concat" replace: "($self.settings.store.frequentEmojis?[]:$1).concat"
} }
}, },
// Override limit of emojis to display
{ {
find: "default.Messages.ADD_REACTION_NAMED.format", find: "default.Messages.ADD_REACTION_NAMED.format",
replacement: { replacement: {
@ -59,6 +61,7 @@ export default definePlugin({
replace: "$1.length>$self.getMaxQuickReactions()&&($2.length=$self.getMaxQuickReactions());" replace: "$1.length>$self.getMaxQuickReactions()&&($2.length=$self.getMaxQuickReactions());"
} }
}, },
// 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", find: "default.Messages.ADD_REACTION_NAMED.format",
replacement: { replacement: {