Revert "Quoter: Fix & Shrink + Remove Old Finds"
This reverts commit 262336f436.
This commit is contained in:
parent
262336f436
commit
203d1a85d6
19 changed files with 98 additions and 20 deletions
|
|
@ -40,12 +40,13 @@ import { openWarningModal } from "./PluginModal";
|
|||
import { StockPluginsCard, UserPluginsCard } from "./PluginStatCards";
|
||||
|
||||
// Avoid circular dependency
|
||||
const { stopPlugin } = proxyLazy(() => require("plugins"));
|
||||
const { startDependenciesRecursive, startPlugin, stopPlugin } = proxyLazy(() => require("plugins"));
|
||||
|
||||
export const cl = classNameFactory("vc-plugins-");
|
||||
export const logger = new Logger("PluginSettings", "#a6d189");
|
||||
|
||||
const InputStyles = findByPropsLazy("inputWrapper", "inputError", "error");
|
||||
const ButtonClasses = findByPropsLazy("button", "disabled", "enabled");
|
||||
|
||||
function showErrorToast(message: string) {
|
||||
Toasts.show({
|
||||
|
|
|
|||
|
|
@ -22,6 +22,17 @@ import definePlugin, { OptionType } from "@utils/types";
|
|||
import { VoiceState } from "@vencord/discord-types";
|
||||
import { ChannelStore, FluxDispatcher, GuildMemberStore, Toasts, UserStore, VoiceStateStore } from "@webpack/common";
|
||||
|
||||
interface ChannelState {
|
||||
userId: string;
|
||||
channelId: string;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
stream: boolean;
|
||||
selfDeaf: boolean;
|
||||
selfMute: boolean;
|
||||
selfStream: boolean;
|
||||
}
|
||||
|
||||
const settings = definePluginSettings({
|
||||
port: {
|
||||
type: OptionType.NUMBER,
|
||||
|
|
|
|||
|
|
@ -178,10 +178,12 @@ function shouldHideBadgeOnUserProfiles(): boolean {
|
|||
function shouldHideQuestPopup(quest: Quest | null): boolean {
|
||||
const {
|
||||
disableQuestsPopupAboveAccountPanel,
|
||||
disableQuestsEverything
|
||||
disableQuestsEverything,
|
||||
triggerQuestsRerender
|
||||
} = settings.use([
|
||||
"disableQuestsPopupAboveAccountPanel",
|
||||
"disableQuestsEverything"
|
||||
"disableQuestsEverything",
|
||||
"triggerQuestsRerender"
|
||||
]);
|
||||
|
||||
const noProgress = !quest?.userStatus?.progress || Object.keys(quest?.userStatus?.progress || {}).length === 0;
|
||||
|
|
@ -249,12 +251,16 @@ function QuestTileContextMenu(children: React.ReactNode[], props: { quest: any;
|
|||
|
||||
export function getQuestTileClasses(originalClasses: string, quest: Quest, color: number | null | undefined, gradient: string | undefined): string {
|
||||
const {
|
||||
ignoredQuestIDs,
|
||||
ignoredQuestProfile,
|
||||
restyleQuestsUnclaimed,
|
||||
restyleQuestsClaimed,
|
||||
restyleQuestsIgnored,
|
||||
restyleQuestsExpired,
|
||||
restyleQuestsGradient
|
||||
} = settings.use([
|
||||
"ignoredQuestIDs",
|
||||
"ignoredQuestProfile",
|
||||
"restyleQuestsUnclaimed",
|
||||
"restyleQuestsClaimed",
|
||||
"restyleQuestsIgnored",
|
||||
|
|
@ -320,7 +326,7 @@ export function getQuestTileClasses(originalClasses: string, quest: Quest, color
|
|||
}
|
||||
|
||||
function makeDesktopCompatible(quests: Quest[]): void {
|
||||
const { makeMobileQuestsDesktopCompatible } = settings.use(["makeMobileQuestsDesktopCompatible", "triggerQuestsRerender"]);
|
||||
const { makeMobileQuestsDesktopCompatible, triggerQuestsRerender } = settings.use(["makeMobileQuestsDesktopCompatible", "triggerQuestsRerender"]);
|
||||
|
||||
if (makeMobileQuestsDesktopCompatible) {
|
||||
quests.forEach(quest => {
|
||||
|
|
@ -352,17 +358,27 @@ function makeDesktopCompatible(quests: Quest[]): void {
|
|||
|
||||
function sortQuests(quests: Quest[], skip?: boolean): Quest[] {
|
||||
const {
|
||||
ignoredQuestIDs,
|
||||
ignoredQuestProfile,
|
||||
reorderQuests,
|
||||
unclaimedSubsort,
|
||||
claimedSubsort,
|
||||
ignoredSubsort,
|
||||
expiredSubsort
|
||||
expiredSubsort,
|
||||
completeVideoQuestsInBackground,
|
||||
completeGameQuestsInBackground,
|
||||
triggerQuestsRerender
|
||||
} = settings.use([
|
||||
"ignoredQuestIDs",
|
||||
"ignoredQuestProfile",
|
||||
"reorderQuests",
|
||||
"unclaimedSubsort",
|
||||
"claimedSubsort",
|
||||
"ignoredSubsort",
|
||||
"expiredSubsort"
|
||||
"expiredSubsort",
|
||||
"completeVideoQuestsInBackground",
|
||||
"completeGameQuestsInBackground",
|
||||
"triggerQuestsRerender"
|
||||
]);
|
||||
|
||||
makeDesktopCompatible(quests);
|
||||
|
|
@ -452,6 +468,16 @@ function sortQuests(quests: Quest[], skip?: boolean): Quest[] {
|
|||
}
|
||||
|
||||
export function getQuestTileStyle(quest: Quest | null): Record<string, string> {
|
||||
const {
|
||||
restyleQuests,
|
||||
ignoredQuestIDs,
|
||||
ignoredQuestProfile
|
||||
} = settings.use([
|
||||
"restyleQuests",
|
||||
"ignoredQuestIDs",
|
||||
"ignoredQuestProfile"
|
||||
]);
|
||||
|
||||
const style: Record<string, string> = {};
|
||||
let themeColor: RGB | null = null;
|
||||
|
||||
|
|
@ -775,6 +801,7 @@ function disguiseHomeButton(location: string): boolean {
|
|||
}
|
||||
|
||||
function useQuestRerender(): number {
|
||||
const { triggerQuestsRerender } = settings.use(["triggerQuestsRerender"]);
|
||||
const [renderTrigger, setRenderTrigger] = useState(0);
|
||||
useEffect(() => addRerenderCallback(() => setRenderTrigger(prev => prev + 1)), []);
|
||||
return renderTrigger;
|
||||
|
|
@ -791,10 +818,12 @@ function getLastFilterChoices(): { group: string; filter: string; }[] | null {
|
|||
}
|
||||
|
||||
function setLastSortChoice(sort: string): void {
|
||||
const { rememberQuestPageFilters } = settings.use(["rememberQuestPageFilters"]);
|
||||
settings.store.lastQuestPageSort = sort;
|
||||
}
|
||||
|
||||
function setLastFilterChoices(filters: { group: string; filter: string; }[]): void {
|
||||
const { rememberQuestPageFilters } = settings.use(["rememberQuestPageFilters"]);
|
||||
if (!filters || !Object.keys(filters).length || !Object.values(filters).every(f => f.group && f.filter)) { return; }
|
||||
settings.store.lastQuestPageFilters = JSON.parse(JSON.stringify(filters)).reduce((acc, item) => ({ ...acc, [item.filter]: item }), {});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -364,6 +364,7 @@ function validateQuestButtonSetting() {
|
|||
|
||||
function validateDisableQuestSetting() {
|
||||
const {
|
||||
disableQuestsEverything,
|
||||
disableQuestsDiscoveryTab,
|
||||
disableQuestsFetchingQuests,
|
||||
disableQuestsPopupAboveAccountPanel,
|
||||
|
|
@ -371,6 +372,7 @@ function validateDisableQuestSetting() {
|
|||
disableQuestsGiftInventoryRelocationNotice,
|
||||
disableFriendsListActiveNowPromotion
|
||||
} = settings.use([
|
||||
"disableQuestsEverything",
|
||||
"disableQuestsDiscoveryTab",
|
||||
"disableQuestsFetchingQuests",
|
||||
"disableQuestsPopupAboveAccountPanel",
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ export default definePlugin({
|
|||
}
|
||||
],
|
||||
flux: {
|
||||
VOICE_STATE_UPDATES() {
|
||||
VOICE_STATE_UPDATES({ voiceStates }: { voiceStates: VoiceState[]; }) {
|
||||
const currentUserId = UserStore.getCurrentUser().id;
|
||||
const myChannelId = VoiceStateStore.getVoiceStateForUser(currentUserId)?.channelId;
|
||||
if (!myChannelId || !settings.store.leaveEmpty) return;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export default definePlugin({
|
|||
if (!repliedMessage || repliedMessage.author.id !== user.id) return;
|
||||
|
||||
const whitelist = settings.store.replyPingWhitelist.split(",").map(id => id.trim());
|
||||
const isWhitelisted = whitelist.includes(message.author.id);
|
||||
const isWhitelisted = settings.store.replyPingWhitelist.includes(message.author.id);
|
||||
|
||||
if (isWhitelisted || settings.store.alwaysPingOnReply) {
|
||||
if (!message.mentions.some(mention => mention.id === user.id)) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { getUserSettingLazy } from "@api/UserSettings";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
|
|
@ -102,6 +103,8 @@ interface SFMR {
|
|||
item: Item;
|
||||
}
|
||||
|
||||
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!;
|
||||
|
||||
const applicationId = "1325126169179197500";
|
||||
const placeholderId = "2a96cbd8b46e442fc41c2b86b821562f";
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { ApplicationAssetUtils, FluxDispatcher } from "@webpack/common";
|
|||
|
||||
import { BanchoStatusEnum, GameState, Modes, TosuApi, UserLoginStatus } from "./type";
|
||||
|
||||
const socketId = "tosu";
|
||||
const OSU_APP_ID = "367827983903490050";
|
||||
const OSU_LARGE_IMAGE = "373344233077211136";
|
||||
const OSU_STARDARD_SMALL_IMAGE = "373370493127884800";
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { getUserSettingLazy } from "@api/UserSettings";
|
||||
import { Link } from "@components/Link";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { Logger } from "@utils/Logger";
|
||||
|
|
@ -43,6 +44,8 @@ const enum NameFormat {
|
|||
AlbumName = "album"
|
||||
}
|
||||
|
||||
const ShowCurrentGame = getUserSettingLazy<boolean>("status", "showCurrentGame")!;
|
||||
|
||||
const applicationId = "1108588077900898414";
|
||||
const placeholderId = "2a96cbd8b46e442fc41c2b86b821562f";
|
||||
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ export default definePlugin({
|
|||
oldMsg === newMsg,
|
||||
);
|
||||
|
||||
const { inlineEdits } = settings.use(["inlineEdits"]);
|
||||
const { showEditDiffs, inlineEdits } = settings.use(["showEditDiffs", "inlineEdits"]);
|
||||
|
||||
return inlineEdits && (
|
||||
<React.Fragment key={disabledDiffMessages.has(messageId) ? `diff-off-${messageId}` : `diff-on-${messageId}`}>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import { Devs } from "@utils/constants";
|
|||
import definePlugin, { OptionType } from "@utils/types";
|
||||
|
||||
const EMOTE = "<:luna:1035316192220553236>";
|
||||
const DATA_KEY = "MessageTags_TAGS";
|
||||
const MessageTagsMarker = Symbol("MessageTags");
|
||||
|
||||
interface Tag {
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
filterStream(channelStream: [ChannelStreamGroupProps | ChannelStreamMessageProps | ChannelStreamDividerProps]) {
|
||||
const { alsoHideIgnoredUsers } = settings.use();
|
||||
const { alsoHideIgnoredUsers, disableNotifications, hideBlockedUserReplies, allowAutoModMessages, defaultHideUsers, overrideUsers } = settings.use();
|
||||
|
||||
const newChannelStream = channelStream.map(item => {
|
||||
if (item.type === "MESSAGE_GROUP_BLOCKED" || (item.type === "MESSAGE_GROUP_IGNORED" && alsoHideIgnoredUsers)) {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,11 @@ export interface Category {
|
|||
collapsed?: boolean;
|
||||
}
|
||||
|
||||
const CATEGORY_BASE_KEY = "PinDMsCategories-";
|
||||
const CATEGORY_MIGRATED_PINDMS_KEY = "PinDMsMigratedPinDMs";
|
||||
const CATEGORY_MIGRATED_KEY = "PinDMsMigratedOldCategories";
|
||||
const OLD_CATEGORY_KEY = "BetterPinDMsCategories-";
|
||||
|
||||
let forceUpdateDms: (() => void) | undefined = undefined;
|
||||
export let currentUserCategories: Category[] = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ const enum ChannelFlags {
|
|||
|
||||
|
||||
const ChatScrollClasses = findByPropsLazy("auto", "managedReactiveScroller");
|
||||
const ChatClasses = findByPropsLazy("chat", "content", "noChat", "chatContent");
|
||||
const ChannelBeginHeader = findComponentByCodeLazy("#{intl::ROLE_REQUIRED_SINGLE_USER_MESSAGE}");
|
||||
const TagComponent = findComponentByCodeLazy("#{intl::FORUM_TAG_A11Y_FILTER_BY_TAG}");
|
||||
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ function renderUsername(
|
|||
const isVoice = type === "voiceChannel";
|
||||
|
||||
const config = hookless ? settings.store : settings.use();
|
||||
const { messages, replies, mentions, memberList, profilePopout, reactions, discriminators, truncateAllNamesWithStreamerMode, removeDuplicates, ignoreGradients, animateGradients, includedNames, friendNameColor, nicknameColor, displayNameColor, usernameColor } = config;
|
||||
const { messages, replies, mentions, memberList, profilePopout, reactions, discriminators, hideDefaultAtSign, truncateAllNamesWithStreamerMode, removeDuplicates, ignoreGradients, animateGradients, includedNames, friendNameColor, nicknameColor, displayNameColor, usernameColor, triggerNameRerender } = config;
|
||||
|
||||
const canUseGradient = ((author as GuildMember)?.guildId ? (GuildStore.getGuild((author as GuildMember).guildId) ?? {}).premiumFeatures?.features.includes("ENHANCED_ROLE_COLORS") : false);
|
||||
const textMutedValue = getComputedStyle(document.documentElement)?.getPropertyValue("--text-muted")?.trim() || "#72767d";
|
||||
|
|
@ -921,22 +921,22 @@ export default definePlugin({
|
|||
],
|
||||
|
||||
flux: {
|
||||
RELATIONSHIP_UPDATE() {
|
||||
RELATIONSHIP_UPDATE(data) {
|
||||
// Allows rerendering when changing friend names.
|
||||
settings.store.triggerNameRerender = !settings.store.triggerNameRerender;
|
||||
},
|
||||
|
||||
RUNNING_STREAMER_TOOLS_CHANGE() {
|
||||
RUNNING_STREAMER_TOOLS_CHANGE(data) {
|
||||
// Allows rerendering when toggling streamer mode.
|
||||
settings.store.triggerNameRerender = !settings.store.triggerNameRerender;
|
||||
},
|
||||
|
||||
ACCESSIBILITY_SYSTEM_PREFERS_REDUCED_MOTION_CHANGED() {
|
||||
ACCESSIBILITY_SYSTEM_PREFERS_REDUCED_MOTION_CHANGED(data) {
|
||||
// Allows rerendering when toggling reduced motion.
|
||||
settings.store.triggerNameRerender = !settings.store.triggerNameRerender;
|
||||
},
|
||||
|
||||
ACCESSIBILITY_SET_PREFERS_REDUCED_MOTION() {
|
||||
ACCESSIBILITY_SET_PREFERS_REDUCED_MOTION(data) {
|
||||
// Allows rerendering when toggling reduced motion.
|
||||
settings.store.triggerNameRerender = !settings.store.triggerNameRerender;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,11 +121,21 @@ const SilentTypingChatToggle: ChatBarButtonFactory = ({ channel, type }) => {
|
|||
const {
|
||||
enabledGlobally,
|
||||
chatIcon,
|
||||
defaultHidden
|
||||
defaultHidden,
|
||||
enabledLocations,
|
||||
disabledLocations,
|
||||
chatIconLeftClickAction,
|
||||
chatIconMiddleClickAction,
|
||||
chatIconRightClickAction,
|
||||
} = settings.use([
|
||||
"enabledGlobally",
|
||||
"chatIcon",
|
||||
"defaultHidden"
|
||||
"defaultHidden",
|
||||
"enabledLocations",
|
||||
"disabledLocations",
|
||||
"chatIconLeftClickAction",
|
||||
"chatIconMiddleClickAction",
|
||||
"chatIconRightClickAction",
|
||||
]);
|
||||
|
||||
const validChat = ["normal", "sidebar"].some(x => type.analyticsName === x);
|
||||
|
|
@ -228,12 +238,16 @@ const ChatBarContextCheckbox: NavContextMenuPatchCallback = children => {
|
|||
chatIcon,
|
||||
chatContextMenu,
|
||||
enabledGlobally,
|
||||
defaultHidden
|
||||
defaultHidden,
|
||||
hideChatBoxTypingIndicators,
|
||||
hideMembersListTypingIndicators
|
||||
} = settings.use([
|
||||
"chatIcon",
|
||||
"chatContextMenu",
|
||||
"enabledGlobally",
|
||||
"defaultHidden"
|
||||
"defaultHidden",
|
||||
"hideChatBoxTypingIndicators",
|
||||
"hideMembersListTypingIndicators"
|
||||
]);
|
||||
|
||||
if (!chatContextMenu) return;
|
||||
|
|
|
|||
|
|
@ -8,13 +8,17 @@ import { classNameFactory } from "@api/Styles";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { classes } from "@utils/misc";
|
||||
import { Channel } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { filters, findByPropsLazy, mapMangledModuleLazy } from "@webpack";
|
||||
import { ChannelRouter, ChannelStore, Parser, PermissionsBits, PermissionStore, React, showToast, Text, Toasts, Tooltip, useMemo, UserStore, UserSummaryItem, useStateFromStores, VoiceStateStore } from "@webpack/common";
|
||||
import { PropsWithChildren } from "react";
|
||||
|
||||
const cl = classNameFactory("vc-uvs-");
|
||||
|
||||
const { selectVoiceChannel } = findByPropsLazy("selectVoiceChannel", "selectChannel");
|
||||
const { useChannelName } = mapMangledModuleLazy("#{intl::GROUP_DM_ALONE}", {
|
||||
useChannelName: filters.byCode("()=>null==")
|
||||
});
|
||||
|
||||
const ActionButtonClasses = findByPropsLazy("actionButton", "highlight");
|
||||
|
||||
type IconProps = Omit<React.ComponentPropsWithoutRef<"div">, "children"> & {
|
||||
|
|
|
|||
|
|
@ -24,8 +24,10 @@ import { Queue } from "@utils/Queue";
|
|||
import { useForceUpdater } from "@utils/react";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { CustomEmoji, Message, ReactionEmoji, User } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { ChannelStore, Constants, FluxDispatcher, React, RestAPI, useEffect, useLayoutEffect, UserSummaryItem } from "@webpack/common";
|
||||
|
||||
const AvatarStyles = findByPropsLazy("moreUsers", "emptyUser", "avatarContainer", "clickableAvatar");
|
||||
let Scroll: any = null;
|
||||
const queue = new Queue();
|
||||
let reactions: Record<string, ReactionCacheEntry>;
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ interface NotificationObject {
|
|||
}
|
||||
|
||||
const notificationsShouldNotify = findByCodeLazy(".SUPPRESS_NOTIFICATIONS))return!1");
|
||||
const logger = new Logger("XSOverlay");
|
||||
|
||||
const settings = definePluginSettings({
|
||||
webSocketPort: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue