Broken pos
This commit is contained in:
parent
11d928c4f3
commit
3af13d0a8b
24 changed files with 304 additions and 146 deletions
19
scripts/structures/assembler.gd
Normal file
19
scripts/structures/assembler.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends StructureBehaviour
|
||||
|
||||
@export var selected_recipe : Recipe
|
||||
@onready var inventory : InOutInventory = get_parent().inventory
|
||||
|
||||
func _ready() -> void:
|
||||
await get_tree().process_frame
|
||||
switch_recipe(selected_recipe)
|
||||
await get_tree().process_frame
|
||||
for i in len(selected_recipe.ingridients):
|
||||
inventory.input_array[i].filter = selected_recipe.ingridients[i].item
|
||||
print(inventory.input_array[i].filter)
|
||||
|
||||
func switch_recipe(recipe: Recipe) -> void:
|
||||
selected_recipe = recipe
|
||||
inventory.input_capacity = len(selected_recipe.ingridients)
|
||||
inventory.resize()
|
||||
for i in len(selected_recipe.ingridients):
|
||||
inventory.input_array[i].filter = selected_recipe.ingridients[i].item
|
Loading…
Add table
Add a link
Reference in a new issue