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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.root.hud.shouldPauseGame() || this.root.hud.hasBlockingOverlayOpen()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.desiredCenter || this.desiredZoom || this.currentlyMoving || this.currentlyPinching) {
|
if (this.desiredCenter || this.desiredZoom || this.currentlyMoving || this.currentlyPinching) {
|
||||||
// Performing another method of movement right now
|
// Performing another method of movement right now
|
||||||
return;
|
return;
|
||||||
|
@ -194,9 +194,6 @@ export class GameHUD {
|
|||||||
* Returns true if the rendering can be paused
|
* Returns true if the rendering can be paused
|
||||||
*/
|
*/
|
||||||
hasBlockingOverlayOpen() {
|
hasBlockingOverlayOpen() {
|
||||||
if (this.root.camera.getIsMapOverlayActive()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
for (const key in this.parts) {
|
for (const key in this.parts) {
|
||||||
if (this.parts[key].isBlockingOverlay()) {
|
if (this.parts[key].isBlockingOverlay()) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -46,6 +46,10 @@ export class HUDModalDialogs extends BaseHUDPart {
|
|||||||
this.dialogParent = element;
|
this.dialogParent = element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isBlockingOverlay() {
|
||||||
|
return this.dialogStack.length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,6 +54,10 @@ export class HUDSettingsMenu extends BaseHUDPart {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isBlockingOverlay() {
|
||||||
|
return this.visible;
|
||||||
|
}
|
||||||
|
|
||||||
returnToMenu() {
|
returnToMenu() {
|
||||||
this.root.gameState.goBackToMenu();
|
this.root.gameState.goBackToMenu();
|
||||||
}
|
}
|
||||||
|
@ -248,4 +248,8 @@ export class HUDShop extends BaseHUDPart {
|
|||||||
// Nothing
|
// Nothing
|
||||||
this.root.hubGoals.tryUnlockUpgrade(upgradeId);
|
this.root.hubGoals.tryUnlockUpgrade(upgradeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isBlockingOverlay() {
|
||||||
|
return this.visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,6 +155,10 @@ export class HUDStatistics extends BaseHUDPart {
|
|||||||
document.body.classList.remove("ingameDialogOpen");
|
document.body.classList.remove("ingameDialogOpen");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isBlockingOverlay() {
|
||||||
|
return this.visible;
|
||||||
|
}
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
document.body.classList.add("ingameDialogOpen");
|
document.body.classList.add("ingameDialogOpen");
|
||||||
|
@ -109,6 +109,10 @@ export class HUDUnlockNotification extends BaseHUDPart {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isBlockingOverlay() {
|
||||||
|
return this.visible;
|
||||||
|
}
|
||||||
|
|
||||||
requestClose() {
|
requestClose() {
|
||||||
this.root.app.adProvider.showVideoAd().then(() => {
|
this.root.app.adProvider.showVideoAd().then(() => {
|
||||||
this.close();
|
this.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user