2018-02-13 23:10:22 +01:00
|
|
|
/**
|
|
|
|
* BetterDiscord External Module Manager Module
|
|
|
|
* Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks
|
|
|
|
* All rights reserved.
|
|
|
|
* https://betterdiscord.net
|
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import ContentManager from './contentmanager';
|
|
|
|
import ExtModule from './extmodule';
|
|
|
|
|
|
|
|
export default class extends ContentManager {
|
|
|
|
|
2018-02-13 23:14:26 +01:00
|
|
|
static get localModules() {
|
|
|
|
return this.localContent;
|
|
|
|
}
|
|
|
|
|
|
|
|
static get contentType() {
|
|
|
|
return 'module';
|
|
|
|
}
|
|
|
|
|
|
|
|
static get moduleName() {
|
|
|
|
return 'Ext Module Manager';
|
|
|
|
}
|
|
|
|
|
|
|
|
static get pathId() {
|
|
|
|
return 'modules';
|
|
|
|
}
|
|
|
|
|
|
|
|
static get loadAllModules() {
|
|
|
|
return this.loadAllContent;
|
|
|
|
}
|
|
|
|
|
|
|
|
static get refreshModules() { return this.refreshContent }
|
|
|
|
|
|
|
|
static get loadContent() { return this.loadModule }
|
2018-02-14 00:23:52 +01:00
|
|
|
static async loadModule(paths, configs, info, main) {
|
2018-02-21 18:46:27 +01:00
|
|
|
return new ExtModule({
|
|
|
|
configs, info, main,
|
|
|
|
paths: {
|
|
|
|
contentPath: paths.contentPath,
|
|
|
|
dirName: paths.dirName,
|
|
|
|
mainPath: paths.mainPath
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static get isExtModule() { return this.isThisContent }
|
|
|
|
static isThisContent(module) {
|
|
|
|
return module instanceof ExtModule;
|
2018-02-13 23:14:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static get findModule() { return this.findContent }
|
|
|
|
static get getModuleIndex() { return this.getContentIndex }
|
|
|
|
static get getModuleByName() { return this.getContentByName }
|
|
|
|
static get getModuleById() { return this.getContentById }
|
|
|
|
static get getModuleByPath() { return this.getContentByPath }
|
|
|
|
static get getModuleByDirName() { return this.getContentByDirName }
|
|
|
|
|
2018-02-13 23:10:22 +01:00
|
|
|
}
|