Fixing Loot and Dungeon Clear
This commit is contained in:
+3
-3
@@ -13,7 +13,6 @@ bg_color = Color(1, 0.77254903, 0.11764706, 1)
|
||||
|
||||
[node name="Hud" type="CanvasLayer"]
|
||||
layer = 5
|
||||
visible = false
|
||||
script = ExtResource("1_hud")
|
||||
|
||||
[node name="TopLeft" type="Control" parent="."]
|
||||
@@ -146,8 +145,9 @@ stretch_mode = 5
|
||||
|
||||
[node name="EventLog" type="VBoxContainer" parent="TopRight"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
offset_top = 134.0
|
||||
offset_right = 125.0
|
||||
offset_bottom = 434.0
|
||||
|
||||
[node name="BottomCenter" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
|
||||
+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