mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-24 05:47:00 -04:00
Updates
This commit is contained in:
parent
295a065721
commit
6dd85a104b
7 changed files with 13 additions and 105 deletions
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* Vencord, a modification for Discord's desktop app
|
||||
* Copyright (c) 2022 Vendicated and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { addContextMenuPatch, removeContextMenuPatch } from "@api/ContextMenu";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Clipboard, Menu, React } from "@webpack/common";
|
||||
|
||||
interface Emoji {
|
||||
type: "emoji",
|
||||
id: string,
|
||||
name: string;
|
||||
}
|
||||
|
||||
const settings = definePluginSettings({
|
||||
formattedString: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Use formatted string instead of emoji ID.",
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
export default definePlugin({
|
||||
name: "CopyEmojiID",
|
||||
description: "Adds button to copy emoji ID!",
|
||||
authors: [EquicordDevs.HAPPY_ENDERMAN, EquicordDevs.ANIKEIPS],
|
||||
settings,
|
||||
|
||||
expressionPickerPatch(children, props) {
|
||||
if (!children.find(element => element.props.id === "copy-emoji-id")) {
|
||||
const data = props.target.dataset as Emoji;
|
||||
const firstChild = props.target.firstChild as HTMLImageElement;
|
||||
const isAnimated = firstChild && new URL(firstChild.src).pathname.endsWith(".gif");
|
||||
if (data.type === "emoji" && data.id) {
|
||||
children.push((
|
||||
<Menu.MenuItem
|
||||
id="copy-emoji-id"
|
||||
key="copy-emoji-id"
|
||||
label={settings.store.formattedString ? "Copy as formatted string" : "Copy Emoji ID"}
|
||||
action={() => {
|
||||
const formatted_emoji_string = settings.store.formattedString ? `${isAnimated ? "<a:" : "<:"}${data.name}:${data.id}>` : `${data.id}`;
|
||||
Clipboard.copy(formatted_emoji_string);
|
||||
}}
|
||||
/>
|
||||
));
|
||||
}
|
||||
}
|
||||
},
|
||||
start() {
|
||||
addContextMenuPatch("expression-picker", this.expressionPickerPatch);
|
||||
},
|
||||
stop() {
|
||||
removeContextMenuPatch("expression-picker", this.expressionPickerPatch);
|
||||
}
|
||||
});
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
import { Link } from "@components/Link";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { localStorage } from "@utils/localStorage";
|
||||
import { closeAllModals, openModal } from "@utils/modal";
|
||||
import definePlugin from "@utils/types";
|
||||
|
@ -51,7 +51,7 @@ function removeAppIcon() {
|
|||
export default definePlugin({
|
||||
name: "CustomAppIcons",
|
||||
description: "Add/upload custom (In-)App Icons.",
|
||||
authors: [EquicordDevs.HAPPY_ENDERMAN, EquicordDevs.SerStars],
|
||||
authors: [Devs.HappyEnderman, EquicordDevs.SerStars],
|
||||
patches: [
|
||||
{
|
||||
find: ".PremiumUpsellTypes.APP_ICON_UPSELL",
|
||||
|
@ -100,12 +100,12 @@ export default definePlugin({
|
|||
<><Forms.FormTitle>
|
||||
<Forms.FormTitle>How to use?</Forms.FormTitle>
|
||||
</Forms.FormTitle>
|
||||
<Forms.FormText>
|
||||
<Forms.FormText>Go to <Link href="/settings/appearance" onClick={e => { e.preventDefault(); closeAllModals(); FluxDispatcher.dispatch({ type: "USER_SETTINGS_MODAL_SET_SECTION", section: "Appearance" }); }}>Appearance Settings</Link> tab.</Forms.FormText>
|
||||
<Forms.FormText>Scroll down to "In-app Icons" and click on "Preview App Icon".</Forms.FormText>
|
||||
<Forms.FormText>And upload your own custom icon!</Forms.FormText>
|
||||
<Forms.FormText>You can only use links when you are uploading your Custom Icon.</Forms.FormText>
|
||||
</Forms.FormText></>
|
||||
<Forms.FormText>
|
||||
<Forms.FormText>Go to <Link href="/settings/appearance" onClick={e => { e.preventDefault(); closeAllModals(); FluxDispatcher.dispatch({ type: "USER_SETTINGS_MODAL_SET_SECTION", section: "Appearance" }); }}>Appearance Settings</Link> tab.</Forms.FormText>
|
||||
<Forms.FormText>Scroll down to "In-app Icons" and click on "Preview App Icon".</Forms.FormText>
|
||||
<Forms.FormText>And upload your own custom icon!</Forms.FormText>
|
||||
<Forms.FormText>You can only use links when you are uploading your Custom Icon.</Forms.FormText>
|
||||
</Forms.FormText></>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,11 +25,7 @@ const Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild;
|
|||
export default definePlugin({
|
||||
name: "emojiDumper",
|
||||
description: "Context menu to dump and download a server's emojis.",
|
||||
authors: [
|
||||
EquicordDevs.Cortex,
|
||||
Devs.Samwich,
|
||||
EquicordDevs.Woosh,
|
||||
],
|
||||
authors: [EquicordDevs.Cortex, Devs.Samwich, EquicordDevs.Woosh],
|
||||
start() {
|
||||
addContextMenuPatch(["guild-context", "guild-header-popout"], Patch);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue