Drop VCSupport for direct implementation
This commit is contained in:
parent
6b5e31ff3b
commit
b524190763
3 changed files with 31 additions and 54 deletions
|
|
@ -5,12 +5,16 @@
|
|||
*/
|
||||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { Devs, EquicordDevs, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_SUPPORT_CHANNEL_IDS } from "@utils/constants";
|
||||
import { isAnyPluginDev } from "@utils/misc";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Alerts, NavigationRouter, UserStore } from "@webpack/common";
|
||||
|
||||
import { PluginButtons } from "./pluginButtons";
|
||||
import { PluginCards } from "./pluginCards";
|
||||
|
||||
let clicked = false;
|
||||
|
||||
const settings = definePluginSettings({
|
||||
disableDMContextMenu: {
|
||||
type: OptionType.BOOLEAN,
|
||||
|
|
@ -89,6 +93,7 @@ export default definePlugin({
|
|||
},
|
||||
predicate: () => settings.store.noMirroredCamera
|
||||
},
|
||||
// Remove Activity Section above Member List
|
||||
{
|
||||
find: ".MEMBERLIST_CONTENT_FEED_TOGGLED,",
|
||||
predicate: () => settings.store.removeActivitySection,
|
||||
|
|
@ -97,6 +102,7 @@ export default definePlugin({
|
|||
replace: "true||$&"
|
||||
},
|
||||
},
|
||||
// Always show open legacy settings
|
||||
...[
|
||||
".DEVELOPER_SECTION,",
|
||||
'"LegacySettingsSidebarItem"'
|
||||
|
|
@ -117,5 +123,28 @@ export default definePlugin({
|
|||
<PluginCards message={props.message} />
|
||||
</>
|
||||
);
|
||||
},
|
||||
flux: {
|
||||
async CHANNEL_SELECT({ channelId }) {
|
||||
const isSupportChannel = SUPPORT_CHANNEL_IDS.includes(channelId);
|
||||
if (!isSupportChannel) return;
|
||||
|
||||
const selfId = UserStore.getCurrentUser()?.id;
|
||||
if (!selfId || isAnyPluginDev(selfId)) return;
|
||||
if (VC_SUPPORT_CHANNEL_IDS.includes(channelId) && !clicked) {
|
||||
return Alerts.show({
|
||||
title: "Vencord Support Channel Warning",
|
||||
body: "Before asking for help. Check updates and if this issue is actually caused by Equicord!",
|
||||
confirmText: "Equicord Support",
|
||||
onConfirm() {
|
||||
NavigationRouter.transitionTo(`/channels/${GUILD_ID}/${SUPPORT_CHANNEL_ID}`);
|
||||
},
|
||||
cancelText: "Okay continue",
|
||||
onCancel() {
|
||||
clicked = true;
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2024 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { isAnyPluginDev } from "@utils/misc";
|
||||
import definePlugin from "@utils/types";
|
||||
import { UserStore } from "@webpack/common";
|
||||
|
||||
export default definePlugin({
|
||||
name: "VCSupport",
|
||||
description: "Wumpus Dance + Support Warnings",
|
||||
authors: [Devs.thororen, EquicordDevs.coolesding],
|
||||
required: true,
|
||||
start() {
|
||||
const selfId = UserStore.getCurrentUser()?.id;
|
||||
if (isAnyPluginDev(selfId)) {
|
||||
Vencord.Settings.plugins.VCSupport.enabled = false;
|
||||
} else {
|
||||
Vencord.Settings.plugins.VCSupport.enabled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -29,7 +29,7 @@ import { Paragraph } from "@components/Paragraph";
|
|||
import { openSettingsTabModal, UpdaterTab } from "@components/settings";
|
||||
import { platformName } from "@equicordplugins/equicordHelper/utils";
|
||||
import { gitHash, gitHashShort } from "@shared/vencordUserAgent";
|
||||
import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, EQUIBOP_CONTRIB_ROLE_ID, EQUICORD_TEAM, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_CONTRIB_ROLE_ID, VC_DONOR_ROLE_ID, VC_GUILD_ID, VC_REGULAR_ROLE_ID, VC_SUPPORT_CHANNEL_IDS, VENCORD_CONTRIB_ROLE_ID } from "@utils/constants";
|
||||
import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, EQUIBOP_CONTRIB_ROLE_ID, EQUICORD_TEAM, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_CONTRIB_ROLE_ID, VC_DONOR_ROLE_ID, VC_GUILD_ID, VC_REGULAR_ROLE_ID, VENCORD_CONTRIB_ROLE_ID } from "@utils/constants";
|
||||
import { sendMessage } from "@utils/discord";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import { Margins } from "@utils/margins";
|
||||
|
|
@ -181,8 +181,6 @@ const settings = definePluginSettings({}).withPrivateSettings<{
|
|||
dismissedDevBuildWarning?: boolean;
|
||||
}>();
|
||||
|
||||
let clicked = false;
|
||||
|
||||
export default definePlugin({
|
||||
name: "SupportHelper",
|
||||
required: true,
|
||||
|
|
@ -227,31 +225,6 @@ export default definePlugin({
|
|||
|
||||
const selfId = UserStore.getCurrentUser()?.id;
|
||||
if (!selfId || isAnyPluginDev(selfId)) return;
|
||||
if (VC_SUPPORT_CHANNEL_IDS.includes(channelId) && Vencord.Plugins.isPluginEnabled("VCSupport") && !clicked) {
|
||||
return Alerts.show({
|
||||
title: "You are entering the support channel!",
|
||||
body: <div>
|
||||
<style>
|
||||
{'[class*="backdrop_"][style*="backdrop-filter"]{backdrop-filter:blur(16px) brightness(0.25) !important;}'}
|
||||
</style>
|
||||
<div style={{ display: "flex", justifyContent: "center", marginBottom: "1rem" }}>
|
||||
<img src="https://media.tenor.com/QtGqjwBpRzwAAAAi/wumpus-dancing.gif" />
|
||||
</div>
|
||||
<Paragraph>Before you ask for help,</Paragraph>
|
||||
<Paragraph>Check for updates and if this</Paragraph>
|
||||
<Paragraph>issue could be caused by Equicord!</Paragraph>
|
||||
</div>,
|
||||
confirmText: "Go to Equicord Support",
|
||||
onConfirm() {
|
||||
clicked = true;
|
||||
VencordNative.native.openExternal("https://equicord.org/discord");
|
||||
},
|
||||
cancelText: "Okay continue",
|
||||
onCancel() {
|
||||
clicked = true;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (!IS_UPDATER_DISABLED) {
|
||||
await checkForUpdatesOnce().catch(() => { });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue