Continued refactoring of the maps library.

This commit is contained in:
2019-11-13 12:42:06 +01:00
parent 58cbd44a7b
commit 285e41434a
10 changed files with 193 additions and 118 deletions
+5 -10
View File
@@ -105,7 +105,7 @@ export default class MapApp extends PIXIApp {
super.setup()
// TODO get access to fps display
let fpsDisplay
let fpsDisplay = null
this.stage.children.forEach(element => {
if (element.refreshFps) fpsDisplay = element
})
@@ -114,8 +114,7 @@ export default class MapApp extends PIXIApp {
this.ui = new PIXI.Container()
this.scene.addChild(this.ui)
if (this.fpsLogging && fpsDisplay) this.ui.addChild(fpsDisplay)
if (this.fpsLogging != null && fpsDisplay != null) this.ui.addChild(fpsDisplay)
if (this.coordsLogging) {
this.coordsDisplay = new CoordinateDisplay(this)
@@ -216,10 +215,11 @@ export default class MapApp extends PIXIApp {
lastMap.flushHandlers()
}
this.map.onTransform.add(this.transformed.bind(this))
this.transformed()
this.onMapChanged.call(this, this.map)
this.map.onTransform.add(this.transformed.bind(this))
if (this.ui && this.ui.parent) {
const parent = this.ui.parent
@@ -249,11 +249,6 @@ export default class MapApp extends PIXIApp {
this.overlayElements.set(layer, obj)
}
addMapOverlay(layer) {
this.mapLayer.place(layer)
}
/**
* Copies the current coordinates to the clipboard.
*/