support for stuff
This commit is contained in:
parent
f38230b26d
commit
d79f28b929
2 changed files with 44 additions and 3 deletions
22
dist/pupu.js
vendored
22
dist/pupu.js
vendored
|
|
@ -3586,6 +3586,8 @@
|
|||
function isThemeSupported() {
|
||||
if (isPyonLoader()) {
|
||||
return pyonLoaderIdentity.hasThemeSupport;
|
||||
} else if (isPupuLoader()) {
|
||||
return pupuLoaderIdentity.hasThemeSupport;
|
||||
} else if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity.features.themes != null;
|
||||
}
|
||||
|
|
@ -3594,6 +3596,8 @@
|
|||
function getStoredTheme() {
|
||||
if (isPyonLoader()) {
|
||||
return pyonLoaderIdentity.storedTheme;
|
||||
} else if (isPupuLoader()) {
|
||||
return pupuLoaderIdentity.storedTheme;
|
||||
} else if (isVendettaLoader()) {
|
||||
var themeProp = vendettaLoaderIdentity.features.themes?.prop;
|
||||
if (!themeProp)
|
||||
|
|
@ -3605,6 +3609,9 @@
|
|||
function getThemeFilePath() {
|
||||
if (isPyonLoader()) {
|
||||
return "pyoncord/current-theme.json";
|
||||
}
|
||||
if (isPupuLoader()) {
|
||||
return "pyoncord/current-theme.json";
|
||||
} else if (isVendettaLoader()) {
|
||||
return "vendetta_theme.json";
|
||||
}
|
||||
|
|
@ -3626,6 +3633,10 @@
|
|||
window.__pyoncord_rdt = window.__reactDevTools.exports;
|
||||
return "__pyoncord_rdt";
|
||||
}
|
||||
if (isPupuLoader()) {
|
||||
window.__pyoncord_rdt = window.__reactDevTools.exports;
|
||||
return "__pyoncord_rdt";
|
||||
}
|
||||
if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity.features.devtools.prop;
|
||||
}
|
||||
|
|
@ -3637,6 +3648,9 @@
|
|||
if (isPyonLoader()) {
|
||||
return window.__reactDevTools.version || null;
|
||||
}
|
||||
if (isPupuLoader()) {
|
||||
return window.__reactDevTools.version || null;
|
||||
}
|
||||
if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity.features.devtools.version;
|
||||
}
|
||||
|
|
@ -3645,6 +3659,8 @@
|
|||
function isSysColorsSupported() {
|
||||
if (isPyonLoader())
|
||||
return pyonLoaderIdentity.isSysColorsSupported;
|
||||
if (isPupuLoader())
|
||||
return pupuLoaderIdentity.isSysColorsSupported;
|
||||
else if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity.features.syscolors != null;
|
||||
}
|
||||
|
|
@ -3655,6 +3671,9 @@
|
|||
return null;
|
||||
if (isPyonLoader()) {
|
||||
return pyonLoaderIdentity.sysColors;
|
||||
}
|
||||
if (isPupuLoader()) {
|
||||
return pupuLoaderIdentity.sysColors;
|
||||
} else if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity.features.syscolors.prop;
|
||||
}
|
||||
|
|
@ -3673,13 +3692,14 @@
|
|||
return pyonLoaderIdentity.fontPatch === 2;
|
||||
return false;
|
||||
}
|
||||
var pyonLoaderIdentity, vendettaLoaderIdentity;
|
||||
var pyonLoaderIdentity, pupuLoaderIdentity, vendettaLoaderIdentity;
|
||||
var init_loader = __esm({
|
||||
"src/lib/api/native/loader.ts"() {
|
||||
"use strict";
|
||||
init_asyncIteratorSymbol();
|
||||
init_promiseAllSettled();
|
||||
pyonLoaderIdentity = globalThis.__PYON_LOADER__;
|
||||
pupuLoaderIdentity = globalThis.__PYON_LOADER__;
|
||||
vendettaLoaderIdentity = globalThis.__vendetta_loader;
|
||||
getVendettaLoaderIdentity();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import { VdThemeInfo } from "@lib/addons/themes";
|
|||
// @ts-ignore
|
||||
const pyonLoaderIdentity = globalThis.__PYON_LOADER__;
|
||||
// @ts-ignore
|
||||
const pupuLoaderIdentity = globalThis.__PYON_LOADER__;
|
||||
// @ts-ignore
|
||||
const vendettaLoaderIdentity = globalThis.__vendetta_loader;
|
||||
|
||||
export interface VendettaLoaderIdentity {
|
||||
|
|
@ -36,8 +38,8 @@ function polyfillVendettaLoaderIdentity() {
|
|||
|
||||
const loader = {
|
||||
name: pyonLoaderIdentity.loaderName,
|
||||
features: {} as Record<string, any>
|
||||
};
|
||||
features: {} as Record<string, any>,
|
||||
}
|
||||
|
||||
if (isLoaderConfigSupported()) loader.features.loaderConfig = true;
|
||||
if (isSysColorsSupported()) {
|
||||
|
|
@ -80,6 +82,8 @@ function polyfillVendettaLoaderIdentity() {
|
|||
export function getLoaderIdentity() {
|
||||
if (isPyonLoader()) {
|
||||
return pyonLoaderIdentity;
|
||||
} else if (isPupuLoader()) {
|
||||
return pupuLoaderIdentity();
|
||||
} else if (isVendettaLoader()) {
|
||||
return getVendettaLoaderIdentity();
|
||||
}
|
||||
|
|
@ -122,6 +126,8 @@ export function isLoaderConfigSupported() {
|
|||
export function isThemeSupported() {
|
||||
if (isPyonLoader()) {
|
||||
return pyonLoaderIdentity.hasThemeSupport;
|
||||
} else if (isPupuLoader()) {
|
||||
return pupuLoaderIdentity.hasThemeSupport;
|
||||
} else if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity!!.features.themes != null;
|
||||
}
|
||||
|
|
@ -132,6 +138,8 @@ export function isThemeSupported() {
|
|||
export function getStoredTheme(): VdThemeInfo | null {
|
||||
if (isPyonLoader()) {
|
||||
return pyonLoaderIdentity.storedTheme;
|
||||
} else if (isPupuLoader()) {
|
||||
return pupuLoaderIdentity.storedTheme;
|
||||
} else if (isVendettaLoader()) {
|
||||
const themeProp = vendettaLoaderIdentity!!.features.themes?.prop;
|
||||
if (!themeProp) return null;
|
||||
|
|
@ -145,6 +153,8 @@ export function getStoredTheme(): VdThemeInfo | null {
|
|||
export function getThemeFilePath() {
|
||||
if (isPyonLoader()) {
|
||||
return "pyoncord/current-theme.json";
|
||||
} if (isPupuLoader()) {
|
||||
return "pyoncord/current-theme.json";
|
||||
} else if (isVendettaLoader()) {
|
||||
return "vendetta_theme.json";
|
||||
}
|
||||
|
|
@ -171,6 +181,11 @@ export function getReactDevToolsProp(): string | null {
|
|||
return "__pyoncord_rdt";
|
||||
}
|
||||
|
||||
if (isPupuLoader()) {
|
||||
window.__pyoncord_rdt = window.__reactDevTools.exports;
|
||||
return "__pyoncord_rdt";
|
||||
}
|
||||
|
||||
if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity!!.features.devtools!!.prop;
|
||||
}
|
||||
|
|
@ -184,6 +199,9 @@ export function getReactDevToolsVersion() {
|
|||
if (isPyonLoader()) {
|
||||
return window.__reactDevTools.version || null;
|
||||
}
|
||||
if (isPupuLoader()) {
|
||||
return window.__reactDevTools.version || null;
|
||||
}
|
||||
if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity!!.features.devtools!!.version;
|
||||
}
|
||||
|
|
@ -193,6 +211,7 @@ export function getReactDevToolsVersion() {
|
|||
|
||||
export function isSysColorsSupported() {
|
||||
if (isPyonLoader()) return pyonLoaderIdentity.isSysColorsSupported;
|
||||
if (isPupuLoader()) return pupuLoaderIdentity.isSysColorsSupported;
|
||||
else if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity!!.features.syscolors != null;
|
||||
}
|
||||
|
|
@ -204,6 +223,8 @@ export function getSysColors() {
|
|||
if (!isSysColorsSupported()) return null;
|
||||
if (isPyonLoader()) {
|
||||
return pyonLoaderIdentity.sysColors;
|
||||
} if (isPupuLoader()) {
|
||||
return pupuLoaderIdentity.sysColors;
|
||||
} else if (isVendettaLoader()) {
|
||||
return vendettaLoaderIdentity!!.features.syscolors!!.prop;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue