mirror of
https://github.com/Vendicated/Vencord
synced 2024-08-26 03:37:47 -04:00
fix USRBG & ViewIcons in new profiles (#2557)
Co-authored-by: Vendicated <vendicated@riseup.net>
This commit is contained in:
parent
29c65948b4
commit
5996e67c7d
2 changed files with 20 additions and 22 deletions
|
@ -61,11 +61,7 @@ export default definePlugin({
|
|||
replacement: [
|
||||
{
|
||||
match: /(\i)\.premiumType/,
|
||||
replace: "$self.premiumHook($1)||$&"
|
||||
},
|
||||
{
|
||||
match: /(?<=function \i\((\i)\)\{)(?=var.{30,50},bannerSrc:)/,
|
||||
replace: "$1.bannerSrc=$self.useBannerHook($1);"
|
||||
replace: "$self.patchPremiumType($1)||$&"
|
||||
},
|
||||
{
|
||||
match: /\?\(0,\i\.jsx\)\(\i,{type:\i,shown/,
|
||||
|
@ -74,17 +70,19 @@ export default definePlugin({
|
|||
]
|
||||
},
|
||||
{
|
||||
find: /overrideBannerSrc:\i,overrideBannerWidth:/,
|
||||
replacement: [
|
||||
{
|
||||
match: /(\i)\.premiumType/,
|
||||
replace: "$self.premiumHook($1)||$&"
|
||||
},
|
||||
{
|
||||
match: /function \i\((\i)\)\{/,
|
||||
replace: "$&$1.overrideBannerSrc=$self.useBannerHook($1);"
|
||||
}
|
||||
]
|
||||
find: "=!1,canUsePremiumCustomization:",
|
||||
replacement: {
|
||||
match: /(\i)\.premiumType/,
|
||||
replace: "$self.patchPremiumType($1)||$&"
|
||||
}
|
||||
},
|
||||
{
|
||||
find: "BannerLoadingStatus:function",
|
||||
replacement: {
|
||||
match: /(?<=void 0:)\i.getPreviewBanner\(\i,\i,\i\)/,
|
||||
replace: "$self.patchBannerUrl(arguments[0])||$&"
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
find: "\"data-selenium-video-tile\":",
|
||||
|
@ -92,7 +90,7 @@ export default definePlugin({
|
|||
replacement: [
|
||||
{
|
||||
match: /(?<=function\((\i),\i\)\{)(?=let.{20,40},style:)/,
|
||||
replace: "$1.style=$self.voiceBackgroundHook($1);"
|
||||
replace: "$1.style=$self.getVoiceBackgroundStyles($1);"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -106,7 +104,7 @@ export default definePlugin({
|
|||
);
|
||||
},
|
||||
|
||||
voiceBackgroundHook({ className, participantUserId }: any) {
|
||||
getVoiceBackgroundStyles({ className, participantUserId }: any) {
|
||||
if (className.includes("tile_")) {
|
||||
if (this.userHasBackground(participantUserId)) {
|
||||
return {
|
||||
|
@ -119,12 +117,12 @@ export default definePlugin({
|
|||
}
|
||||
},
|
||||
|
||||
useBannerHook({ displayProfile, user }: any) {
|
||||
patchBannerUrl({ displayProfile }: any) {
|
||||
if (displayProfile?.banner && settings.store.nitroFirst) return;
|
||||
if (this.userHasBackground(user.id)) return this.getImageUrl(user.id);
|
||||
if (this.userHasBackground(displayProfile?.userId)) return this.getImageUrl(displayProfile?.userId);
|
||||
},
|
||||
|
||||
premiumHook({ userId }: any) {
|
||||
patchPremiumType({ userId }: any) {
|
||||
if (this.userHasBackground(userId)) return 2;
|
||||
},
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ export default definePlugin({
|
|||
}
|
||||
})),
|
||||
// Banners
|
||||
...[".NITRO_BANNER,", /overrideBannerSrc:\i,overrideBannerWidth:/].map(find => ({
|
||||
...[".NITRO_BANNER,", "=!1,canUsePremiumCustomization:"].map(find => ({
|
||||
find,
|
||||
replacement: {
|
||||
// style: { backgroundImage: shouldShowBanner ? "url(".concat(bannerUrl,
|
||||
|
|
Loading…
Reference in a new issue