Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
samme committed Dec 22, 2024
1 parent 3f4b0d6 commit 172885e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
13 changes: 6 additions & 7 deletions dist/display-list-watcher.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,23 @@ class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
this.toggleKey = null;
}
boot() {
const { textures } = this.systems;
const { cache, events, settings, textures } = this.systems;
if (!hasPendingFontImage && !textures.exists(fontTextureKey)) {
hasPendingFontImage = true;
textures.addBase64(fontKey, fontImage);
}
textures.once(`${TextureEvents.ADD_KEY}${fontTextureKey}`, () => {
this.systems.cache.bitmapFont.add(
fontKey,
ParseRetroFont(this.scene, fontData)
);
cache.bitmapFont.add(fontKey, ParseRetroFont(this.scene, fontData));
});
if (this.systems.settings.key === "__SYSTEM") {
if (settings.key === "__SYSTEM") {
return;
}
const events = this.systems.events;
events.on(SceneEvents.START, this.start, this);
events.on(SceneEvents.SHUTDOWN, this.stop, this);
events.on(SceneEvents.DESTROY, this.destroy, this);
if (settings.isBooted) {
this.start();
}
}
startIfFontWasAdded(cache, key) {
if (key !== fontKey) {
Expand Down
13 changes: 6 additions & 7 deletions dist/display-list-watcher.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,23 @@
this.toggleKey = null;
}
boot() {
const { textures } = this.systems;
const { cache, events, settings, textures } = this.systems;
if (!hasPendingFontImage && !textures.exists(fontTextureKey)) {
hasPendingFontImage = true;
textures.addBase64(fontKey, fontImage);
}
textures.once(`${TextureEvents.ADD_KEY}${fontTextureKey}`, () => {
this.systems.cache.bitmapFont.add(
fontKey,
ParseRetroFont(this.scene, fontData)
);
cache.bitmapFont.add(fontKey, ParseRetroFont(this.scene, fontData));
});
if (this.systems.settings.key === "__SYSTEM") {
if (settings.key === "__SYSTEM") {
return;
}
const events = this.systems.events;
events.on(SceneEvents.START, this.start, this);
events.on(SceneEvents.SHUTDOWN, this.stop, this);
events.on(SceneEvents.DESTROY, this.destroy, this);
if (settings.isBooted) {
this.start();
}
}
startIfFontWasAdded(cache, key) {
if (key !== fontKey) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phaser-plugin-display-list-watcher",
"version": "1.0.0",
"version": "1.0.1",
"description": "Shows the scene display lists",
"keywords": [
"phaser",
Expand Down

0 comments on commit 172885e

Please sign in to comment.