Merge pull request #58 from rastapasta/unhandled-mapscii-init

Unhandled mapscii init
pull/12/head
Christian Paul 2018-11-19 00:41:06 -08:00 zatwierdzone przez GitHub
commit cf4731682e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 13 dodań i 13 usunięć

Wyświetl plik

@ -11,4 +11,7 @@
const Mapscii = require('./src/Mapscii');
const mapscii = new Mapscii();
mapscii.init();
mapscii.init().catch((err) => {
console.error('Failed to start MapSCII.');
console.error(err);
});

Wyświetl plik

@ -43,18 +43,15 @@ class Mapscii {
config = Object.assign(config, options);
}
init() {
return new Promise((resolve) => {
if (!config.headless) {
this._initKeyboard();
this._initMouse();
}
this._initTileSource();
this._initRenderer();
this._draw();
this.notify('Welcome to MapSCII! Use your cursors to navigate, a/z to zoom, q to quit.');
resolve();
});
async init() {
if (!config.headless) {
this._initKeyboard();
this._initMouse();
}
this._initTileSource();
this._initRenderer();
this._draw();
this.notify('Welcome to MapSCII! Use your cursors to navigate, a/z to zoom, q to quit.');
}