xiandie/scene/hud/prop_inventory.gd

19 lines
441 B
GDScript3
Raw Normal View History

class_name PropInventory extends Resource
@export var items := [] as Array[PropItem]
@export var current_index := 0
2025-01-10 07:43:55 +00:00
func add_item(prop_key: String, texture_path: String) -> void:
var item = PropItem.new()
2025-01-10 07:43:55 +00:00
item.key = prop_key
item.texture_path = texture_path
items.push_back(item)
emit_changed()
func index_wrap_add(delta: int) -> void:
current_index += delta
current_index = wrapi(current_index, 0, items.size())
emit_changed()