mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-26 06:38:24 -04:00
Update To Devs and Badges Sys
This commit is contained in:
parent
e4425ca98f
commit
44109d9979
58 changed files with 295 additions and 240 deletions
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { addDecoration, removeDecoration } from "@api/MessageDecorations";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { isPluginDev } from "@utils/misc";
|
||||
import definePlugin from "@utils/types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
|
@ -46,6 +46,19 @@ function CheckBadge({ badge, author }: { badge: string; author: any; }): JSX.Ele
|
|||
))}
|
||||
</span>
|
||||
);
|
||||
case "EquicordDonor":
|
||||
return (
|
||||
<span style={{ order: settings.store.VencordDonorPosition }}>
|
||||
{badges.getEquicordDonorBadges(author.id)?.map((badge: any) => (
|
||||
<RoleIconComponent
|
||||
className={roleIconClassName}
|
||||
name={badge.description}
|
||||
size={20}
|
||||
src={badge.image}
|
||||
/>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
case "VencordContributer":
|
||||
return isPluginDev(author.id) ? (
|
||||
<span style={{ order: settings.store.VencordContributorPosition }}>
|
||||
|
@ -96,6 +109,7 @@ function ChatBadges({ author }: any) {
|
|||
return (
|
||||
<span style={{ display: "inline-flex", marginLeft: 2, verticalAlign: "top" }}>
|
||||
{settings.store.showVencordDonor && <CheckBadge badge={"VencordDonor"} author={author} />}
|
||||
{settings.store.showVencordDonor && <CheckBadge badge={"EquicordDonor"} author={author} />}
|
||||
{settings.store.showVencordContributor && <CheckBadge badge={"VencordContributer"} author={author} />}
|
||||
{settings.store.showDiscordProfile && <CheckBadge badge={"DiscordProfile"} author={author} />}
|
||||
{settings.store.showDiscordNitro && <CheckBadge badge={"DiscordNitro"} author={author} />}
|
||||
|
@ -105,7 +119,7 @@ function ChatBadges({ author }: any) {
|
|||
|
||||
export default definePlugin({
|
||||
name: "ShowBadgesInChat",
|
||||
authors: [Devs.Inbestigator, Devs.KrystalSkull],
|
||||
authors: [Devs.Inbestigator, EquicordDevs.KrystalSkull],
|
||||
description: "Shows the message author's badges beside their name in chat.",
|
||||
dependencies: ["MessageDecorationsAPI"],
|
||||
patches: [
|
||||
|
|
|
@ -23,6 +23,18 @@ const settings = definePluginSettings({
|
|||
hidden: true,
|
||||
default: 0
|
||||
},
|
||||
showEquicordDonor: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Enable to show Vencord donor badges in chat.",
|
||||
hidden: true,
|
||||
default: true
|
||||
},
|
||||
EquicordDonorPosition: {
|
||||
type: OptionType.NUMBER,
|
||||
description: "The position of the Vencord Donor badges.",
|
||||
hidden: true,
|
||||
default: 1
|
||||
},
|
||||
showVencordContributor: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Enable to show Vencord contributor badges in chat.",
|
||||
|
@ -33,7 +45,7 @@ const settings = definePluginSettings({
|
|||
type: OptionType.NUMBER,
|
||||
description: "The position of the Vencord Contributor badge.",
|
||||
hidden: true,
|
||||
default: 1
|
||||
default: 2
|
||||
},
|
||||
showDiscordProfile: {
|
||||
type: OptionType.BOOLEAN,
|
||||
|
@ -45,7 +57,7 @@ const settings = definePluginSettings({
|
|||
type: OptionType.NUMBER,
|
||||
description: "The position of the Discord profile badges.",
|
||||
hidden: true,
|
||||
default: 2
|
||||
default: 3
|
||||
},
|
||||
showDiscordNitro: {
|
||||
type: OptionType.BOOLEAN,
|
||||
|
@ -57,7 +69,7 @@ const settings = definePluginSettings({
|
|||
type: OptionType.NUMBER,
|
||||
description: "The position of the Discord Nitro badge.",
|
||||
hidden: true,
|
||||
default: 3
|
||||
default: 4
|
||||
},
|
||||
badgeSettings: {
|
||||
type: OptionType.COMPONENT,
|
||||
|
@ -71,6 +83,7 @@ export default settings;
|
|||
const BadgeSettings = () => {
|
||||
const [images, setImages] = useState([
|
||||
{ src: "https://cdn.discordapp.com/emojis/1026533070955872337.png", shown: settings.store.showVencordDonor, title: "Vencord donor badges", key: "VencordDonor", position: settings.store.VencordDonorPosition },
|
||||
{ src: "https://i.imgur.com/KsxHlbD.png", shown: settings.store.showEquicordDonor, title: "Equicord donor badges", key: "EquicordDonor", position: settings.store.EquicordDonorPosition },
|
||||
{ src: "https://i.imgur.com/OypoHrV.png", shown: settings.store.showVencordContributor, title: "Vencord/Equicord contributor badge", key: "VencordContributer", position: settings.store.VencordContributorPosition },
|
||||
{ src: "https://cdn.discordapp.com/badge-icons/bf01d1073931f921909045f3a39fd264.png", shown: settings.store.showDiscordProfile, title: "Discord profile badges (HypeSquad, Discord Staff, Active Developer, etc.)", key: "DiscordProfile", position: settings.store.DiscordProfilePosition },
|
||||
{ src: "https://cdn.discordapp.com/badge-icons/2ba85e8026a8614b640c2837bcdfe21b.png", shown: settings.store.showDiscordNitro, title: "Nitro badge", key: "DiscordNitro", position: settings.store.DiscordNitroPosition }
|
||||
|
@ -83,6 +96,10 @@ const BadgeSettings = () => {
|
|||
settings.store.VencordDonorPosition = image.position;
|
||||
settings.store.showVencordDonor = image.shown;
|
||||
break;
|
||||
case "EquiordDonor":
|
||||
settings.store.EquicordDonorPosition = image.position;
|
||||
settings.store.showEquicordDonor = image.shown;
|
||||
break;
|
||||
case "VencordContributer":
|
||||
settings.store.VencordContributorPosition = image.position;
|
||||
settings.store.showVencordContributor = image.shown;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue