From 8e1ebc12b01a536f8530cde182875141a4dd5cdd Mon Sep 17 00:00:00 2001 From: Anmol Upadhyay Date: Mon, 27 Oct 2025 12:06:46 +0530 Subject: [PATCH] hide map button from pause menu --- src/components/buttons/close-button.ts | 19 ++++++++++++++----- src/components/popups/pause-popup.ts | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/buttons/close-button.ts b/src/components/buttons/close-button.ts index b23aa441d..f210af525 100644 --- a/src/components/buttons/close-button.ts +++ b/src/components/buttons/close-button.ts @@ -1,4 +1,4 @@ -import { isClickInsideButton, loadImages } from "@common"; +import { isClickInsideButton, loadImages, Utils } from "@common"; import { MAP_BTN_IMG } from "@constants"; export default class CloseButton { @@ -26,10 +26,13 @@ export default class CloseButton { this.context = context; this.canvas = canvas; - loadImages({ close_button_image: MAP_BTN_IMG }, (images) => { - this.close_button_image = images["close_button_image"]; - this.imagesLoaded = true; - }); + // don't load the image when respect mode is enabled + if (!Utils.isRespect) { + loadImages({ close_button_image: MAP_BTN_IMG }, (images) => { + this.close_button_image = images["close_button_image"]; + this.imagesLoaded = true; + }); + } this.btnSizeAnimation = 0.19; this.btnOriginalSize = this.btnSizeAnimation; @@ -37,6 +40,9 @@ export default class CloseButton { } draw() { + // hide button in respect mode + if (Utils.isRespect) return; + if (this.imagesLoaded) { this.context.drawImage( this.close_button_image, @@ -56,6 +62,9 @@ export default class CloseButton { } onClick(xClick: number, yClick: number): boolean { + // ignore clicks in respect mode + if (Utils.isRespect) return false; + const isInside = isClickInsideButton( xClick, yClick, diff --git a/src/components/popups/pause-popup.ts b/src/components/popups/pause-popup.ts index 248d22e01..9791ac171 100644 --- a/src/components/popups/pause-popup.ts +++ b/src/components/popups/pause-popup.ts @@ -43,7 +43,7 @@ export default class PausePopUp { this.retryButton = new RetryButton( this.context, this.canvas, - this.canvas.width * 0.55, + this.canvas.width * 0.5 - (this.canvas.width * 0.19) / 2, this.canvas.height * 0.2 + this.canvas.width * 0.4 - (this.canvas.width * 0.19) / 2