Return of smooth belt

This commit is contained in:
Rendo 2025-10-16 19:52:27 +05:00
commit d413c211b5
3 changed files with 4 additions and 3 deletions

View file

@ -4,4 +4,3 @@ extends Node2D
class_name StructureBehaviour
@onready var structure_parent : Structure = get_parent()
@onready var inventory : Inventory = structure_parent.inventory

View file

@ -1,7 +1,9 @@
extends StructureBehaviour
@onready var inventory : InOutInventory = structure_parent.inventory
@export var selected_recipe : Recipe
func _ready() -> void:
inventory.stack_added.connect(check_for_recipe)
await get_tree().process_frame

View file

@ -1,6 +1,6 @@
extends StructureBehaviour
@onready var animator : AnimationPlayer = $"../AnimationPlayer"
@onready var inventory : BeltInventory = structure_parent.inventory
func _draw() -> void:
for i in range(inventory.capacity):
@ -23,7 +23,7 @@ func get_next() -> Structure:
return structure_parent.get_relative(structure_parent.direction_vector())
func try_transfer(structure : Structure) -> void:
if structure == null or inventory.internal_array[inventory.capacity-1].amount == 0:
if structure == null or inventory.internal_array[inventory.capacity-1].amount == 0 or inventory.progress_array[inventory.capacity-1] < inventory.pop_treshold:
return
var last_slot = inventory.internal_array[inventory.capacity-1]
var ang_diff = structure_parent.direction_difference(structure)