diff --git a/crafting/crafts/computer_craft.tres b/crafting/crafts/computer_craft.tres index adf7a63..f7c86b9 100644 --- a/crafting/crafts/computer_craft.tres +++ b/crafting/crafts/computer_craft.tres @@ -9,4 +9,5 @@ [resource] script = ExtResource("2_2p7jb") ingredients = Array[ExtResource("1_ayiw2")]([ExtResource("2_egxug"), ExtResource("4_tkhhn"), ExtResource("3_ccdvw"), null, null, null, null, null, null]) +output = ExtResource("4_tkhhn") metadata/_custom_type_script = "uid://b4iu5xrdf0evs" diff --git a/inv_system/crafting_panel.gd b/inv_system/crafting_panel.gd index dfa920d..0c1c4cb 100644 --- a/inv_system/crafting_panel.gd +++ b/inv_system/crafting_panel.gd @@ -92,4 +92,15 @@ func style_none(): func _on_action_button_pressed() -> void: + if not matched_recipe: + return + if matched_recipe is CraftRecipe: + var crafting : CraftRecipe = matched_recipe + empty_grid() + add_item(crafting.output) pass # Replace with function body. + +func empty_grid(): + for slot in slots: + slot.item = null + slot.update_ui()