mirror of
https://github.com/rastapasta/mapscii.git
synced 2024-11-21 23:53:08 +01:00
Use async to simplify Mapscii.init()
This commit is contained in:
parent
cdb0f45c75
commit
926a6d0bcc
@ -43,18 +43,15 @@ class Mapscii {
|
|||||||
config = Object.assign(config, options);
|
config = Object.assign(config, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
async init() {
|
||||||
return new Promise((resolve) => {
|
if (!config.headless) {
|
||||||
if (!config.headless) {
|
this._initKeyboard();
|
||||||
this._initKeyboard();
|
this._initMouse();
|
||||||
this._initMouse();
|
}
|
||||||
}
|
this._initTileSource();
|
||||||
this._initTileSource();
|
this._initRenderer();
|
||||||
this._initRenderer();
|
this._draw();
|
||||||
this._draw();
|
this.notify('Welcome to MapSCII! Use your cursors to navigate, a/z to zoom, q to quit.');
|
||||||
this.notify('Welcome to MapSCII! Use your cursors to navigate, a/z to zoom, q to quit.');
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user