Merge pull request #5 from JsSucks/master
Global changes to plugin-manager
This commit is contained in:
commit
7fd368f936
File diff suppressed because it is too large
Load Diff
|
@ -10,12 +10,11 @@
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { Logger, Utils, PluginManager, BDIpc, WebpackModules, SocketProxy, Global } = require('./modules');
|
const { Global, Logger, Utils, PluginManager, BDIpc, WebpackModules, SocketProxy } = require('./modules');
|
||||||
|
|
||||||
class BetterDiscord {
|
class BetterDiscord {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
Global.first();
|
|
||||||
window.bdUtils = Utils;
|
window.bdUtils = Utils;
|
||||||
window.wpm = WebpackModules;
|
window.wpm = WebpackModules;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,9 +10,15 @@
|
||||||
|
|
||||||
const { Module } = require('./modulebase');
|
const { Module } = require('./modulebase');
|
||||||
const { Events } = require('./events');
|
const { Events } = require('./events');
|
||||||
|
const { BDIpc } = require('./bdipc');
|
||||||
|
|
||||||
class Global extends Module {
|
class Global extends Module {
|
||||||
|
|
||||||
|
constructor(args) {
|
||||||
|
super(args);
|
||||||
|
this.first();
|
||||||
|
}
|
||||||
|
|
||||||
bindings() {
|
bindings() {
|
||||||
this.first = this.first.bind(this);
|
this.first = this.first.bind(this);
|
||||||
this.setWS = this.setWS.bind(this);
|
this.setWS = this.setWS.bind(this);
|
||||||
|
@ -20,6 +26,11 @@ class Global extends Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
first() {
|
first() {
|
||||||
|
(async () => {
|
||||||
|
const config = await BDIpc.send('getConfig');
|
||||||
|
this.setState(config);
|
||||||
|
})();
|
||||||
|
|
||||||
if (window.__bd) {
|
if (window.__bd) {
|
||||||
this.setState(window.__bd);
|
this.setState(window.__bd);
|
||||||
window.__bd = {
|
window.__bd = {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
export { Global } from './global';
|
||||||
export { Logger, Utils, FileUtils } from './utils';
|
export { Logger, Utils, FileUtils } from './utils';
|
||||||
export { PluginManager } from './pluginmanager';
|
export { PluginManager } from './pluginmanager';
|
||||||
export { Pluging } from './plugin';
|
export { Pluging } from './plugin';
|
||||||
export { BDIpc } from './bdipc';
|
export { BDIpc } from './bdipc';
|
||||||
export { WebpackModules } from './webpackmodules';
|
export { WebpackModules } from './webpackmodules';
|
||||||
export { Global } from './global';
|
|
||||||
export { Events } from './events';
|
export { Events } from './events';
|
||||||
export { SocketProxy } from './discordsocket';
|
export { SocketProxy } from './discordsocket';
|
|
@ -31,9 +31,9 @@ const Common = {};
|
||||||
const dummyArgs = {
|
const dummyArgs = {
|
||||||
'version': '0.3.1',
|
'version': '0.3.1',
|
||||||
'paths': [
|
'paths': [
|
||||||
{ 'base': 'basePath' },
|
{ 'id': 'base', 'path': 'basePath' },
|
||||||
{ 'plugins': __pluginPath },
|
{ 'id': 'plugins', 'path': __pluginPath },
|
||||||
{ 'themes': __themePath }
|
{ 'id': 'themes', 'path': __themePath }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue