mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-25 14:27:01 -04:00
Fix Conflicts + Invite Button
This commit is contained in:
parent
5c04fac366
commit
9b8ab3bf97
6 changed files with 74 additions and 27 deletions
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { migratePluginSettings } from "@api/Settings";
|
||||
import { migratePluginSettings, Settings } from "@api/Settings";
|
||||
import { disableStyle, enableStyle } from "@api/Styles";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
|
@ -12,18 +12,25 @@ import { IconUtils, UserStore } from "@webpack/common";
|
|||
|
||||
import style from "./style.css?managed";
|
||||
|
||||
interface iUSRBG extends Plugin {
|
||||
userHasBackground(userId: string);
|
||||
getImageUrl(userId: string): string | null;
|
||||
}
|
||||
|
||||
migratePluginSettings("FullVCPFP", "fullVcPfp");
|
||||
export default definePlugin({
|
||||
name: "FullVCPFP",
|
||||
description: "Makes avatars take up the entire vc tile. Breaks if USRBG Voice Background is enabled.",
|
||||
authors: [EquicordDevs.mochienya],
|
||||
patches: [{
|
||||
find: "\"data-selenium-video-tile\":",
|
||||
replacement: {
|
||||
match: /(?<=function\((\i),\i\)\{)/,
|
||||
replace: "$1.style=$self.getVoiceBackgroundStyles($1);",
|
||||
patches: [
|
||||
{
|
||||
find: "\"data-selenium-video-tile\":",
|
||||
replacement: {
|
||||
match: /(?<=function\((\i),\i\)\{)/,
|
||||
replace: "$1.style=$self.getVoiceBackgroundStyles($1);",
|
||||
}
|
||||
}
|
||||
}],
|
||||
],
|
||||
|
||||
getVoiceBackgroundStyles({ className, participantUserId }: any) {
|
||||
if (!className.includes("tile_")) return;
|
||||
|
@ -32,6 +39,19 @@ export default definePlugin({
|
|||
|
||||
const avatarUrl = IconUtils.getUserAvatarURL(user, false, 1024);
|
||||
|
||||
if (Settings.plugins.USRBG.enabled && Settings.plugins.USRBG.voiceBackground) {
|
||||
const USRBG = (Vencord.Plugins.plugins.USRBG as unknown as iUSRBG);
|
||||
if (USRBG.userHasBackground(participantUserId)) {
|
||||
return {
|
||||
backgroundImage: `url(${USRBG.getImageUrl(participantUserId)})`,
|
||||
backgroundSize: "cover",
|
||||
backgroundPosition: "center",
|
||||
backgroundRepeat: "no-repeat",
|
||||
"--full-res-avatar": `url(${avatarUrl})`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
"--full-res-avatar": `url(${avatarUrl})`,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue