aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegumin <megumin.bakaretsurie@gmail.com>2022-11-21 19:12:46 +0000
committerGitHub <noreply@github.com>2022-11-21 20:12:46 +0100
commit31ec1ec1b4c031ffd0a22bfdc4c2678c19a9ca7e (patch)
tree34f1f66992c3ded5fda6fa1b90fe4e90155c9f50
parent0f7c80fd4d5a549212acd59234faba0c69c1f897 (diff)
downloadVencord-31ec1ec1b4c031ffd0a22bfdc4c2678c19a9ca7e.tar.gz
Vencord-31ec1ec1b4c031ffd0a22bfdc4c2678c19a9ca7e.tar.bz2
Vencord-31ec1ec1b4c031ffd0a22bfdc4c2678c19a9ca7e.zip
better platformindicators settings (#243)
-rw-r--r--src/plugins/platformIndicators.tsx28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/plugins/platformIndicators.tsx b/src/plugins/platformIndicators.tsx
index 9a9a1ab..2917ba8 100644
--- a/src/plugins/platformIndicators.tsx
+++ b/src/plugins/platformIndicators.tsx
@@ -98,6 +98,7 @@ export default definePlugin({
{
// Server member list decorators
find: "this.renderPremium()",
+ predicate: () => ["both", "list"].includes(Settings.plugins.PlatformIndicators.displayMode),
replacement: {
match: /this.renderPremium\(\)[^\]]*?\]/,
replace: "$&.concat(Vencord.Plugins.plugins.PlatformIndicators.renderPlatformIndicators(this.props))"
@@ -106,6 +107,7 @@ export default definePlugin({
{
// Dm list decorators
find: "PrivateChannel.renderAvatar",
+ predicate: () => ["both", "list"].includes(Settings.plugins.PlatformIndicators.displayMode),
replacement: {
match: /(subText:(.{1,3})\..+?decorators:)(.+?:null)/,
replace: "$1[$3].concat(Vencord.Plugins.plugins.PlatformIndicators.renderPlatformIndicators($2.props))"
@@ -114,7 +116,7 @@ export default definePlugin({
{
// User badges
find: "Messages.PROFILE_USER_BADGES",
- predicate: () => Settings.plugins.PlatformIndicators.showAsBadges,
+ predicate: () => ["both", "badges"].includes(Settings.plugins.PlatformIndicators.displayMode),
replacement: {
match: /(Messages\.PROFILE_USER_BADGES,role:"group",children:)(.+?\.key\)\}\)\))/,
replace: "$1[Vencord.Plugins.plugins.PlatformIndicators.renderPlatformIndicators(e)].concat($2)"
@@ -129,11 +131,25 @@ export default definePlugin({
),
options: {
- showAsBadges: {
- description: "Show platform icons in user badges",
- type: OptionType.BOOLEAN,
- default: true,
+ displayMode: {
+ type: OptionType.SELECT,
+ description: "Where to display the platform indicators",
restartNeeded: true,
- }
+ options: [
+ {
+ label: "Member List & Badges",
+ value: "both",
+ default: true
+ },
+ {
+ label: "Member List Only",
+ value: "list"
+ },
+ {
+ label: "Badges Only",
+ value: "badges"
+ }
+ ]
+ },
}
});