diff options
author | bd <bdunahu@operationnull.com> | 2025-05-29 14:57:11 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-05-29 14:57:11 -0400 |
commit | 32f322b36e9a9fbdd673dcf0f13bc20cc2369e50 (patch) | |
tree | ed3ce6232e158895faa0376d6845ec628af8fcc1 /scripts/ui_panel.gd | |
parent | 0f6253876681955020005e7c29429b59250af601 (diff) |
Dim already purchased upgrades rather than remove, deep copy
Diffstat (limited to 'scripts/ui_panel.gd')
-rw-r--r-- | scripts/ui_panel.gd | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/ui_panel.gd b/scripts/ui_panel.gd index 3786410..e32115c 100644 --- a/scripts/ui_panel.gd +++ b/scripts/ui_panel.gd @@ -4,6 +4,7 @@ extends Panel @export var desc: String @export var cost: int +@export var is_valid : bool @export var sprite_atlas : Vector2i func _ready(): @@ -11,7 +12,7 @@ func _ready(): $HBoxContainer/Texture.texture = texture $HBoxContainer/Texture.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED $HBoxContainer/VBoxContainer/Label.text = desc - $HBoxContainer/VBoxContainer/Label2.text = str(cost) + $HBoxContainer/VBoxContainer/Label2.text = str(cost) if is_valid else "-" $ColorRect.color = get_theme_stylebox("panel").bg_color $ColorRect.modulate.a = 0.0 @@ -19,7 +20,7 @@ func _ready(): _update_affordability() func _update_affordability(): - if (GameData.get_life() >= cost): + if (GameData.get_life() >= cost && is_valid): $ColorRect.modulate.a = 0.0 else: $ColorRect.modulate.a = 0.75 |