2022-08-29 19:42:47 -04:00
|
|
|
import definePlugin from "../utils/types";
|
|
|
|
import gitHash from "git-hash";
|
2022-09-30 20:27:28 -04:00
|
|
|
import { Devs } from '../utils/constants';
|
2022-08-29 19:42:47 -04:00
|
|
|
|
|
|
|
export default definePlugin({
|
|
|
|
name: "Settings",
|
|
|
|
description: "Adds Settings UI and debug info",
|
2022-09-30 20:27:28 -04:00
|
|
|
authors: [Devs.Ven],
|
2022-08-30 22:07:16 -04:00
|
|
|
required: true,
|
2022-08-29 19:42:47 -04:00
|
|
|
patches: [{
|
2022-09-27 08:34:57 -04:00
|
|
|
find: "().versionHash",
|
2022-08-29 19:42:47 -04:00
|
|
|
replacement: [
|
|
|
|
{
|
2022-09-27 08:34:57 -04:00
|
|
|
match: /\w\.createElement\(.{1,2}.Fragment,.{0,30}\{[^}]+\},"Host ".+?\):null/,
|
2022-08-29 19:42:47 -04:00
|
|
|
replace: m => {
|
|
|
|
const idx = m.indexOf("Host") - 1;
|
|
|
|
const template = m.slice(0, idx);
|
|
|
|
return `${m}, ${template}"Vencord ", "${gitHash}"), " "), ` +
|
2022-09-27 08:34:57 -04:00
|
|
|
`${template} "Electron ",VencordNative.getVersions().electron)," "), ` +
|
|
|
|
`${template} "Chrome ",VencordNative.getVersions().chrome)," ")`;
|
2022-08-29 19:42:47 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}, {
|
|
|
|
find: "Messages.ACTIVITY_SETTINGS",
|
|
|
|
replacement: {
|
2022-09-27 08:34:57 -04:00
|
|
|
match: /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/,
|
2022-08-29 19:42:47 -04:00
|
|
|
replace: (m, mod) =>
|
2022-09-27 08:34:57 -04:00
|
|
|
`{section:${mod}.ID.HEADER,label:"Vencord"},` +
|
2022-08-29 19:42:47 -04:00
|
|
|
`{section:"Vencord",label:"Vencord",element:Vencord.Components.Settings},` +
|
2022-09-27 08:34:57 -04:00
|
|
|
`{section:${mod}.ID.DIVIDER},${m}`
|
2022-08-29 19:42:47 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
}]
|
2022-09-16 16:59:34 -04:00
|
|
|
});
|