more work on the ui theme and changing the hud

This commit is contained in:
2025-11-05 08:28:07 +11:00
parent 2f4159ebbe
commit f257a5df68
187 changed files with 806 additions and 799 deletions

View File

@@ -2,7 +2,6 @@ class_name PickupNotification
extends PanelContainer
@export var fade_out_time: float
@export var style: StyleBoxFlat
@export var text_style: Color
@export var common_background: Color
@export var uncommon_background: Color
@@ -15,19 +14,17 @@ var fading: bool = false
func _ready() -> void:
add_theme_stylebox_override("panel", style)
$HBoxContainer/Label.add_theme_color_override("font_color", text_style)
$HBoxContainer/Label2.add_theme_color_override("font_color", text_style)
$Timer.start()
func _process(delta: float) -> void:
if fading:
fade_time += delta
style.bg_color.a = lerp(200.0 / 255.0, 0.0, fade_time / fade_out_time)
text_style.a = lerp(220.0 / 255.0, 0.0, fade_time / fade_out_time)
$HBoxContainer/Label.add_theme_color_override("font_color", text_style)
$HBoxContainer/Label2.add_theme_color_override("font_color", text_style)
var mod_color: Color = Color.WHITE
mod_color.a = 1.0 - (fade_time / fade_out_time)
modulate = mod_color
#$HBoxContainer/Label.add_theme_color_override("font_color", text_style)
#$HBoxContainer/Label2.add_theme_color_override("font_color", text_style)
if fade_time >= fade_out_time:
queue_free()
@@ -36,15 +33,15 @@ func set_card(card: Card) -> void:
$HBoxContainer/Label.text = tr(card.display_name)
match(card.rarity):
Data.Rarity.COMMON:
style.bg_color = common_background
$HBoxContainer/Label.add_theme_color_override("font_color", common_background)
Data.Rarity.UNCOMMON:
style.bg_color = uncommon_background
$HBoxContainer/Label.add_theme_color_override("font_color", uncommon_background)
Data.Rarity.RARE:
style.bg_color = rare_background
$HBoxContainer/Label.add_theme_color_override("font_color", rare_background)
Data.Rarity.EPIC:
style.bg_color = epic_background
$HBoxContainer/Label.add_theme_color_override("font_color", epic_background)
Data.Rarity.LEGENDARY:
style.bg_color = legendary_background
$HBoxContainer/Label.add_theme_color_override("font_color", legendary_background)
func _on_timer_timeout() -> void: