feat(plugin): NoMirroredCamera

This commit is contained in:
verticalsync 2024-08-08 18:17:55 +03:00
parent 1e5e6d222b
commit 202de5af0b
No known key found for this signature in database
GPG key ID: C2BC9F32343245E1

View file

@ -0,0 +1,41 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "NoMirroredCamera",
description: "Prevents the camera from being mirrored on your screen",
authors: [EquicordDevs.nyx],
patches: [
// When focused on voice channel or group chat voice call
{
find: /\i\?\i.\i.SELF_VIDEO/,
replacement: {
match: /mirror:\i/,
replace: "mirror:!1"
}
},
// Popout camera when not focused on voice channel
{
find: ".mirror]:",
replacement: {
match: /\[(\i).mirror]:\i/,
replace: "[$1.mirror]:!1"
}
},
// Overriding css on Preview Camera/Change Video Background popup
{
find: ".cameraPreview,",
replacement: {
match: /className:\i.camera,/,
replace: "$&style:{transform: \"scalex(1)\"},"
}
}
]
});