diff --git a/client/app.js b/client/app.js index 56dbf79..460f475 100644 --- a/client/app.js +++ b/client/app.js @@ -66,7 +66,14 @@ export class App extends decorate(class {}) { this.roomView = new RoomView(this.room, this.stage.renderer); this.stage.addChild(this.roomView); this.on('darknessChanged', this.applyLighting, this); - this.on('isFocusedChanged', this.applyLighting, this); + this.on('isFocusedChanged', () => { + if (this.isFocused) { + this.stage.removeAllFilters(); + } + else { + this.stage.sepia(); + } + }) // Listen for new entities. this.room.on('entityAdded', this.onRoomEntityAdded, this); // Input. @@ -100,7 +107,6 @@ export class App extends decorate(class {}) { } applyLighting() { - this.stage.removeAllFilters(); const roomView = this.roomView; if (!roomView) { return; @@ -128,9 +134,6 @@ export class App extends decorate(class {}) { const layerContainer = layerView.layerContainer; layerContainer.night(this.darkness); } - if (!this.isFocused) { - this.stage.paused(this.darkness); - } } calculateDarkness() {