mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-22 21:07:00 -04:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
84f56a6d54
6 changed files with 46 additions and 35 deletions
|
@ -25,16 +25,16 @@ export interface ButtonAction {
|
|||
}
|
||||
|
||||
export const actions: ButtonAction[] = [
|
||||
{ id: "openSuncordSettings", label: "Open Suncord tab", callback: async () => await SettingsRouter.open("SuncordSettings"), registrar: "Suncord" },
|
||||
{ id: "openPluginSettings", label: "Open Plugin tab", callback: () => SettingsRouter.open("SuncordPlugins"), registrar: "Suncord" },
|
||||
{ id: "openThemesSettings", label: "Open Themes tab", callback: () => SettingsRouter.open("SuncordThemes"), registrar: "Suncord" },
|
||||
{ id: "openUpdaterSettings", label: "Open Updater tab", callback: () => SettingsRouter.open("SuncordUpdater"), registrar: "Suncord" },
|
||||
{ id: "openSuncordCloudSettings", label: "Open Cloud tab", callback: () => SettingsRouter.open("SuncordCloud"), registrar: "Suncord" },
|
||||
{ id: "openBackupSettings", label: "Open Backup & Restore tab", callback: () => SettingsRouter.open("SuncordSettingsSync"), registrar: "Suncord" },
|
||||
{ id: "restartClient", label: "Restart Client", callback: () => relaunch(), registrar: "Suncord" },
|
||||
{ id: "openQuickCSSFile", label: "Open Quick CSS File", callback: () => VencordNative.quickCss.openEditor(), registrar: "Suncord" },
|
||||
{ id: "openSettingsFolder", label: "Open Settings Folder", callback: async () => showItemInFolder(await VencordNative.settings.getSettingsDir()), registrar: "Suncord" },
|
||||
{ id: "openInGithub", label: "Open in Github", callback: async () => VencordNative.native.openExternal(await getRepo()), registrar: "Suncord" },
|
||||
{ id: "openEquicordSettings", label: "Open Equicord tab", callback: async () => await SettingsRouter.open("EquicordSettings"), registrar: "Equicord" },
|
||||
{ id: "openPluginSettings", label: "Open Plugin tab", callback: () => SettingsRouter.open("EquicordPlugins"), registrar: "Equicord" },
|
||||
{ id: "openThemesSettings", label: "Open Themes tab", callback: () => SettingsRouter.open("EquicordThemes"), registrar: "Equicord" },
|
||||
{ id: "openUpdaterSettings", label: "Open Updater tab", callback: () => SettingsRouter.open("EquicordUpdater"), registrar: "Equicord" },
|
||||
{ id: "openEquicordCloudSettings", label: "Open Cloud tab", callback: () => SettingsRouter.open("EquicordCloud"), registrar: "Equicord" },
|
||||
{ id: "openBackupSettings", label: "Open Backup & Restore tab", callback: () => SettingsRouter.open("EquicordSettingsSync"), registrar: "Equicord" },
|
||||
{ id: "restartClient", label: "Restart Client", callback: () => relaunch(), registrar: "Equicord" },
|
||||
{ id: "openQuickCSSFile", label: "Open Quick CSS File", callback: () => VencordNative.quickCss.openEditor(), registrar: "Equicord" },
|
||||
{ id: "openSettingsFolder", label: "Open Settings Folder", callback: async () => showItemInFolder(await VencordNative.settings.getSettingsDir()), registrar: "Equicord" },
|
||||
{ id: "openInGithub", label: "Open in Github", callback: async () => VencordNative.native.openExternal(await getRepo()), registrar: "Equicord" },
|
||||
|
||||
{
|
||||
id: "openInBrowser", label: "Open in Browser", callback: async () => {
|
||||
|
@ -54,7 +54,7 @@ export const actions: ButtonAction[] = [
|
|||
}
|
||||
});
|
||||
}
|
||||
}, registrar: "Suncord"
|
||||
}, registrar: "Equicord"
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ export const actions: ButtonAction[] = [
|
|||
if (choice && enabled) {
|
||||
return togglePlugin(choice, enabled.id === "enable");
|
||||
}
|
||||
}, registrar: "Suncord"
|
||||
}, registrar: "Equicord"
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ export const actions: ButtonAction[] = [
|
|||
}
|
||||
});
|
||||
}
|
||||
}, registrar: "Suncord"
|
||||
}, registrar: "Equicord"
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -125,7 +125,7 @@ export const actions: ButtonAction[] = [
|
|||
position: Toasts.Position.BOTTOM
|
||||
}
|
||||
});
|
||||
}, registrar: "Suncord"
|
||||
}, registrar: "Equicord"
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -134,12 +134,12 @@ export const actions: ButtonAction[] = [
|
|||
|
||||
if (isOutdated) {
|
||||
setTimeout(() => showNotification({
|
||||
title: "A Suncord update is available!",
|
||||
title: "A Equicord update is available!",
|
||||
body: "Click here to view the update",
|
||||
permanent: true,
|
||||
noPersist: true,
|
||||
onClick() {
|
||||
SettingsRouter.open("SuncordUpdater");
|
||||
SettingsRouter.open("EquicordUpdater");
|
||||
}
|
||||
}), 10_000);
|
||||
} else {
|
||||
|
@ -152,7 +152,7 @@ export const actions: ButtonAction[] = [
|
|||
}
|
||||
});
|
||||
}
|
||||
}, registrar: "Suncord"
|
||||
}, registrar: "Equicord"
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -172,7 +172,7 @@ export const actions: ButtonAction[] = [
|
|||
if (choice) {
|
||||
NavigationRouter.transitionToGuild(choice.id);
|
||||
}
|
||||
}, registrar: "Suncord"
|
||||
}, registrar: "Equicord"
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -94,14 +94,12 @@ export default definePlugin({
|
|||
start() {
|
||||
document.addEventListener("keydown", this.event);
|
||||
|
||||
if (IS_DEV) {
|
||||
registerAction({
|
||||
id: "openDevSettings",
|
||||
label: "Open Dev tab",
|
||||
callback: () => SettingsRouter.open("SuncordPatchHelper"),
|
||||
registrar: "Suncord"
|
||||
});
|
||||
}
|
||||
registerAction({
|
||||
id: "openDevSettings",
|
||||
label: "Open Dev tab",
|
||||
callback: () => SettingsRouter.open("EquicordPatchHelper"),
|
||||
registrar: "Equicord"
|
||||
});
|
||||
},
|
||||
|
||||
stop() {
|
||||
|
|
|
@ -83,7 +83,7 @@ function makeShortcuts() {
|
|||
wpsearch: search,
|
||||
wpex: extract,
|
||||
wpexs: (code: string) => extract(findModuleId(code)!),
|
||||
loadLazyChunks: IS_DEV ? loadLazyChunks : () => { throw new Error("loadLazyChunks is dev only."); },
|
||||
loadLazyChunks: loadLazyChunks,
|
||||
find,
|
||||
findAll: findAll,
|
||||
findByProps,
|
||||
|
|
|
@ -442,7 +442,7 @@ export default definePlugin({
|
|||
if (proto == null || typeof proto === "string") return;
|
||||
|
||||
// @ts-ignore
|
||||
const premiumType: number = user?._realPremiumType ?? UserStore?.getCurrentUser?._realPremiumType ?? user?.premium_type ?? UserStore?.getCurrentUser()?.premiumType ?? 0;
|
||||
const premiumType: number = user?._realPremiumType ?? user?.premium_type ?? UserStore?.getCurrentUser()?.premiumType ?? 0;
|
||||
|
||||
if (premiumType !== 2) {
|
||||
proto.appearance ??= AppearanceSettingsActionCreators.create();
|
||||
|
|
|
@ -6,17 +6,25 @@
|
|||
|
||||
import "./styles.css";
|
||||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { SelectedGuildStore, useState } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
export const settings = definePluginSettings({
|
||||
hideAtSymbol: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Whether the the @-symbol should be hidden.",
|
||||
default: true
|
||||
}
|
||||
});
|
||||
|
||||
export default definePlugin({
|
||||
name: "MentionAvatars",
|
||||
description: "Shows user avatars inside mentions",
|
||||
authors: [Devs.Ven],
|
||||
|
||||
authors: [Devs.Ven, Devs.Luna],
|
||||
patches: [{
|
||||
find: ".USER_MENTION)",
|
||||
replacement: {
|
||||
|
@ -24,12 +32,12 @@ export default definePlugin({
|
|||
replace: "children:$self.renderUsername({username:$1,user:$2})"
|
||||
}
|
||||
}],
|
||||
|
||||
settings,
|
||||
renderUsername: ErrorBoundary.wrap((props: { user: User, username: string; }) => {
|
||||
const { user, username } = props;
|
||||
const [isHovering, setIsHovering] = useState(false);
|
||||
|
||||
if (!user) return <>@{username}</>;
|
||||
if (!user) return <>{getUsernameString(username)}</>;
|
||||
|
||||
return (
|
||||
<span
|
||||
|
@ -37,8 +45,13 @@ export default definePlugin({
|
|||
onMouseLeave={() => setIsHovering(false)}
|
||||
>
|
||||
<img src={user.getAvatarURL(SelectedGuildStore.getGuildId(), 16, isHovering)} className="vc-mentionAvatars-avatar" />
|
||||
@{username}
|
||||
{getUsernameString(username)}
|
||||
</span>
|
||||
);
|
||||
}, { noop: true })
|
||||
});
|
||||
|
||||
function getUsernameString(username: string) {
|
||||
if (settings.store.hideAtSymbol) return username;
|
||||
return `@${username}`;
|
||||
}
|
||||
|
|
|
@ -307,7 +307,7 @@ export default definePlugin({
|
|||
]
|
||||
},
|
||||
{
|
||||
find: '+1]})},"overflow"))',
|
||||
find: '})},"overflow"))',
|
||||
replacement: [
|
||||
{
|
||||
// Create a variable for the channel prop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue