Return of smooth belt
This commit is contained in:
parent
8dcd7725a9
commit
d413c211b5
3 changed files with 4 additions and 3 deletions
|
@ -4,4 +4,3 @@ extends Node2D
|
||||||
class_name StructureBehaviour
|
class_name StructureBehaviour
|
||||||
|
|
||||||
@onready var structure_parent : Structure = get_parent()
|
@onready var structure_parent : Structure = get_parent()
|
||||||
@onready var inventory : Inventory = structure_parent.inventory
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
extends StructureBehaviour
|
extends StructureBehaviour
|
||||||
|
|
||||||
|
@onready var inventory : InOutInventory = structure_parent.inventory
|
||||||
@export var selected_recipe : Recipe
|
@export var selected_recipe : Recipe
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
inventory.stack_added.connect(check_for_recipe)
|
inventory.stack_added.connect(check_for_recipe)
|
||||||
await get_tree().process_frame
|
await get_tree().process_frame
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
extends StructureBehaviour
|
extends StructureBehaviour
|
||||||
|
|
||||||
@onready var animator : AnimationPlayer = $"../AnimationPlayer"
|
@onready var inventory : BeltInventory = structure_parent.inventory
|
||||||
|
|
||||||
func _draw() -> void:
|
func _draw() -> void:
|
||||||
for i in range(inventory.capacity):
|
for i in range(inventory.capacity):
|
||||||
|
@ -23,7 +23,7 @@ func get_next() -> Structure:
|
||||||
return structure_parent.get_relative(structure_parent.direction_vector())
|
return structure_parent.get_relative(structure_parent.direction_vector())
|
||||||
|
|
||||||
func try_transfer(structure : Structure) -> void:
|
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
|
return
|
||||||
var last_slot = inventory.internal_array[inventory.capacity-1]
|
var last_slot = inventory.internal_array[inventory.capacity-1]
|
||||||
var ang_diff = structure_parent.direction_difference(structure)
|
var ang_diff = structure_parent.direction_difference(structure)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue