From 322ecc5e88b3dd027e62f2e83b550529741f4340 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Wed, 25 Oct 2023 19:59:35 +0700 Subject: [PATCH] usrbg: fix (#1853) --- src/plugins/usrbg/index.css | 2 +- src/plugins/usrbg/index.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/usrbg/index.css b/src/plugins/usrbg/index.css index 93e37ef48..69c5b1857 100644 --- a/src/plugins/usrbg/index.css +++ b/src/plugins/usrbg/index.css @@ -7,6 +7,6 @@ top: 76px; } -[style*="background-image"] [class*="background-"] { +[style*="background-image"] [class*="background_"] { background-color: transparent !important; } diff --git a/src/plugins/usrbg/index.tsx b/src/plugins/usrbg/index.tsx index 3e8c12257..ce6bd709b 100644 --- a/src/plugins/usrbg/index.tsx +++ b/src/plugins/usrbg/index.tsx @@ -59,8 +59,8 @@ export default definePlugin({ replace: "$self.premiumHook($1)||$&" }, { - match: /(\i)\.bannerSrc,/, - replace: "$self.useBannerHook($1)," + match: /(?<=function \i\((\i)\)\{)(?=var.{30,50},bannerSrc:)/, + replace: "$1.bannerSrc=$self.useBannerHook($1);" }, { match: /\?\(0,\i\.jsx\)\(\i,{type:\i,shown/, @@ -73,8 +73,8 @@ export default definePlugin({ predicate: () => settings.store.voiceBackground, replacement: [ { - match: /(\i)\.style,/, - replace: "$self.voiceBackgroundHook($1)," + match: /(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/, + replace: "$1.style=$self.voiceBackgroundHook($1);" } ] } @@ -90,7 +90,7 @@ export default definePlugin({ }, voiceBackgroundHook({ className, participantUserId }: any) { - if (className.includes("tile-")) { + if (className.includes("tile_")) { if (data[participantUserId]) { return { backgroundImage: `url(${data[participantUserId]})`,