{} convention, logs, exit and hook skeleton
This commit is contained in:
parent
fc53df5e4b
commit
7f5986aa01
|
@ -32,6 +32,8 @@ const _defaults = {
|
|||
class Core {
|
||||
|
||||
constructor(args) {
|
||||
this.continue = true;
|
||||
_logger.log(`v${this.__version} Loading - OS: ${_os.platform()}`);
|
||||
this.initConfig(args.cfg);
|
||||
}
|
||||
|
||||
|
@ -42,6 +44,24 @@ class Core {
|
|||
_cfg.emotesEnabled = args.emotesEnabled || _defaults.emotesEnabled;
|
||||
}
|
||||
|
||||
hook(mainWindow) {
|
||||
if(mainWindow === undefined) {
|
||||
this.exit("mainWindow is undefined!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
exit(reason, severity) {
|
||||
this.continue = false;
|
||||
// TODO show an actual error dialog for user
|
||||
_logger.log(`Quitting. Reason: ${reason}`, severity || 2);
|
||||
_logger.save();
|
||||
}
|
||||
|
||||
get __version() {
|
||||
return _config.core.version;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.BetterDiscord = new Core({ cfg: { } });
|
Loading…
Reference in New Issue