add gamestate, doc and fix

This commit is contained in:
2026-04-16 11:01:04 +02:00
parent dc0bf0ba37
commit e02bd1819f
29 changed files with 466 additions and 71 deletions

View File

@@ -2,15 +2,21 @@ extends Control
class_name CollectibleUI
@onready var label: Label = $Panel/MarginContainer/VBoxContainer/Label
@onready var texture_rect: TextureRect = $Panel/MarginContainer/VBoxContainer/TextureRect
@onready var label: Label = $%CollectibleName
@onready var texture_rect: TextureRect = $%CollectibleTexture
var collectible_resource: CollectibleResource
func setup(collectible: CollectibleResource) -> void:
collectible_resource = collectible
$Panel/MarginContainer/VBoxContainer/Label.text = collectible_resource.title
if !label:
label = $%CollectibleName
label.text = collectible_resource.title
if collectible.image:
$Panel/MarginContainer/VBoxContainer/TextureRect.texture = collectible_resource.image
if !texture_rect:
texture_rect = $%CollectibleTexture
texture_rect.texture = collectible_resource.image
func unlock() -> void:
$Panel/MarginContainer/VBoxContainer/TextureRect.set_modulate(Color(1,1,1,1))
if !texture_rect:
texture_rect = $%CollectibleTexture
texture_rect.set_modulate(Color(1,1,1,1))