diff options
author | Vendicated <vendicated@riseup.net> | 2022-08-30 01:42:47 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-08-30 01:42:47 +0200 |
commit | cb288e204dd531b31f957f82150398d22930fdeb (patch) | |
tree | b8bb039982c3fee10e62e4767ce0f88748f50d25 /src/plugins | |
parent | 80b279d3c311e60787aa46a150b2d87e8ebaf69a (diff) | |
download | Vencord-cb288e204dd531b31f957f82150398d22930fdeb.tar.gz Vencord-cb288e204dd531b31f957f82150398d22930fdeb.tar.bz2 Vencord-cb288e204dd531b31f957f82150398d22930fdeb.zip |
Add Settings 'page', gitHash, electron version in settings
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/clientInfo.ts | 17 | ||||
-rw-r--r-- | src/plugins/settings.ts | 39 |
2 files changed, 39 insertions, 17 deletions
diff --git a/src/plugins/clientInfo.ts b/src/plugins/clientInfo.ts deleted file mode 100644 index 77cc70c..0000000 --- a/src/plugins/clientInfo.ts +++ /dev/null @@ -1,17 +0,0 @@ -import definePlugin from "../utils/types"; - -export default definePlugin({ - name: "ClientInfo", - description: "Adds extra info to Client Info in settings", - author: "Vendicated", - patches: [{ - find: "default.versionHash", - replacement: { - match: /\w\.createElement.+?["']Host ["'].+?\):null/, - replace: m => { - const idx = m.indexOf("Host") - 1; - return `${m},${m.slice(0, idx)}"Vencord ".repeat(50),"1.0.0")," ")`; - } - } - }] -});
\ No newline at end of file diff --git a/src/plugins/settings.ts b/src/plugins/settings.ts new file mode 100644 index 0000000..fa214f0 --- /dev/null +++ b/src/plugins/settings.ts @@ -0,0 +1,39 @@ +import definePlugin from "../utils/types"; +import gitHash from "git-hash"; + +export default definePlugin({ + name: "Settings", + description: "Adds Settings UI and debug info", + author: "Vendicated", + patches: [{ + find: "default.versionHash", + replacement: [ + { + match: /return .{1,2}\("div"/, + replace: (m) => { + return `var versions=VencordNative.getVersions();${m}`; + } + }, + { + match: /\w\.createElement.+?["']Host ["'].+?\):null/, + replace: m => { + const idx = m.indexOf("Host") - 1; + const template = m.slice(0, idx); + return `${m}, ${template}"Vencord ", "${gitHash}"), " "), ` + + `${template} "Electron ", versions.electron), " "), ` + + `${template} "Chrome ", versions.chrome), " ")`; + } + } + ] + }, { + find: "Messages.ACTIVITY_SETTINGS", + replacement: { + match: /\{section:(.{1,2})\.SectionTypes\.HEADER,label:(.{1,2})\.default\.Messages\.ACTIVITY_SETTINGS\}/, + replace: (m, mod) => + `{section:${mod}.SectionTypes.HEADER,label:"Vencord"},` + + `{section:"Vencord",label:"Vencord",element:Vencord.Components.Settings},` + + `{section:${mod}.SectionTypes.DIVIDER},${m}` + + } + }] +});
\ No newline at end of file |