Add button in bottom right to wait

This commit is contained in:
Peter Stockings
2026-01-06 16:46:47 +11:00
parent a9779348e9
commit a6bcf24cd0
2 changed files with 31 additions and 0 deletions

View File

@@ -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

View File

@@ -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);
}
}