19 lines
441 B
GDScript
19 lines
441 B
GDScript
class_name PropInventory extends Resource
|
|
|
|
@export var items := [] as Array[PropItem]
|
|
@export var current_index := 0
|
|
|
|
|
|
func add_item(prop_key: String, texture_path: String) -> void:
|
|
var item = PropItem.new()
|
|
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()
|