mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[GM > Plugin] Initial Add
This commit is contained in:
parent
0d68aa88c2
commit
8b347972ac
2 changed files with 33 additions and 0 deletions
32
moduleWrappers/goosemod/plugin.js
Normal file
32
moduleWrappers/goosemod/plugin.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
import showToast from '@goosemod/toast';
|
||||
|
||||
export default class Plugin {
|
||||
constructor() {
|
||||
this.patches = [];
|
||||
}
|
||||
|
||||
enqueueUnpatch(unpatch) {
|
||||
this.patches.push(unpatch);
|
||||
}
|
||||
|
||||
toast(content, options) {
|
||||
showToast(content, {
|
||||
subtext: this.name,
|
||||
...options
|
||||
});
|
||||
}
|
||||
|
||||
goosemodHandlers = {
|
||||
onImport() {
|
||||
this.onImport();
|
||||
},
|
||||
|
||||
onRemove() {
|
||||
for (const unpatch of this.patches) {
|
||||
unpatch();
|
||||
}
|
||||
|
||||
this.onRemove();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,6 +38,7 @@
|
|||
"@goosemod/reactUtils": "./moduleWrappers/goosemod/reactUtils.js",
|
||||
"@goosemod/toast": "./moduleWrappers/goosemod/toast.js",
|
||||
"@goosemod/settings": "./moduleWrappers/goosemod/settings.js",
|
||||
"@goosemod/plugin": "./moduleWrappers/goosemod/plugin.js",
|
||||
|
||||
"powercord/entities": "./moduleWrappers/powercord/entities.js",
|
||||
"powercord/injector": "./moduleWrappers/powercord/injector.js",
|
||||
|
|
Loading…
Reference in a new issue