Finish Suncord Port Hopefully (Equicord)

This commit is contained in:
thororen1234 2024-07-02 18:07:51 -04:00
parent ef086cd1c4
commit 0ef25db8ed
13 changed files with 171 additions and 110 deletions

View file

@ -669,8 +669,47 @@ export const EquicordDevs = Object.freeze({
},
} satisfies Record<string, Dev>);
export const SuncordDevs = /* #__PURE__*/ Object.freeze({
nyx: {
name: "verticalsync",
id: 328165170536775680n,
},
bhop: {
name: "femeie",
id: 442626774841556992n,
},
Drag: {
name: "dragalt_",
id: 1189903210564038697n,
},
Woosh: {
name: "w00shh.",
id: 689165844835860522n,
},
Cortex: {
name: "Cortex",
id: 825069530376044594n,
},
thororen: {
name: "thororen",
id: 848339671629299742n,
},
nexpid: {
name: "Nexpid",
id: 853550207039832084n,
},
KrystalSkull: {
name: "krystalskullofficial",
id: 929208515883569182n,
},
SerStars: {
name: "SerStars",
id: 861631850681729045n,
},
} satisfies Record<string, Dev>);
// iife so #__PURE__ works correctly
export const DevsById = /* #__PURE__*/ (() =>
export const VencordDevsById = /* #__PURE__*/ (() =>
Object.freeze(Object.fromEntries(
Object.entries(Devs)
.filter(d => d[1].id !== 0n)
@ -685,3 +724,11 @@ export const EquicordDevsById = /* #__PURE__*/ (() =>
.map(([_, v]) => [v.id, v] as const)
))
)() as Record<string, Dev>;
export const SuncordDevsById = /* #__PURE__*/ (() =>
Object.freeze(Object.fromEntries(
Object.entries(SuncordDevs)
.filter(d => d[1].id !== 0n)
.map(([_, v]) => [v.id, v] as const)
))
)() as Record<string, Dev>;

View file

@ -18,7 +18,7 @@
import { Clipboard, Toasts } from "@webpack/common";
import { DevsById, EquicordDevsById } from "./constants";
import { EquicordDevsById, SuncordDevsById, VencordDevsById } from "./constants";
/**
* Calls .join(" ") on the arguments
@ -94,8 +94,9 @@ export function identity<T>(value: T): T {
// "In summary, we recommend looking for the string Mobi anywhere in the User Agent to detect a mobile device."
export const isMobile = navigator.userAgent.includes("Mobi");
export const isPluginDev = (id: string) => Object.hasOwn(DevsById, id);
export const isPluginDev = (id: string) => Object.hasOwn(VencordDevsById, id);
export const isEquicordPluginDev = (id: string) => Object.hasOwn(EquicordDevsById, id);
export const isSuncordPluginDev = (id: string) => Object.hasOwn(SuncordDevsById, id);
export function pluralise(amount: number, singular: string, plural = singular + "s") {
return amount === 1 ? `${amount} ${singular}` : `${amount} ${plural}`;