Fixing Loot and Dungeon Clear
This commit is contained in:
+16
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user