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:
parent
ed32238412
commit
24eb060000
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -46,6 +46,10 @@ export class HUDModalDialogs extends BaseHUDPart {
|
||||
this.dialogParent = element;
|
||||
}
|
||||
|
||||
isBlockingOverlay() {
|
||||
return this.dialogStack.length > 0;
|
||||
}
|
||||
|
||||
// Methods
|
||||
|
||||
/**
|
||||
|
@ -54,6 +54,10 @@ export class HUDSettingsMenu extends BaseHUDPart {
|
||||
}
|
||||
}
|
||||
|
||||
isBlockingOverlay() {
|
||||
return this.visible;
|
||||
}
|
||||
|
||||
returnToMenu() {
|
||||
this.root.gameState.goBackToMenu();
|
||||
}
|
||||
|
@ -248,4 +248,8 @@ export class HUDShop extends BaseHUDPart {
|
||||
// Nothing
|
||||
this.root.hubGoals.tryUnlockUpgrade(upgradeId);
|
||||
}
|
||||
|
||||
isBlockingOverlay() {
|
||||
return this.visible;
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -109,6 +109,10 @@ export class HUDUnlockNotification extends BaseHUDPart {
|
||||
}
|
||||
}
|
||||
|
||||
isBlockingOverlay() {
|
||||
return this.visible;
|
||||
}
|
||||
|
||||
requestClose() {
|
||||
this.root.app.adProvider.showVideoAd().then(() => {
|
||||
this.close();
|
||||
|
Loading…
Reference in New Issue
Block a user