meowbay created and other things

This commit is contained in:
Tabby 2026-01-14 19:00:40 +11:00
parent 09625d8285
commit 93cc1a8c59
35 changed files with 318 additions and 41 deletions

27
shop/listing.gd Normal file
View file

@ -0,0 +1,27 @@
extends HBoxContainer
@export var item_slot : ItemSlot
@export var button : Button
var item_cost : int
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
item_slot.block_taking = true
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if item_slot.item:
button.disabled = PlayerInventory.money <= item_cost
func prepare(item : ItemData):
item_slot.item = item
button.text = "Buy $" + str(item.buy_value)
item_cost = item.buy_value
func _on_button_pressed() -> void:
if PlayerInventory.money >= item_cost:
PlayerInventory.money -= item_cost
PlayerInventory.inventory_panel.add_item(item_slot.item)