Merge pull request #335 from thecodingmachine/develop

Fixing change of map with relative URLs (deploy to prod)
This commit is contained in:
David Négrier 2020-10-16 09:37:40 +02:00 committed by GitHub
commit fcb3972296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,6 +317,13 @@ export class GameScene extends ResizableScene implements CenterListener {
//permit to set bound collision
this.physics.world.setBounds(0, 0, this.Map.widthInPixels, this.Map.heightInPixels);
// Let's alter browser history
let path = this.room.id;
if (this.room.hash) {
path += '#'+this.room.hash;
}
window.history.pushState({}, 'WorkAdventure', path);
//add layer on map
this.Layers = new Array<Phaser.Tilemaps.StaticTilemapLayer>();
let depth = -2;
@ -404,13 +411,6 @@ export class GameScene extends ResizableScene implements CenterListener {
context.stroke();
this.circleTexture.refresh();
// Let's alter browser history
let path = this.room.id;
if (this.room.hash) {
path += '#'+this.room.hash;
}
window.history.pushState({}, 'WorkAdventure', path);
// Let's pause the scene if the connection is not established yet
if (this.connection === undefined) {
// Let's wait 0.5 seconds before printing the "connecting" screen to avoid blinking