Add quick slot and consumables (health and mana potions)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user