This commit is contained in:
Rendo 2025-10-14 21:55:24 +05:00
commit 222960a824
19 changed files with 282 additions and 22 deletions

View file

@ -0,0 +1,20 @@
extends Node2D
@onready var inventory : ConveyorInventory = get_parent().inventory
func _draw() -> void:
for i in range(inventory.capacity):
if inventory.internal_array[i].amount > 0:
var calculated_position = Vector2(-8,0)+Vector2(16/inventory.capacity*i+16/inventory.capacity*inventory.progress_array[i],0)
draw_texture(inventory.internal_array[i].held_item.preview,calculated_position - inventory.internal_array[i].held_item.preview.get_size()/2.0)
func _process(delta: float) -> void:
inventory.advance(delta)
queue_redraw()
var right : Structure = get_parent().get_relative(Vector2.RIGHT)
if right == null or right.inventory.can_add() == false:
return
var popped = inventory.pop()
if popped == null:
return
right.inventory.add(popped)

View file

@ -0,0 +1 @@
uid://bp341eiwvfvyl

View file

@ -0,0 +1,9 @@
extends Node
const test_item :=preload("res://generic/items/dbg_item.tres")
func _process(_delta: float) -> void:
for point in [Vector2(-1,0),Vector2(1,0),Vector2(0,1),Vector2(0,-1)]:
var found_structure = get_parent().get_relative(point)
if found_structure:
found_structure.inventory.add(Stack.new(test_item,1))

View file

@ -0,0 +1 @@
uid://v3j1d3qyg30i