Fixing Loot and Dungeon Clear

This commit is contained in:
dingo
2025-12-17 07:53:14 -05:00
parent 2c9d3200f8
commit 353de811f6
2 changed files with 19 additions and 4 deletions
+16 -1
View File
@@ -235,10 +235,25 @@ func _get_rarity_color(rarity: String) -> Color:
"legendary": return Color(0.95, 0.61, 0.07)
_: return Color.WHITE
func add_log_entry(test: String, color: Color):
func add_log_entry(text: String, color: Color):
if not event_log:
print("[HUD] No event_log found for loot display!")
return
var label = RichTextLabel.new()
label.bbcode_enabled = true
label.fit_content = true
label.scroll_active = false
label.text = "[color=#%s]%s[/color]" % [color.to_html(false), text]
event_log.add_child(label)
# Auto-remove after 5 seconds
var timer = get_tree().create_timer(5.0)
timer.timeout.connect(func():
if is_instance_valid(label):
label.queue_free()
)
# Keep log from getting too long
while event_log.get_child_count() > 10:
event_log.get_child(0).queue_free()