From a6bcf24cd04c1272a72f7c475f0a61784d90445d Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Tue, 6 Jan 2026 16:46:47 +1100 Subject: [PATCH] Add button in bottom right to wait --- src/scenes/GameScene.ts | 6 +++++ .../components/PersistentButtonsComponent.ts | 25 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/scenes/GameScene.ts b/src/scenes/GameScene.ts index 03c5bd9..2bea62e 100644 --- a/src/scenes/GameScene.ts +++ b/src/scenes/GameScene.ts @@ -144,6 +144,12 @@ export class GameScene extends Phaser.Scene { } }); + this.events.on("player-wait", () => { + if (!this.awaitingPlayer) return; + if (this.isMenuOpen || this.isInventoryOpen || this.dungeonRenderer.isMinimapVisible()) return; + this.commitPlayerAction({ type: "wait" }); + }); + // Zoom Control diff --git a/src/ui/components/PersistentButtonsComponent.ts b/src/ui/components/PersistentButtonsComponent.ts index fe6fcb9..0d79d19 100644 --- a/src/ui/components/PersistentButtonsComponent.ts +++ b/src/ui/components/PersistentButtonsComponent.ts @@ -44,5 +44,30 @@ export class PersistentButtonsComponent { createBtn(105, "STATS (C)", "toggle-character"); createBtn(200, "BACKPACK (I)", "toggle-inventory"); createBtn(320, "MAP (M)", "toggle-minimap"); + + // Right-aligned buttons + const rightContainer = this.scene.add.container(this.scene.scale.width - 20, height - 20); + rightContainer.setScrollFactor(0).setDepth(1500); + + const waitBtn = this.scene.add.text(0, 0, "🕒", { + fontSize: "24px", + color: "#ffffff", + backgroundColor: "#1a1a1a", + padding: { x: 10, y: 6 }, + fontStyle: "bold" + }) + .setOrigin(1, 1) + .setInteractive({ useHandCursor: true }); + + waitBtn.on("pointerover", () => waitBtn.setBackgroundColor("#333333")); + waitBtn.on("pointerout", () => waitBtn.setBackgroundColor("#1a1a1a")); + waitBtn.on("pointerdown", () => { + waitBtn.setBackgroundColor("#444444"); + const gameScene = this.scene.scene.get("GameScene"); + gameScene.events.emit("player-wait"); + }); + waitBtn.on("pointerup", () => waitBtn.setBackgroundColor("#333333")); + + rightContainer.add(waitBtn); } }