1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00

Fix mouse panning

This commit is contained in:
tobspr 2020-09-19 20:57:20 +02:00
parent ed32238412
commit 24eb060000
7 changed files with 642 additions and 621 deletions

View File

@ -872,6 +872,10 @@ export class Camera extends BasicSerializableObject {
return;
}
if (this.root.hud.shouldPauseGame() || this.root.hud.hasBlockingOverlayOpen()) {
return;
}
if (this.desiredCenter || this.desiredZoom || this.currentlyMoving || this.currentlyPinching) {
// Performing another method of movement right now
return;

View File

@ -194,9 +194,6 @@ export class GameHUD {
* Returns true if the rendering can be paused
*/
hasBlockingOverlayOpen() {
if (this.root.camera.getIsMapOverlayActive()) {
return true;
}
for (const key in this.parts) {
if (this.parts[key].isBlockingOverlay()) {
return true;

View File

@ -46,6 +46,10 @@ export class HUDModalDialogs extends BaseHUDPart {
this.dialogParent = element;
}
isBlockingOverlay() {
return this.dialogStack.length > 0;
}
// Methods
/**

View File

@ -54,6 +54,10 @@ export class HUDSettingsMenu extends BaseHUDPart {
}
}
isBlockingOverlay() {
return this.visible;
}
returnToMenu() {
this.root.gameState.goBackToMenu();
}

View File

@ -248,4 +248,8 @@ export class HUDShop extends BaseHUDPart {
// Nothing
this.root.hubGoals.tryUnlockUpgrade(upgradeId);
}
isBlockingOverlay() {
return this.visible;
}
}

View File

@ -155,6 +155,10 @@ export class HUDStatistics extends BaseHUDPart {
document.body.classList.remove("ingameDialogOpen");
}
isBlockingOverlay() {
return this.visible;
}
show() {
this.visible = true;
document.body.classList.add("ingameDialogOpen");

View File

@ -109,6 +109,10 @@ export class HUDUnlockNotification extends BaseHUDPart {
}
}
isBlockingOverlay() {
return this.visible;
}
requestClose() {
this.root.app.adProvider.showVideoAd().then(() => {
this.close();