Equibop: Move Finds From Bop To Cord
This commit is contained in:
parent
45c48bf646
commit
d6241b31f9
19 changed files with 58 additions and 34 deletions
15
packages/discord-types/src/stores/MediaEngineStore.d.ts
vendored
Normal file
15
packages/discord-types/src/stores/MediaEngineStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export class MediaEngineStore extends FluxStore {
|
||||
isSelfMute(): boolean;
|
||||
isSelfDeaf(): boolean;
|
||||
|
||||
setAv1Enabled(AV1: boolean): void;
|
||||
setH265Enabled(H265: boolean): void;
|
||||
setH264Enabled(H264: boolean): void;
|
||||
|
||||
getAutomaticGainControl(): boolean;
|
||||
getInputDeviceId(): string;
|
||||
getMediaEngine(): any;
|
||||
getCodecCapabilities(e: any): any;
|
||||
}
|
||||
5
packages/discord-types/src/stores/SpellCheckStore.d.ts
vendored
Normal file
5
packages/discord-types/src/stores/SpellCheckStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export class SpellCheckStore extends FluxStore {
|
||||
isEnabled(): boolean;
|
||||
}
|
||||
6
packages/discord-types/src/stores/StreamerModeStore.d.ts
vendored
Normal file
6
packages/discord-types/src/stores/StreamerModeStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export class StreamerModeStore extends FluxStore {
|
||||
enabled: boolean;
|
||||
autoToggle: boolean;
|
||||
}
|
||||
3
packages/discord-types/src/stores/index.d.ts
vendored
3
packages/discord-types/src/stores/index.d.ts
vendored
|
|
@ -9,6 +9,9 @@ export * from "./GuildRoleStore";
|
|||
export * from "./GuildStore";
|
||||
export * from "./MessageStore";
|
||||
export * from "./RelationshipStore";
|
||||
export * from "./MediaEngineStore";
|
||||
export * from "./StreamerModeStore";
|
||||
export * from "./SpellCheckStore";
|
||||
export * from "./SelectedChannelStore";
|
||||
export * from "./SelectedGuildStore";
|
||||
export * from "./StickersStore";
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { Channel, User } from "@vencord/discord-types";
|
||||
import { JSX } from "react";
|
||||
|
||||
interface DecoratorProps {
|
||||
export type DecoratorProps = {
|
||||
type: "guild" | "dm";
|
||||
user: User;
|
||||
/** only present when this is a DM list item */
|
||||
channel: Channel;
|
||||
/** only present when this is a guild list item */
|
||||
isOwner: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
export type MemberListDecoratorFactory = (props: DecoratorProps) => JSX.Element | null;
|
||||
type OnlyIn = "guilds" | "dms";
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export const HiddenServersStore = proxyLazyWebpack(() => {
|
|||
const DB_KEY = "HideServers_servers";
|
||||
|
||||
class HiddenServersStore extends Store {
|
||||
private _hiddenGuilds: Set<string> = new Set();
|
||||
public _hiddenGuilds: Set<string> = new Set();
|
||||
public get hiddenGuilds() {
|
||||
return this._hiddenGuilds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import { deleteCacheFromDataStore, DeleteEntireStore, saveCacheToDataStore } fro
|
|||
export const noteHandlerCache = new Map();
|
||||
|
||||
export default new (class NoteHandler {
|
||||
private _formatNote(channel: Channel, message: Message): HolyNotes.Note {
|
||||
public _formatNote(channel: Channel, message: Message): HolyNotes.Note {
|
||||
return {
|
||||
id: message.id,
|
||||
channel_id: message.channel_id,
|
||||
|
|
|
|||
|
|
@ -10,17 +10,15 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
|||
import { debounce } from "@shared/debounce";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import definePlugin, { makeRange, OptionType } from "@utils/types";
|
||||
import { findByCode, findByProps, findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
|
||||
import { ChannelRouter, ChannelStore, ContextMenuApi, GuildStore, Menu, PermissionsBits, PermissionStore, React, SelectedChannelStore, Toasts, UserStore, VoiceStateStore } from "@webpack/common";
|
||||
import { findByCode, findByProps, findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||
import { ChannelRouter, ChannelStore, ContextMenuApi, GuildStore, MediaEngineStore, Menu, PermissionsBits, PermissionStore, React, SelectedChannelStore, Toasts, UserStore, VoiceActions, VoiceStateStore } from "@webpack/common";
|
||||
|
||||
import style from "./styles.css?managed";
|
||||
|
||||
const ChatVoiceIcon = findComponentByCodeLazy("0l1.8-1.8c.17");
|
||||
const Button = findComponentByCodeLazy(".NONE,disabled:", ".PANEL_BUTTON");
|
||||
const MediaEngineStore = findStoreLazy("MediaEngineStore");
|
||||
const ChannelActions = findByPropsLazy("selectChannel", "selectVoiceChannel");
|
||||
const { toggleSelfMute } = findByPropsLazy("toggleSelfMute");
|
||||
const { toggleSelfDeaf } = findByPropsLazy("toggleSelfDeaf");
|
||||
|
||||
const valueOperation = [
|
||||
{ label: "More than", value: "<", default: false },
|
||||
{ label: "Less than", value: ">", default: false },
|
||||
|
|
@ -767,8 +765,8 @@ function JoinVc(channelID) {
|
|||
if (settings.store.autoNavigate) ChannelRouter.transitionToChannel(channel.id);
|
||||
if (settings.store.autoCamera && PermissionStore.can(VIDEO, channel)) autoCamera();
|
||||
if (settings.store.autoStream && PermissionStore.can(STREAM, channel)) autoStream();
|
||||
if (settings.store.selfMute && !MediaEngineStore.isSelfMute() && SelectedChannelStore.getVoiceChannelId()) toggleSelfMute();
|
||||
if (settings.store.selfDeafen && !MediaEngineStore.isSelfDeaf() && SelectedChannelStore.getVoiceChannelId()) toggleSelfDeaf();
|
||||
if (settings.store.selfMute && !MediaEngineStore.isSelfMute() && SelectedChannelStore.getVoiceChannelId()) VoiceActions.toggleSelfMute();
|
||||
if (settings.store.selfDeafen && !MediaEngineStore.isSelfDeaf() && SelectedChannelStore.getVoiceChannelId()) VoiceActions.toggleSelfDeaf();
|
||||
}
|
||||
|
||||
async function autoStream() {
|
||||
|
|
|
|||
|
|
@ -12,12 +12,6 @@ import "./colorStyles.css";
|
|||
import { classNameFactory } from "@api/Styles";
|
||||
import { ColorPicker, Forms } from "@webpack/common";
|
||||
|
||||
interface ColorPickerProps {
|
||||
color: number | null;
|
||||
showEyeDropper?: boolean;
|
||||
onChange(value: number | null): void;
|
||||
}
|
||||
|
||||
const cl = classNameFactory("vc-remix-settings-color-");
|
||||
|
||||
interface Props {
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
import { definePluginSettings, Settings } from "@api/Settings";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
import { MediaEngineStore } from "@webpack/common";
|
||||
|
||||
let mediaEngine = findStoreLazy("MediaEngineStore");
|
||||
let mediaEngine = MediaEngineStore;
|
||||
|
||||
const originalCodecStatuses: {
|
||||
AV1: boolean,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { EquicordDevs } from "@utils/constants";
|
|||
import definePlugin, { makeRange, OptionType } from "@utils/types";
|
||||
import { Channel, Message, User } from "@vencord/discord-types";
|
||||
import { findByPropsLazy, findStore } from "@webpack";
|
||||
import { Button, ChannelStore, GuildRoleStore, NavigationRouter, RelationshipStore, SelectedChannelStore, UserStore } from "@webpack/common";
|
||||
import { Button, ChannelStore, GuildRoleStore, NavigationRouter, RelationshipStore, SelectedChannelStore, StreamerModeStore, UserStore } from "@webpack/common";
|
||||
import { ReactNode } from "react";
|
||||
|
||||
import { NotificationData, showNotification } from "./components/Notifications";
|
||||
|
|
@ -219,7 +219,7 @@ export default definePlugin({
|
|||
const isStreaming = findStore("ApplicationStreamingStore").getAnyStreamForUser(UserStore.getCurrentUser()?.id);
|
||||
|
||||
const streamerMode = settings.store.disableInStreamerMode;
|
||||
const currentUserStreamerMode = findStore("StreamerModeStore").enabled;
|
||||
const currentUserStreamerMode = StreamerModeStore.enabled;
|
||||
|
||||
if (streamerMode && currentUserStreamerMode) return;
|
||||
if (isStreaming && settings.store.streamingTreatment === StreamingTreatment.IGNORE) return;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class YoutubeMusicSocket {
|
|||
public onChange: (e: Message) => void;
|
||||
public ready = false;
|
||||
|
||||
private socket: WebSocket | undefined;
|
||||
public socket: WebSocket | undefined;
|
||||
|
||||
constructor(onChange: typeof this.onChange) {
|
||||
this.reconnect();
|
||||
|
|
@ -146,7 +146,7 @@ export const YoutubeMusicStore = proxyLazyWebpack(() => {
|
|||
|
||||
class YoutubeMusicStore extends Store {
|
||||
public mPosition = 0;
|
||||
private start = 0;
|
||||
public start = 0;
|
||||
|
||||
public song: Song | null = null;
|
||||
public isPlaying = false;
|
||||
|
|
@ -226,7 +226,7 @@ export const YoutubeMusicStore = proxyLazyWebpack(() => {
|
|||
this.socket.routes.seek(Math.round(ms / 1000));
|
||||
}
|
||||
|
||||
private ensureSocketReady(): boolean {
|
||||
public ensureSocketReady(): boolean {
|
||||
if (!this.socket || !this.socket.ready) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,10 @@ import { Devs, EquicordDevs } from "@utils/constants";
|
|||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { GuildMember, Message, User } from "@vencord/discord-types";
|
||||
import { findByCodeLazy, findStoreLazy } from "@webpack";
|
||||
import { ChannelStore, GuildMemberStore, MessageStore, RelationshipStore, UserStore } from "@webpack/common";
|
||||
import { ChannelStore, GuildMemberStore, MessageStore, RelationshipStore, StreamerModeStore, UserStore } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
const wrapEmojis = findByCodeLazy(/"span",\{className:\i\.emoji,children:/);
|
||||
const StreamerModeStore = findStoreLazy("StreamerModeStore");
|
||||
const AccessibilityStore = findStoreLazy("AccessibilityStore");
|
||||
const colorPattern = /^#(?:[\da-f]{3}){1,2}$|^#(?:[\da-f]{4}){1,2}$|(rgb|hsl)a?\((\s*-?\d+%?\s*,){2}(\s*-?\d+%?\s*)\)|(rgb|hsl)a?\((\s*-?\d+%?\s*,){3}\s*(0|(0?\.\d+)|1)\)$/iu;
|
||||
const roleColorPattern = /^role((?:\+|-)\d{0,4})?$/iu;
|
||||
|
|
|
|||
|
|
@ -156,13 +156,13 @@ function VoiceChannelTooltip({ channel, isLocked }: VoiceChannelTooltipProps) {
|
|||
);
|
||||
}
|
||||
|
||||
interface VoiceChannelIndicatorProps {
|
||||
export type VoiceChannelIndicatorProps = {
|
||||
userId: string;
|
||||
isMessageIndicator?: boolean;
|
||||
isProfile?: boolean;
|
||||
isActionButton?: boolean;
|
||||
shouldHighlight?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
const clickTimers = {} as Record<string, any>;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,11 +17,10 @@
|
|||
*/
|
||||
|
||||
import { PluginNative } from "@utils/types";
|
||||
import { Button, showToast, Toasts, useState } from "@webpack/common";
|
||||
import { Button, MediaEngineStore, showToast, Toasts, useState } from "@webpack/common";
|
||||
|
||||
import type { VoiceRecorder } from ".";
|
||||
import { settings } from "./settings";
|
||||
import { MediaEngineStore } from "./utils";
|
||||
|
||||
const Native = VencordNative.pluginHelpers.VoiceMessages as PluginNative<typeof import("./native")>;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Button, useState } from "@webpack/common";
|
||||
import { Button, MediaEngineStore, useState } from "@webpack/common";
|
||||
|
||||
import type { VoiceRecorder } from ".";
|
||||
import { settings } from "./settings";
|
||||
import { MediaEngineStore } from "./utils";
|
||||
|
||||
export const VoiceRecorderWeb: VoiceRecorder = ({ setAudioBlob, onRecordingChange }) => {
|
||||
const [recording, setRecording] = useState(false);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,5 @@
|
|||
*/
|
||||
|
||||
import { classNameFactory } from "@api/Styles";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
|
||||
export const MediaEngineStore = findStoreLazy("MediaEngineStore");
|
||||
export const cl = classNameFactory("vc-vmsg-");
|
||||
|
|
|
|||
|
|
@ -48,6 +48,9 @@ export let SelectedGuildStore: t.SelectedGuildStore;
|
|||
export let ChannelStore: t.ChannelStore;
|
||||
export let TypingStore: t.TypingStore;
|
||||
export let RelationshipStore: t.RelationshipStore;
|
||||
export let MediaEngineStore: t.MediaEngineStore;
|
||||
export let StreamerModeStore: t.StreamerModeStore;
|
||||
export let SpellCheckStore: t.SpellCheckStore;
|
||||
|
||||
export let EmojiStore: t.EmojiStore;
|
||||
export let StickersStore: t.StickersStore;
|
||||
|
|
@ -71,6 +74,9 @@ waitForStore("GuildStore", m => GuildStore = m);
|
|||
waitForStore("GuildRoleStore", m => GuildRoleStore = m);
|
||||
waitForStore("GuildMemberStore", m => GuildMemberStore = m);
|
||||
waitForStore("RelationshipStore", m => RelationshipStore = m);
|
||||
waitForStore("MediaEngineStore", m => MediaEngineStore = m);
|
||||
waitForStore("StreamerModeStore", m => StreamerModeStore = m);
|
||||
waitForStore("SpellCheckStore", m => SpellCheckStore = m);
|
||||
waitForStore("PermissionStore", m => PermissionStore = m);
|
||||
waitForStore("PresenceStore", m => PresenceStore = m);
|
||||
waitForStore("ReadStateStore", m => ReadStateStore = m);
|
||||
|
|
|
|||
|
|
@ -179,6 +179,8 @@ export const UserProfileActions = findByPropsLazy("openUserProfileModal", "close
|
|||
export const InviteActions = findByPropsLazy("resolveInvite");
|
||||
export const ChannelActionCreators = findByPropsLazy("openPrivateChannel");
|
||||
|
||||
export const VoiceActions = findByPropsLazy("toggleSelfMute");
|
||||
|
||||
export const IconUtils: t.IconUtils = findByPropsLazy("getGuildBannerURL", "getUserAvatarURL");
|
||||
|
||||
export const ReadStateUtils = mapMangledModuleLazy('type:"ENABLE_AUTOMATIC_ACK",', {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue