recipie book autoloading working

This commit is contained in:
Tabby 2026-01-12 19:55:40 +11:00
parent e8c1f85a5b
commit 4f899c13f9
8 changed files with 134 additions and 10 deletions

View file

@ -4,14 +4,17 @@ extends PanelContainer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
RecipeManager.recipes_loaded.connect(recipes_loaded)
pass # Replace with function body.
var test_card = load("res://crafting/recipe book/recipe_card.tscn").instantiate() as RecipeCard
var recipe : CraftRecipe = load("res://crafting/crafts/computer_craft.tres")
print(recipe)
test_card.show_recipe(recipe)
vbox.add_child(test_card)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
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)