Merge pull request #329 from thecodingmachine/fixhistory
Fixing URL not being rewritten when changing maps
This commit is contained in:
commit
2fe61ce11b
@ -64,7 +64,7 @@ export class GameManager {
|
|||||||
public async goToStartingMap(scenePlugin: Phaser.Scenes.ScenePlugin) {
|
public async goToStartingMap(scenePlugin: Phaser.Scenes.ScenePlugin) {
|
||||||
const url = await this.startRoom.getMapUrl();
|
const url = await this.startRoom.getMapUrl();
|
||||||
console.log('Starting scene '+url);
|
console.log('Starting scene '+url);
|
||||||
scenePlugin.start(url, {startLayerName: 'global'});
|
scenePlugin.start(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,6 +417,13 @@ export class GameScene extends ResizableScene implements CenterListener {
|
|||||||
context.stroke();
|
context.stroke();
|
||||||
this.circleTexture.refresh();
|
this.circleTexture.refresh();
|
||||||
|
|
||||||
|
// Let's alter browser history
|
||||||
|
let path = this.room.id;
|
||||||
|
if (this.startLayerName) {
|
||||||
|
path += '#'+this.startLayerName;
|
||||||
|
}
|
||||||
|
window.history.pushState({}, 'WorkAdventure', path);
|
||||||
|
|
||||||
// Let's pause the scene if the connection is not established yet
|
// Let's pause the scene if the connection is not established yet
|
||||||
if (this.connection === undefined) {
|
if (this.connection === undefined) {
|
||||||
// Let's wait 0.5 seconds before printing the "connecting" screen to avoid blinking
|
// Let's wait 0.5 seconds before printing the "connecting" screen to avoid blinking
|
||||||
|
Loading…
Reference in New Issue
Block a user