recipe book started

This commit is contained in:
Tabby 2026-01-12 19:32:35 +11:00
parent d47351cf00
commit e8c1f85a5b
10 changed files with 229 additions and 49 deletions

View file

@ -0,0 +1,28 @@
extends PanelContainer
class_name RecipeCard
@export var grid_container : GridContainer
var ingredient_slots : Array[ItemSlot]
@export var output_slot : ItemSlot
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
ingredient_slots.assign(grid_container.get_children())
#slots.assign(grid.get_children())
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func show_recipe(recipe : CraftRecipe):
ingredient_slots.assign(grid_container.get_children())
for x in range(9):
#if recipe.ingredients[x]:
ingredient_slots[x].item = recipe.ingredients[x]
ingredient_slots[x].update_ui()
ingredient_slots[x].block_taking = true
output_slot.item = recipe.output
output_slot.update_ui()
output_slot.block_taking = true