RustHacker/crafting/recipe book/recipie_book.gd

21 lines
582 B
GDScript3
Raw Permalink Normal View History

2026-01-12 19:32:35 +11:00
extends PanelContainer
@export var vbox : VBoxContainer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
2026-01-12 19:55:40 +11:00
RecipeManager.recipes_loaded.connect(recipes_loaded)
2026-01-12 19:32:35 +11:00
pass # Replace with function body.
2026-01-12 19:55:40 +11:00
2026-01-12 19:32:35 +11:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
2026-01-12 19:55:40 +11:00
func recipes_loaded():
for recipe in RecipeManager.craft_recipes:
var new_card = load("res://crafting/recipe book/recipe_card.tscn").instantiate() as RecipeCard
new_card.show_recipe(recipe)
vbox.add_child(new_card)