Add quick slot and consumables (health and mana potions)

This commit is contained in:
Peter Stockings
2026-01-06 18:23:34 +11:00
parent 57fb85f62e
commit 3b29180a00
8 changed files with 281 additions and 4 deletions

View File

@@ -59,6 +59,16 @@ export class PersistentButtonsComponent {
.setOrigin(1, 1)
.setInteractive({ useHandCursor: true });
const searchBtn = this.scene.add.text(-40, 0, "🔍", { // Offset to the left of wait button
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", () => {
@@ -68,6 +78,18 @@ export class PersistentButtonsComponent {
});
waitBtn.on("pointerup", () => waitBtn.setBackgroundColor("#333333"));
searchBtn.on("pointerover", () => searchBtn.setBackgroundColor("#333333"));
searchBtn.on("pointerout", () => searchBtn.setBackgroundColor("#1a1a1a"));
searchBtn.on("pointerdown", () => {
searchBtn.setBackgroundColor("#444444");
// Implementing search visual logic later, for now just log
console.log("Searching...");
const gameScene = this.scene.scene.get("GameScene");
gameScene.events.emit("player-search");
});
searchBtn.on("pointerup", () => searchBtn.setBackgroundColor("#333333"));
rightContainer.add(waitBtn);
rightContainer.add(searchBtn);
}
}