Skip to content

Commit b1978db

Browse files
committed
simplify
1 parent 126aa1e commit b1978db

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/DisplayListWatcher.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
2828
}
2929

3030
boot() {
31-
console.debug('boot', this.systems.settings.key)
31+
const { cache, events, settings, textures } = this.systems
3232

33-
const { textures } = this.systems
33+
console.debug('boot', settings.key)
3434

3535
if (!hasPendingFontImage && !textures.exists(fontTextureKey)) {
3636
hasPendingFontImage = true
@@ -43,27 +43,22 @@ export class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
4343
textures.once(`${TextureEvents.ADD_KEY}${fontTextureKey}`, () => {
4444
console.debug('add bitmapFont', fontKey, fontData)
4545

46-
this.systems.cache.bitmapFont.add(
47-
fontKey,
48-
ParseRetroFont(this.scene, fontData)
49-
)
46+
cache.bitmapFont.add(fontKey, ParseRetroFont(this.scene, fontData))
5047
})
5148

52-
if (this.systems.settings.key === '__SYSTEM') {
49+
if (settings.key === '__SYSTEM') {
5350
console.debug('leave system scene')
5451

5552
return
5653
}
5754

58-
const events = this.systems.events
59-
6055
events.on(SceneEvents.START, this.start, this)
6156
events.on(SceneEvents.SHUTDOWN, this.stop, this)
6257
events.on(SceneEvents.DESTROY, this.destroy, this)
6358

64-
console.debug('isBooted', this.systems.settings.isBooted)
59+
console.debug('isBooted', settings.isBooted)
6560

66-
if (this.systems.settings.isBooted) {
61+
if (settings.isBooted) {
6762
this.start()
6863
}
6964
}

0 commit comments

Comments
 (0)