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