From d8c8b74ed7b03b0ff61e79ca71c03f689429b9d5 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Thu, 21 Sep 2023 22:40:37 +0700 Subject: [PATCH] BetterRoleDot: Setting for copying role color in profile popout (#1698) --- src/plugins/betterRoleDot.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/plugins/betterRoleDot.ts b/src/plugins/betterRoleDot.ts index 773176d8e..2dd8c4ada 100644 --- a/src/plugins/betterRoleDot.ts +++ b/src/plugins/betterRoleDot.ts @@ -23,7 +23,7 @@ import { Clipboard, Toasts } from "@webpack/common"; export default definePlugin({ name: "BetterRoleDot", - authors: [Devs.Ven], + authors: [Devs.Ven, Devs.AutumnVN], description: "Copy role colour on RoleDot (accessibility setting) click. Also allows using both RoleDot and coloured names simultaneously", @@ -43,6 +43,23 @@ export default definePlugin({ match: /"(?:username|dot)"===\i(?!\.\i)/g, replace: "true", }, + }, + + { + find: ".ADD_ROLE_A11Y_LABEL", + predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout, + replacement: { + match: /"dot"===\i/, + replace: "true" + } + }, + { + find: ".roleVerifiedIcon", + predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout, + replacement: { + match: /"dot"===\i/, + replace: "true" + } } ], @@ -50,7 +67,14 @@ export default definePlugin({ bothStyles: { type: OptionType.BOOLEAN, description: "Show both role dot and coloured names", + restartNeeded: true, default: false, + }, + copyRoleColorInProfilePopout: { + type: OptionType.BOOLEAN, + description: "Allow click on role dot in profile popout to copy role color", + restartNeeded: true, + default: false } },