This repository has been archived by the owner on May 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.js
50 lines (44 loc) · 1.51 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const { Plugin } = require('powercord/entities');
const { uninject } = require('powercord/injector');
const Settings = require('./components/SettingsRender.jsx');
const settingsStructure = require('./structures/settings');
const i18n = require('./i18n');
const ChangeLog = require('./modules/ChangeLog');
const Patcher = require('./modules/Patcher/General');
const output = require('./modules/OutputManager');
const changelog = require('./changelog.json');
// noinspection JSUnusedGlobalSymbols
module.exports = class ImageTools extends Plugin {
constructor () {
super();
this.Patcher = new Patcher(this.settings);
this.ChangeLog = new ChangeLog({
config: changelog,
currentVer: this.manifest.version,
lastCheckedVer: this.settings.get('lastChangeLogVersion', '0'),
updateLastCheckedVer: (v) => this.settings.set('lastChangeLogVersion', v)
});
output.setStartId('ImageToolsMsg');
}
async startPlugin () {
powercord.api.i18n.loadAllStrings(i18n);
this.loadStylesheet('style.scss');
Settings.register({
entityID: this.entityID,
items: settingsStructure
});
this.Patcher.inject();
this.ChangeLog.init();
}
pluginWillUnload () {
this.Patcher.uninject();
uninject('image-tools-overlay-ui');
uninject('image-tools-overlay-backdrop');
uninject('image-tools-overlay-modal-layer');
uninject('image-tools-overlay-video');
powercord.api.settings.unregisterSettings('image-tools-settings');
}
get color () {
return '#1D69E4';
}
};