class_name InventoryItemRect
|
|
extends Panel
|
|
|
|
|
|
@export var item_resource: ItemResource
|
|
|
|
@onready var amount_label: Label = $AmountLabel
|
|
@onready var item_texture: TextureRect = $ItemTexture
|
|
|
|
|
|
func update_rect() -> void:
|
|
item_texture.texture = load(item_resource.item_texture)
|
|
amount_label.text = "x" + str(item_resource.amount)
|
|
tooltip_text = item_resource.name
|
|
|
|
|
|
func on_stack_full(is_full: bool) -> void:
|
|
if is_full:
|
|
amount_label.add_theme_color_override("font_color", Color(1, 0, 0))
|
|
else:
|
|
amount_label.add_theme_color_override("font_color", Color(1, 1, 1))
|