diff options
author | bd <bdunahu@operationnull.com> | 2025-05-25 00:42:34 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-05-25 00:42:34 -0400 |
commit | 15724430070a17ffb4e0fe3a0c3faa8c82fe64e2 (patch) | |
tree | 6c10cca48fdfb8bf2d429989d9cd496c775bca37 /scripts/ui_panel.gd | |
parent | 6707c7331860d65eb0ac9bba56af34ea339026c9 (diff) |
Add game over screen, back to title, tower affordability indicators
Diffstat (limited to 'scripts/ui_panel.gd')
-rw-r--r-- | scripts/ui_panel.gd | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/ui_panel.gd b/scripts/ui_panel.gd index 6d3ea5a..d28812b 100644 --- a/scripts/ui_panel.gd +++ b/scripts/ui_panel.gd @@ -12,3 +12,15 @@ func _ready(): $HBoxContainer/Texture.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED $HBoxContainer/VBoxContainer/Label.text = desc $HBoxContainer/VBoxContainer/Label2.text = str(cost) + print(get_theme_stylebox("panel").bg_color) + $ColorRect.color = get_theme_stylebox("panel").bg_color + $ColorRect.modulate.a = 0.0 + + GameData.connect("life_changed", Callable(self, "_update_affordability")) + _update_affordability() + +func _update_affordability(): + if (GameData.get_life() >= cost): + $ColorRect.modulate.a = 0.0 + else: + $ColorRect.modulate.a = 0.75 |