soil/src/ingame/quad_viewmodel.gd
2025-02-13 11:23:13 +03:00

10 lines
312 B
GDScript

extends Node3D
func reflect_bundle(p_bundle: Dictionary) -> void:
var item = GameState.fetch().INVENTORY_ITEM_DB[p_bundle["item_id"]]
$Sprite3D.texture = item.icon
if item.stackable:
$CountLabel.text = str(p_bundle["count"]) + "/" + str(item.stack_limit)
else:
$CountLabel.text = str(p_bundle["count"])